在构造器开始,加以下代码:
Qt::WindowFlags windowFlag = Qt::Dialog;
windowFlag |= Qt::WindowMinimizeButtonHint;
windowFlag |= Qt::WindowMaximizeButtonHint;
windowFlag |= Qt::WindowCloseButtonHint;
setWindowFlags(windowFlag);
如果加在尾部,会产生怪问题。