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. Broken QWidget window states and geometries
QtWS25 Last Chance

Broken QWidget window states and geometries

Scheduled Pinned Locked Moved Solved General and Desktop
qwidgetfullscreenmaximizedwindow geometrybug
4 Posts 2 Posters 3.0k 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.
  • W Offline
    W Offline
    Wilk
    wrote on 11 Jan 2016, 21:40 last edited by Wilk 1 Nov 2016, 21:58
    #1

    Hi.

    I wonder if QWidget window states are actualy broken or am I doing it wrong.

    The problem:

    1. Create QWidget window.
    2. Maximize it.
    3. Make it full screen.
    4. Return back from full screen.

    You will see, that window does not get back in maximized state and has geometry that differs from its geometry before maximization. That mean, that:

    1. Window state is not preserved upon going to full screen.
    2. Normal state window geometry is not preserved.

    I've overriden showFullScreen slot in order to be able to preserve window state while going to full screen and back, and it works fine. However, the problem with window geometry remains. I've added some debug output in different events (resize, show, move) and found out that normalGeometry property does not hold what I expected.

    According to documentation normal geometry property holds the geometry of the widget as it will appear when shown as a normal (not maximized or full screen) top-level widget. Probably I miss understand this, but I thought that normal state window geometry is stored here and remains unchanged while going maximized. However it seems like the following actions are performed while making window maximized:

    1. Set geometry to the value of maximized widget geometry.
    2. Make window maximized.

    That means that window normal state geometry is changed. However it is still stored somewhere as window gets its geometry while returning to normal state from maximized state.

    The behaviour described was detected on Windows 10 with Qt 5.5.1 for MSVC 2010 x86. If someone can reproduce this behaviour then a bug report should be created. If someone can explain what am I doing wrong, that please tell me)

    UPD.1:
    Here is example project to test described behaviour. Fullscreen mode is toggled using your system full screen key sequence .

    1 Reply Last reply
    0
    • V Offline
      V Offline
      ValentinMichelet
      wrote on 12 Jan 2016, 08:34 last edited by
      #2

      Hi,

      I tested your code on Ubuntu 14.04, with Unity, using Qt 5.3.1.
      First, when I replace your QMainWindowExtended with a QMainWindow (or a QWidget), I can't make it full screen. I think that my OS needs some extra code to handle full screen.
      Then, when I use your QMainWindowExtended, everything works fine, even the geometry:

      1. Resize widnow
      2. Move window
      3. Make it full screen
      4. Return back from full screen

      The window is at the previous location with the previous size.

      So I think that either your OS is doing its own job and Qt is not able to make it doing right, or it's a bug in Qt not making your OS working right.

      W 1 Reply Last reply 12 Jan 2016, 14:55
      1
      • V ValentinMichelet
        12 Jan 2016, 08:34

        Hi,

        I tested your code on Ubuntu 14.04, with Unity, using Qt 5.3.1.
        First, when I replace your QMainWindowExtended with a QMainWindow (or a QWidget), I can't make it full screen. I think that my OS needs some extra code to handle full screen.
        Then, when I use your QMainWindowExtended, everything works fine, even the geometry:

        1. Resize widnow
        2. Move window
        3. Make it full screen
        4. Return back from full screen

        The window is at the previous location with the previous size.

        So I think that either your OS is doing its own job and Qt is not able to make it doing right, or it's a bug in Qt not making your OS working right.

        W Offline
        W Offline
        Wilk
        wrote on 12 Jan 2016, 14:55 last edited by
        #3

        @ValentinMichelet Hi.

        Thank you for your effor)

        The reason that it did not work with QMainWindow or QWidget is that those classes does not implement fullScreen as full featured property - it can not be set with setFullScreen() slot.

        I've tested it in Open Suse (KDE) with Qt Creator as test program - yep, that's possible - and found out that every thing works fine. However test in Windows 7 (on wirtual machine) have shown the same results as described in initial post.

        Considering you test results with Ubuntu and Unity it seems like a Windows-specific bug. So I'll try to go and create bug report for it.

        Thanks alot)

        V 1 Reply Last reply 12 Jan 2016, 15:18
        0
        • W Wilk
          12 Jan 2016, 14:55

          @ValentinMichelet Hi.

          Thank you for your effor)

          The reason that it did not work with QMainWindow or QWidget is that those classes does not implement fullScreen as full featured property - it can not be set with setFullScreen() slot.

          I've tested it in Open Suse (KDE) with Qt Creator as test program - yep, that's possible - and found out that every thing works fine. However test in Windows 7 (on wirtual machine) have shown the same results as described in initial post.

          Considering you test results with Ubuntu and Unity it seems like a Windows-specific bug. So I'll try to go and create bug report for it.

          Thanks alot)

          V Offline
          V Offline
          ValentinMichelet
          wrote on 12 Jan 2016, 15:18 last edited by
          #4

          @Wilk said:

          The reason that it did not work with QMainWindow or QWidget is that those classes does not implement fullScreen as full featured property - it can not be set with setFullScreen() slot.

          I see, thanks for the precision.

          @Wilk said:

          Thanks alot

          No problem, I hope your bug report will be helpful for other people.

          1 Reply Last reply
          0

          4/4

          12 Jan 2016, 15:18

          • Login

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