I'm creating a QProgressDialog
as follows:
QProgressDialog progressDialog = new QProgressDialog(tr("Calculating..."), NULL, 0, 100, this);
progressDialog->setAutoClose(true);
progressDialog->setValue(0);
progressDialog->setWindowTitle(tr("Calculate Weights"));
progressDialog->setWindowFlags(progressDialog->windowFlags() & ~Qt::WindowCloseButtonHint);
progressDialog->show();
Note that I'm using the Qt::WindowCloseButtonHint
flag to disable the 'native close button'. It seems to work well on Windows but not on OS X (on OS X the close button is still available and the user can close the QProgressDialog
).
I have also tested with other flags (e.g. Qt::WindowSystemMenuHint
, Qt::WindowTransparentForInput
) but none have solved my problem.
Sure I can use the Qt::FramelessWindowHint
flag to remove the 'entire border of the window' but it is not my objective, since I just want to disable the close button.
What window flag can I use to disable/block the QProgressBar
close button on OS X?