ShowMaximized call works but the MainWindows is resized on app.exec()



  • Hi everybody,

    I’m upgrading my software from Qt 4.7.4 to Qt 5.4.0 Beta (I’m waiting for the release the 9th Dec). I'm on Windows 7 and my application is in Win32.

    It doesn't happen in the Qt 4.7.4. I can't reproduce it with a simple empty project.

    In my MainWindow, I have 2 tabbed vertical dockwidgets and a custom QWidget in centralwidget.

    It's append only on two similar applications (the inherit of the same AbstractMainWindow). Another who inherit of the same base class doesn't have this issue, mainly because it has a horizontal dockwidget. I found a work around by add then hiding a horizontal dockwidget but it stays a very dirty work around.

    The issue: when I call myMainWindow.showMaximized(), I see, with debug breakpoint, the mainwindow fills the screen like the attemped behavior. Unfortunately, during the app.exec() call, the mainwindow is resized BUT the windowState stays at Maximized...

    I really don't understand what can append, I watch the resize method and apparently the width and height have decrease before the first resize called during theapp.exec() method.

    It seems the QWidget::width() and QWidget::height() method don't return the same value as the QWidget::crect field, which is correct.

    The QMainWindowTabBar, on his destruction (why destruction... I don't know: I haven't TabBar), raises a event and this call a QWidget::SetMinimizeSize. Like the value return by QWidget::height() and QWidget::width() are not correct and less than the wanted minimum size, my MainWindow is resized.

    My hypothesis is: it's come from the qwindows.dll who misunderstood the windows Handle value.

    But I'm want some others point of view before posting a bug report.

    Have you seen this behavior? Have any advice, please?



  • Up, please


  • Lifetime Qt Champion

    Hi,

    Can you reduce your code base in order to easily reproduce that bug ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.