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. [SOLVED]unfix a window previously fixed
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]unfix a window previously fixed

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 10.8k 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.
  • E Offline
    E Offline
    evergreen
    wrote on last edited by
    #1

    In my application, I use an resizable window.
    Sometimes, I pop up a widget. When this widget is on, I don't want the user to be able to resize the window.
    For this, I use setFixedSize on the mainWindow. Until here everything works.

    Once the widget closes up, I would like the user to be able to resize the window again. But there's no method like setResizable of unfixedSize.

    Is there a way to do it tho?

    Thanks

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      [quote author="Qt Assistant" date="0"]void QWidget::setFixedSize ( const QSize & s )

      Sets both the minimum and maximum sizes of the widget to s, thereby preventing it from ever growing or shrinking.
      This will override the default size constraints set by QLayout.
      To remove constraints, set the size to QWIDGETSIZE_MAX.
      Alternatively, if you want the widget to have a fixed size based on its contents, you can call QLayout::setSizeConstraint(QLayout::SetFixedSize);
      See also maximumSize and minimumSize.
      [/quote]

      1 Reply Last reply
      0
      • EddyE Offline
        EddyE Offline
        Eddy
        wrote on last edited by
        #3

        Did you read the docs?

        "Set the size using QWIDGETSIZE_MAX ":http://doc.qt.nokia.com/4.7/qwidget.html#setFixedSize-2

        Qt Certified Specialist
        www.edalsolutions.be

        1 Reply Last reply
        0
        • E Offline
          E Offline
          evergreen
          wrote on last edited by
          #4

          Perfectely worked.

          For the one who has the problem.

          first : setFixedSize(size());

          then :setMaximumSize(QWIDGETSIZE_MAX,QWIDGETSIZE_MAX);
          setMinimumSize(0,0);

          Thanks for help

          1 Reply Last reply
          1

          • Login

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