No Taskbar Icon on QDialog is shown before mainwindow.show() is called.
-
Hi, Is it possible to have a icon for a QWidget in the taskbar displayed before mainwindow.show() is called. What I am doing is a login box of type QDialog is displayed waiting for input from the user. Sometimes the dialog is hidden behind other windows at startup. Or you may need to look at a different program. With no icon in the task bar you need to use CTRL-TAB to switch to that window again. Note, the icon does appear after successful completion of the Login Dialog.
OS. Windows 10
Qt: 5.12.5
Compiled with MinGWThanks..
-
The taskbar icon will only appear when there is a QMainWindow - so create your main window before your login dialog but don't show it.
-
@Christian-Ehrlicher Thats kind of what I am doing.
In main() the mainwindow object is created. Then I have a function in mainwindow called startUp() that I call from main(). This function starts the databases up, creates a QDialog login dialog and then if all is good the last thing it does is calls showMaximized(); before returning to the main function to call a.exec();
-
I've figured this out.. For those with similar problems... If you create a dialog box and pass the main window object to it then the only time the dialog icon is shown is if the window is shown. so instead of ...
someDialog dialog(this);
I call it like this now...
someDialog dialog(nullptr);
End result is the dialog Icon is shown on task bar even though I have not shown the mainwindow yet.
Thanks for your suggestions...
-
@Chrisw01 said in No Taskbar Icon on QDialog is shown before mainwindow.show() is called.:
I've figured this out..
So is it time to mark your post as solved? Thanks.