Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QGridLayout issue

QGridLayout issue

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 1.9k 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.
  • 3 Offline
    3 Offline
    32sthide
    wrote on last edited by
    #1

    I have a problem with when setting my centralwidget with QGridLayout. I have three widgets in my centralwidget. One is one bar in the top that covers all the horizontal length of the centralwidget and the other two are two frames, one square in the left and other one in the right.

    My purpose is that the top bar won't change vertically and the left square can expand both vertical and horizontal, and the right on stays without expansion and always in the right corner of the centralwidget giving the left one space to expand.

    The problem is when setting the size policy of the right one. If I put fixed the left one will take all the space.

    I don't know if you get the idea. Sorry, this is the best I can explain. I would be very appreciated if you could help me.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jys0224
      wrote on last edited by
      #2

      how about setting right widget's min,max size to some fixed size you want?

      @
      rightWidget->setMaximumSize(someFixed);
      rightWidget->setMinimumSize(someFixed);
      @

      ? 1 Reply Last reply
      0
      • 3 Offline
        3 Offline
        32sthide
        wrote on last edited by
        #3

        It worked, thank you, but now I just have one problem, what if I want the left square to increase only proportionally, being always a square.

        1 Reply Last reply
        0
        • J jys0224

          how about setting right widget's min,max size to some fixed size you want?

          @
          rightWidget->setMaximumSize(someFixed);
          rightWidget->setMinimumSize(someFixed);
          @

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          @jys0224
          I know it's old but you can set minimum height and width for other widgets . It worked for me .

          1 Reply Last reply
          0

          • Login

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