Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. window disappears when minimized, on windows 10
Forum Updated to NodeBB v4.3 + New Features

window disappears when minimized, on windows 10

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 4.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    febinaf
    wrote on last edited by febinaf
    #1

    I've created multiple windows that opens on push button click while hiding the current active window. The issue is that, whenever I click the minimize or close button of the window, the window disappears.
    Clicking minimize doesn't dock the window to the taskbar and clicking the close button is not quitting the app with exit code 0.
    All the new windows that I've created are having the QMainWindow base class. Is there any additional setup needed for using the minimize or quit button to actually do what they are supposed to do?

    And, the minimize and close functions are working properly for the MainWindow that is created along with the new project, and isn't working on the new windows created afterwards.

    also, this is how I'm opening new windows from the active one, inside the push button clicked slot

         hide();
        secondWindow = new SecondWindow(this);
        secondWindow->show();
    

    thanks

    JonBJ 1 Reply Last reply
    0
    • F febinaf

      I've created multiple windows that opens on push button click while hiding the current active window. The issue is that, whenever I click the minimize or close button of the window, the window disappears.
      Clicking minimize doesn't dock the window to the taskbar and clicking the close button is not quitting the app with exit code 0.
      All the new windows that I've created are having the QMainWindow base class. Is there any additional setup needed for using the minimize or quit button to actually do what they are supposed to do?

      And, the minimize and close functions are working properly for the MainWindow that is created along with the new project, and isn't working on the new windows created afterwards.

      also, this is how I'm opening new windows from the active one, inside the push button clicked slot

           hide();
          secondWindow = new SecondWindow(this);
          secondWindow->show();
      

      thanks

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @febinaf
      This may come because the parent of your secondary windows is hidden?

      I am guessing that minimize on a secondary window child is supposed to hide it with respect to its parent, but that is hidden, so maybe there is nowhere to show it minimized? Similarly "minimizing to the taskbar" may only happen when the original, top-level window is minimized, which is not happening here? You might compare behaviour if you create secondWindow = new SecondWindow(nullptr);.

      By default (unless you alter it) a Qt GUI application show close when the last visible window is closed.

      I don't think there is any relevance to using QMainWindow, once or multiple times, it is only a window style.

      F 1 Reply Last reply
      2
      • JonBJ JonB

        @febinaf
        This may come because the parent of your secondary windows is hidden?

        I am guessing that minimize on a secondary window child is supposed to hide it with respect to its parent, but that is hidden, so maybe there is nowhere to show it minimized? Similarly "minimizing to the taskbar" may only happen when the original, top-level window is minimized, which is not happening here? You might compare behaviour if you create secondWindow = new SecondWindow(nullptr);.

        By default (unless you alter it) a Qt GUI application show close when the last visible window is closed.

        I don't think there is any relevance to using QMainWindow, once or multiple times, it is only a window style.

        F Offline
        F Offline
        febinaf
        wrote on last edited by
        #3

        @JonB said in window disappears when minimized, on windows 10:

        You might compare behaviour if you create secondWindow = new SecondWindow(nullptr);

        Hey that solved the issue and thanks a lot.

        JonBJ 1 Reply Last reply
        0
        • F febinaf has marked this topic as solved on
        • F febinaf

          @JonB said in window disappears when minimized, on windows 10:

          You might compare behaviour if you create secondWindow = new SecondWindow(nullptr);

          Hey that solved the issue and thanks a lot.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @febinaf
          I meant to mention one other thing. For hiding one window and showing another, depending on your usage either QStackedLayout or QWizard would be preferable/easier, if suits.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved