简体   繁体   中英

How to show a QMainWindow in the taskbar

I am making a desktop application using Qt.

the main window opens one of two other windows, but i need to hide the main window when the others are working, when doing so the program is hidden from the taskbar .

and i want to show them with different title.

This is the first window that is shown in the taskbar

this is the second window (the child window where the icon of the program is disappeared

Just remove the "parent" from your *.cpp file of your other two windows.

Before:

TechRoom::TechRoom(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::TechRoom)

After:

TechRoom::TechRoom(QWidget *parent) :
    QMainWindow(), //Remove here
    ui(new Ui::TechRoom)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM