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. Why mainwindow can still showmaximized() after setFixedSize()?

Why mainwindow can still showmaximized() after setFixedSize()?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 385 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.
  • N Offline
    N Offline
    nengluo
    wrote on last edited by
    #1

    The mainwindow has setFixedSize(250,316),but it can still showMaximized(). It seems like the mainwindow always has background. Please help me!

    N 1 Reply Last reply
    0
    • N nengluo

      The mainwindow has setFixedSize(250,316),but it can still showMaximized(). It seems like the mainwindow always has background. Please help me!

      N Offline
      N Offline
      nengluo
      wrote on last edited by nengluo
      #2

      The mainwindow's centralwidget has layout, in the layout i add another window. The mainwindow shows on the left-top corner of the screen while showmaximized(), and the other area of the screen is white color(background color). The mainwindow is inherited from BaseWindow which is finally inherited from QMainWindow.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        Qt does that because you asked it to do contradictory things and it has to choose one.

        If you do not want the window maximized then do not call showMaximized() and hide the maximize widget (https://doc.qt.io/qt-5/qwidget.html#windowFlags-prop) to make it difficult for the user to do it.

        1 Reply Last reply
        2

        • Login

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