Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-134111

FramelessWindowHint + showMaximized bug in qt6

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 6.8.1
    • Widgets: Main Window
    • None
    • windows10
    • Windows

    Description

      I have an application (FreeCAD) with a FramelessWindowHint:
      FramelessWindow::FramelessWindow(QWidget * parent, Qt::WindowFlags f) : QMainWindow( parent, f )

      {      setWindowFlags(windowFlags() | Qt::FramelessWindowHint | Qt::Window); }

      Trying to maximize the window gives weird behavior:

      Start with a non-maximized window.

      Try to maximize it (with python or cpp is the same). The window visually maximize. However the QEvent::WindowStateChange is duplicated. So the window is kind-of-restored (but not in size) :

      >>> mainWindow.showMaximized()
      >>> mainWindow.isMaximized()
      False
      >>> mainWindow.showMaximized()
      >>> mainWindow.isMaximized()
      True

       

      The problem is that if you have a button to maximize/restore like so : 

      void CustomTitleBar::toggleMaximizeRestore() {
          if (m_mainWindow->isMaximized())

      {         m_mainWindow->showNormal();     }

          else

      {         m_mainWindow->showMaximized();     }

      }

      Then here what happens if you click it : 

      • Start normal
      • Click 1 : Becomes visually maximized, but is in fact 'restored'
      • Click 2 : stays visually maximize, become 'maximized' for real.
      • Click 3 : restores correctly.

      This was behaving perfectly with Qt 5.15 and fails after updating to Qt 6.8.1

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            paddle Pierre B
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes