Solved QDialog setWindowFlags(Qt::Tool) Dialog is not Active
-
when i setWindowFlags(Qt::Tool) in my dialog, while not click on the dialog it is not active. Any idea?
-
dlgChooseContacts *dlgChoose = new dlgChooseContacts(last dialog) // set parent and it is hidden of taskbar dlgChoose.exec();
its also work.
-
Hi
What you mean?
If you set setWindowFlags(Qt::Tool,true) and dialog is not the active window, it wont change to
tool style? -
@mrjj
Choose Contacts is a last dialog and it is not active (i have setWindowFlags(Qt::Tool)).
@mrjj said in QDialog setWindowFlags(Qt::Tool) Dialog is not Active:
setWindowFlags(Qt::Tool,true)
true ? no.. i have just setWindowFlags(Qt::Tool);
-
@Taz742
sorry my bad. its not with S in the end
setWindowFlag( key, true/false );Active ?
as in you cant click on anything in it or in what way not active?Note then you set with
setWindowFlags(Qt::Tool)).
you kill all other flags and only Qt::Tool remains.or do you mean active as i when you call
activateWindow() on it ? -
@mrjj said in QDialog setWindowFlags(Qt::Tool) Dialog is not Active:
Active ?
as in you cant click on anything in it or in what way not active?I'm sorry I said badly.
No, I can click on dialog.
It does not appear on the picture but on the lineEdit ("ძებნა..."), i have a focus but before you do not click a dialog I can not write anything before. -
Hi
Ah, more coffee helped. :)That is normal for Tool windows in windows OS.
It will not be make it self current when you show it.
Its by design on that platform.
(also on linux it seems) -
@mrjj said in QDialog setWindowFlags(Qt::Tool) Dialog is not Active:
That is normal for Tool windows in windows OS.
It will not be make it self current when you show it.
Its by design on that platform.It's bad for me :(
At the end of the picture you can see a small two form. MainWindow and tazi jazi. Choos Contacts is not visible because I wanted to do it. For this I used the Qt :: Tool. Can we achieve this in a different way? So that the form remains active?
-
Yes, on windows you can call
( in main, or where u do call show for the window)
w.show();
QApplication::setActiveWindow(&w);That so far have worked on windows. Some linux window managers might ignore
it. -
@mrjj said in QDialog setWindowFlags(Qt::Tool) Dialog is not Active:
w.show();
QApplication::setActiveWindow(&w);Yes it work if i use w.show(); but 'Choose Contacts' is Dialog and i deppend w.exec() == QDialog::Accepted or no.
-
I didnt test it, you you could try
in ShowEvent (in contacts) to all QApplication::setActiveWindow(this) -
dlgChooseContacts *dlgChoose = new dlgChooseContacts(last dialog) // set parent and it is hidden of taskbar dlgChoose.exec();
its also work.
-
@Taz742
Ok so even its a tool window, it becomes active on show if you assign parent? -
@mrjj said in QDialog setWindowFlags(Qt::Tool) Dialog is not Active:
it becomes active on show if you assign parent
Yes.
I do not need any tool Window. I wanted to just hide the taskbar.