-1

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

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • so you just want to minimize the main window when the others are in use? – Mariam Sep 03 '18 at 11:12
  • Think this is related to: [https://stackoverflow.com/questions/39708947/make-taskbar-icon-visible-on-window-hide](https://stackoverflow.com/questions/39708947/make-taskbar-icon-visible-on-window-hide) – M. Sol Sep 03 '18 at 11:15
  • @Mariam yes i do – Ahmad Magdy Sep 03 '18 at 11:22
  • @M.Sol it is not the same precisely and also didn't answer my question. – Ahmad Magdy Sep 03 '18 at 11:22
  • When you call Hide (same as in WinAPI) it will hide your window, you just want an unusual thing, because you want to hide your window and at the same time keep it on your taskbar, and for that, you need to create some kind of custom solution. – M. Sol Sep 03 '18 at 11:27
  • 2
    @AhmadMagdy you do not need a custom solution. Minimizing the window achieves exactly that. In that case, this is a possible duplicate of: https://stackoverflow.com/questions/3599334/minimizing-a-qt-application . Instead of hiding the window just minimize it. – Mariam Sep 03 '18 at 11:31
  • Possible duplicate of [Minimizing a Qt application](https://stackoverflow.com/questions/3599334/minimizing-a-qt-application) – Mariam Sep 03 '18 at 14:20

1 Answers1

3

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)
Bothric
  • 46
  • 2