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. Size Policy with TabWidget.
Qt 6.11 is out! See what's new in the release blog

Size Policy with TabWidget.

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

    Hello,

    I have a QDockWidget with a QWidget inside, with a QCustomPlot inside (QDockWidget->QWidget->QCustomPlot) and I can resize (stretch) it without a problem. All with "Preferred/Preferred" size policy.

    I also have a QDockWidget->QWidget->QTabWidget->QWidget->QCustomPlot but even though I can resize the dock, the tab and the rest doesn't change size. I tried with all of them in "Preferred/Preferred" and "Expanding/Expanding" size policies but still get the same result.

    Is it possible to resize when you have a tab? Any solution?

    I am new to Qt so have been using Qt Designer.

    Thanks.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Santosh Reddy
      wrote on last edited by
      #2

      What you expect is default behaviour provided you properly set the layouts on all bold QWdigets.

      QDockWidget->QWidget->QTabWidget->QWidget(tab)->QCustomPlot

      SS

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SNH11
        wrote on last edited by
        #3

        Got it working. I right clicked on the "QDockWidget" and "QTabWidget" then added a vertical Layout. This added the layout property to the two QWidgets you mentioned.

        I will find out more information on layouts.

        Thank a lot!

        A 1 Reply Last reply
        0
        • S SNH11

          Got it working. I right clicked on the "QDockWidget" and "QTabWidget" then added a vertical Layout. This added the layout property to the two QWidgets you mentioned.

          I will find out more information on layouts.

          Thank a lot!

          A Offline
          A Offline
          amarism
          wrote on last edited by
          #4

          @SNH11 Can you please share your code with me... I am also struck in the same problem

          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