Window Modality & Drawer Question
-
wrote on 29 Sept 2023, 09:00 last edited by
Hi everybody.
May be I am mistaken or have forgotten how to do it.
I think it was possible to get a dialog as a "top drawer" in the Main window by setting its modality to "Application" modal.Now when I do this in Qt Creator I get a standard Modal Window
but not "a dialog sliding out from the top".What I am missing here?
I use Qt 5.5.13 and Qt Creator 10.0.0 rc-1.
thx in advance
-
Hi everybody.
May be I am mistaken or have forgotten how to do it.
I think it was possible to get a dialog as a "top drawer" in the Main window by setting its modality to "Application" modal.Now when I do this in Qt Creator I get a standard Modal Window
but not "a dialog sliding out from the top".What I am missing here?
I use Qt 5.5.13 and Qt Creator 10.0.0 rc-1.
thx in advance
-
wrote on 30 Sept 2023, 06:38 last edited by ademmler
@mpergand Hi, yes you are right - I am talking about "sheet".
I tried to set Modality from code and within QtCreator.
In Both cases it does not work and I get a normal dialog popping up.mAssistant = new ManualAssistant(); mAssistant->setModal(true); mAssistant->setWindowModality(Qt::WindowModal); mAssistant->show(); //I tried also mAssistant->exec()
Seems to be broken somehow.
Regards Alex
-
@mpergand Hi, yes you are right - I am talking about "sheet".
I tried to set Modality from code and within QtCreator.
In Both cases it does not work and I get a normal dialog popping up.mAssistant = new ManualAssistant(); mAssistant->setModal(true); mAssistant->setWindowModality(Qt::WindowModal); mAssistant->show(); //I tried also mAssistant->exec()
Seems to be broken somehow.
Regards Alex
-
@ademmler
You need to set the sheet a parent window:
mAssistant = new ManualAssistant(this); // this is the parent window
or
mAssistant->setParent(parent window)wrote on 2 Oct 2023, 08:15 last edited by ademmler 10 Feb 2023, 08:16@mpergand said in Window Modality & Drawer Question:
mAssistant->setParent(parent window)
Thx for your hint - if I do so I get a modal dialog.
But it sits in the window center and not as "sheet" at the top.Regards Alex
-
@mpergand Hi, yes you are right - I am talking about "sheet".
I tried to set Modality from code and within QtCreator.
In Both cases it does not work and I get a normal dialog popping up.mAssistant = new ManualAssistant(); mAssistant->setModal(true); mAssistant->setWindowModality(Qt::WindowModal); mAssistant->show(); //I tried also mAssistant->exec()
Seems to be broken somehow.
Regards Alex
wrote on 2 Oct 2023, 09:43 last edited by mpergand 10 Feb 2023, 09:44Try to add Qt::Window to setParent as here:
mAssistant = new ManualAssistant();
mAssistant->setModal(true);
mAssistant->setParent(parent, Qt::Window);
mAssistant->exec();
3/6