PDA

View Full Version : close button not there in Mac but its in window



netmat
16th April 2010, 07:36
MyControlPanel::MyControlPanel(QWidget *parent) :
QFrame(parent, Qt::Window)
{

setWindowTitle("Web SDK Simulator");

setupUi(this);
MySettings::instance()->setParent(this,Qt::Window | Qt::WindowSystemMenuHint);
}

I have code like this where I am creating a widget Setting which is child of Control Panel (type QFrame).
The setting widget not showing any button on Mac while its display close button on title bar rightly.

I have tried many options of window flags but to no avail.
Pls menation if I am missing something or any work around to achoieve this.

Ton of thanks,
-netmat

netmat
19th April 2010, 07:19
#ifdef Q_OS_MAC
Qt::WindowFlags flag = (this->windowFlags() | Qt::CustomizeWindowHint);
flag |= Qt::WindowTitleHint;
MySettings::instance()->setParent(this, flag);
#else

MySettings::instance()->overrideWindowFlags(windowFlags() & Qt::WindowCloseButtonHint);
#endif


this solved the problem.