I have the following code that is called when I insert a QMdiSubWindow into a QMdiArea:
Qt::WindowFlags flags;
flags = Qt::Widget | Qt::WindowMinimizeButtonHint | Qt::WindowTitleHint;
if(closeable)
{
qDebug("Window is closeable. %x", Qt::WindowCloseButtonHint);
flags |= Qt::WindowCloseButtonHint;
}
For some reason, even when closeable is true, the clos开发者_如何学运维ebutton won't display on the widget's titlebar.
This is the call to insert the widget into the QMdiArea.
mdi->addSubWindow(widget, flags);
Any suggestions?
I found that playing around with the window flags example included with the sdk was a lot of help when trying to get the flags correct.
C:\QtSDK\Examples\4.7\widgets\windowflags\
精彩评论