WindowSystemMenuHint strange bug
-
@Engelard isn't that ...HelpButtonHint?
which type of widget is your dialog? it may be the platform defaiult to show it.
-
Hi
The reason for the odd look is due to you remove all its flags
setWindowFlags(Qt::WindowSystemMenuHint);
Now ONLY WindowSystemMenuHint is set. not Dialog and all the others it needs.
You need to do
setWindowFlags(windowFlags() & ~Qt::WindowSystemMenuHint);
which takes the current flags and bitwise disable only hint. -
Hi
The reason for the odd look is due to you remove all its flags
setWindowFlags(Qt::WindowSystemMenuHint);
Now ONLY WindowSystemMenuHint is set. not Dialog and all the others it needs.
You need to do
setWindowFlags(windowFlags() & ~Qt::WindowSystemMenuHint);
which takes the current flags and bitwise disable only hint.Very good stuff. But.
- as i understand, it set it from windowFlags() which comes from parent, it do totally no effect if i would try set it up from it's own flags:
myNewDialog->windowFlags()
- As it appliable only from parent(QMainWindow), it adds maximize and minimize hints, maximize is unnecessary, so i tried to remove it, but it only disable it, not hide:
myNewDialog->setWindowFlags(windowFlags() & (~Qt::WindowSystemMenuHint & ~Qt::WindowMaximizeButtonHint));
-
Very good stuff. But.
- as i understand, it set it from windowFlags() which comes from parent, it do totally no effect if i would try set it up from it's own flags:
myNewDialog->windowFlags()
- As it appliable only from parent(QMainWindow), it adds maximize and minimize hints, maximize is unnecessary, so i tried to remove it, but it only disable it, not hide:
myNewDialog->setWindowFlags(windowFlags() & (~Qt::WindowSystemMenuHint & ~Qt::WindowMaximizeButtonHint));
-
Not all combinations works all types of windows.
-
@Engelard
Oh, must be from dialog :)myNewDialog->setWindowFlags(myNewDialog->windowFlags() & (~Qt::WindowSystemMenuHint & ~Qt::WindowMaximizeButtonHint));
-
Hi
I triedCustomDialog::CustomDialog(QWidget *parent) : QDialog(parent), ui(new Ui::CustomDialog) { ui->setupUi(this); setWindowFlags(Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint); }
-
Lol i figure it out, with little help of Qt documentation and imagination:
resultsWindow = new FinalResult(this); Qt::WindowFlags flags = 0; flags = Qt::Dialog; resultsWindow->setWindowFlags(flags |= Qt::WindowSystemMenuHint); // question mark removed, but close button now disabled resultsWindow->setWindowFlag(Qt::WindowCloseButtonHint, true);
-
Hi
I triedCustomDialog::CustomDialog(QWidget *parent) : QDialog(parent), ui(new Ui::CustomDialog) { ui->setupUi(this); setWindowFlags(Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint); }
-
@mrjj said in WindowSystemMenuHint strange bug:
Hi
I triedI try that stuff long ago, no efforts of doing that attempts from the constructor of child QDialog were paid...