Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Does Qt Creator save its window state when it closes?

Does Qt Creator save its window state when it closes?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
9 Posts 3 Posters 180 Views 1 Watching
  • 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.
  • R Offline
    R Offline
    Robert Hairgrove
    wrote last edited by
    #1

    Ubuntu 24.04 running in GNOME on Xorg (not Wayland):
    I use it mostly maximized. If it opens in a smaller window, I always maximize it manually. Sometimes it opens maximized, but after a certain time (estimated 1 week) it reverts to opening non-maximized.

    Is there a setting I can use to make it ALWAYS open the same way as it was when it was closed?

    1 Reply Last reply
    0
    • aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote last edited by
      #2

      @Robert-Hairgrove I think it does remember the last state, but (and this is a problem with all settings): If you have multiple instances open, the settings are finally written by the last instance that is closed.

      Does that ring a bell?

      Regards

      Qt has to stay free or it will die.

      R 1 Reply Last reply
      0
      • aha_1980A aha_1980

        @Robert-Hairgrove I think it does remember the last state, but (and this is a problem with all settings): If you have multiple instances open, the settings are finally written by the last instance that is closed.

        Does that ring a bell?

        Regards

        R Offline
        R Offline
        Robert Hairgrove
        wrote last edited by
        #3

        @aha_1980 said in Does Qt Creator save its window state when it closes?:

        @Robert-Hairgrove I think it does remember the last state, but (and this is a problem with all settings): If you have multiple instances open, the settings are finally written by the last instance that is closed.

        Does that ring a bell?

        Not in the case of Qt Creator ... internally, it uses QtSingleApplication (link is here) which prohibits opening more than one instance at the same time.

        JonBJ 1 Reply Last reply
        0
        • R Robert Hairgrove

          @aha_1980 said in Does Qt Creator save its window state when it closes?:

          @Robert-Hairgrove I think it does remember the last state, but (and this is a problem with all settings): If you have multiple instances open, the settings are finally written by the last instance that is closed.

          Does that ring a bell?

          Not in the case of Qt Creator ... internally, it uses QtSingleApplication (link is here) which prohibits opening more than one instance at the same time.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote last edited by
          #4

          @Robert-Hairgrove
          Umm, I use Creator under 24.04 as supplied (and as it happens GNOME Xorg not Wayland!), and I can open another instance.... I can verify tomorrow, but I don't think I'm going mad.

          1 Reply Last reply
          0
          • aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote last edited by
            #5

            @Robert-Hairgrove and @JonB: Of course there can be multiple instances open. I always work like that in both Linux as well as Windows.

            And as said: the last closed instance writes the final settings.

            I just verified that and if I close the maximized window last, then it opens again maximized.

            Thats why I asked if you (maybe sometimes) have multiple instances open?

            Regards

            Qt has to stay free or it will die.

            JonBJ 1 Reply Last reply
            1
            • aha_1980A aha_1980

              @Robert-Hairgrove and @JonB: Of course there can be multiple instances open. I always work like that in both Linux as well as Windows.

              And as said: the last closed instance writes the final settings.

              I just verified that and if I close the maximized window last, then it opens again maximized.

              Thats why I asked if you (maybe sometimes) have multiple instances open?

              Regards

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote last edited by JonB
              #6

              @aha_1980
              Agreed: I don't know why OP thinks or finds you cannot run multiple instances of Creator or why he thinks it uses QtSingleApplication to prevent it? You can open another instance by just right-clicking on the icon and picking New Window.

              @Robert-Hairgrove
              As I say, I use same environment as you but I never make it maximized so I do not know if that makes any difference. It does save & restore my non-maximized state, and I don't believe it ever loses that. Doing so "after a week" sounds like either something else on your system happening or you being mistaken and doing something yourself which alters it.

              UPDATE
              Hmmm, there is actually something odd about maximization state. If I resize Creator window it does save/remember that for next open. But if I maximize it does not: when I next open it stays at previous size, it does not restore to maximized. But it seems to be in a funny state: if I then start to drag to resize from the maximized-saved but non-maximized-restored state it immediately "jumps" to maximized. If I then unmaximize it reverts to normal resizing. So there is something odd going on when restoring to maximized. It might be related to my finding years ago (posted somewhere in this forum and/or on stack... something) that, under GNOME/Xorg, windows whose size is greater than something like 75% of total area count as/are made to behave as maximized. I had to change some default mutter value to alter this behaviour (I did not like it), let me know if you want me to dig that out.

              R 1 Reply Last reply
              1
              • JonBJ JonB

                @aha_1980
                Agreed: I don't know why OP thinks or finds you cannot run multiple instances of Creator or why he thinks it uses QtSingleApplication to prevent it? You can open another instance by just right-clicking on the icon and picking New Window.

                @Robert-Hairgrove
                As I say, I use same environment as you but I never make it maximized so I do not know if that makes any difference. It does save & restore my non-maximized state, and I don't believe it ever loses that. Doing so "after a week" sounds like either something else on your system happening or you being mistaken and doing something yourself which alters it.

                UPDATE
                Hmmm, there is actually something odd about maximization state. If I resize Creator window it does save/remember that for next open. But if I maximize it does not: when I next open it stays at previous size, it does not restore to maximized. But it seems to be in a funny state: if I then start to drag to resize from the maximized-saved but non-maximized-restored state it immediately "jumps" to maximized. If I then unmaximize it reverts to normal resizing. So there is something odd going on when restoring to maximized. It might be related to my finding years ago (posted somewhere in this forum and/or on stack... something) that, under GNOME/Xorg, windows whose size is greater than something like 75% of total area count as/are made to behave as maximized. I had to change some default mutter value to alter this behaviour (I did not like it), let me know if you want me to dig that out.

                R Offline
                R Offline
                Robert Hairgrove
                wrote last edited by
                #7

                @JonB said in Does Qt Creator save its window state when it closes?:

                I don't know why OP thinks or finds you cannot run multiple instances of Creator or why he thinks it uses QtSingleApplication to prevent it? You can open another instance by just right-clicking on the icon and picking New Window.

                Well, I learned something new today! I never knew that it was possible to open a new instance like that.

                However, I never work with more than one instance, so it must have been something else. I noticed that when I have the window maximized, then open a dialog such as the "Sessions" dialog, then drag that dialog over the Qt Creator window, that the window becomes unmaximized (restored). Perhaps this has to do with the Qt Maintenance tool asking to close Qt Creator? Maybe I dragged that window and unmaximized the window without noticing it?

                Thanks for taking time to look into this!

                JonBJ 1 Reply Last reply
                0
                • aha_1980A Offline
                  aha_1980A Offline
                  aha_1980
                  Lifetime Qt Champion
                  wrote last edited by
                  #8

                  @JonB Yeah, probably the window manager, desktop environment, moon phase etc. might also be relevant. On the other hand, when I need the window maximized, thats just one click. I don't care that much... But maybe thats just me.

                  Qt has to stay free or it will die.

                  1 Reply Last reply
                  0
                  • R Robert Hairgrove

                    @JonB said in Does Qt Creator save its window state when it closes?:

                    I don't know why OP thinks or finds you cannot run multiple instances of Creator or why he thinks it uses QtSingleApplication to prevent it? You can open another instance by just right-clicking on the icon and picking New Window.

                    Well, I learned something new today! I never knew that it was possible to open a new instance like that.

                    However, I never work with more than one instance, so it must have been something else. I noticed that when I have the window maximized, then open a dialog such as the "Sessions" dialog, then drag that dialog over the Qt Creator window, that the window becomes unmaximized (restored). Perhaps this has to do with the Qt Maintenance tool asking to close Qt Creator? Maybe I dragged that window and unmaximized the window without noticing it?

                    Thanks for taking time to look into this!

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote last edited by
                    #9

                    @Robert-Hairgrove

                    • Having Creator maximized, opening any modal dialog (doesn't have to be Sessions) on it and then dragging that dialog makes Creator main window go non-maximized. That would indeed count as though you had chosen to do that, so it will now save itself non-maximized for next restore. I don't know why it does this, but I would imagine it is a GNOME/Mutter thing, not a Creator one.

                    • I don't know anything about Qt Maintenance tool or what that might do to Creator as I have never used it. I only take the Qt + Creator which comes with the current Ubuntu release.

                    1 Reply Last reply
                    0
                    • R Robert Hairgrove has marked this topic as solved

                    • Login

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