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. Resizing StackWidget When Page Changes
Forum Updated to NodeBB v4.3 + New Features

Resizing StackWidget When Page Changes

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.0k 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.
  • A Offline
    A Offline
    Andaharoo
    wrote on last edited by
    #1

    I have a stack widget with two buttons (same size) and another page has one button which is also the same size. If I switch the page how can I get the widget (dialog) that the stack widget is in to resize so that there is no space. I thought I could just change the policy of the stack widget and it's layouts to minimum but this didn't do anything. A lot of people said I needed fixed. Frankly non of them do anything. Is there some sort of update function I need to call? I tried update and resizing the widget and it's layout to their minimum size. I've tried a ton of other stuff but nothing works.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      From the top of my head you can try to ask for the size hint of the contained widget and then resize the stack widget based on that.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Andaharoo
        wrote on last edited by
        #3

        Contained widget? Would that be the stack widget or the dialog that the stack widget is in? I have more elements outside the stack widget. For example:

        • Button
        • Stack Widget (2 pages)
          • Button
            OR
          • Button
          • Button
        • Button
          So when you switch the page the widget everything is contained in stays the same size. The dialog should shrink in size.
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I was thinking about the widget that are the pages of your stack.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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