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. QTabWidget in ScrollArea
Qt 6.11 is out! See what's new in the release blog

QTabWidget in ScrollArea

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 461 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.
  • W Offline
    W Offline
    Wuzi
    wrote on last edited by
    #1

    Hi,

    I found already some similar threads about it, but none of the helped me. In the project Labplot we are using a QTabWidget inside a ScrollArea. If the content of one Tab is larger than the Scrollarea, the scrollbars occurs and I am able to scroll through the widget. The problem is when in a second tab a smaller widget is placed (A vertical spacer which expands) which does not need the complete space of the scrollarea, the scroll bars are still visible so it will be scrolled but this makes totaly no sense there.

    One solution would be to put on every tab a scrollArea and putting all Widgets in it. This works fine, but it has to be done for every tab (We have quite a lot of TabWidgets where we have to do it then).

    Is there another way solving that problem?

    The issue is also described here (with video): Labplot Scroll Area Issue

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

      Hi,

      What about using QTabBar on top of a QScrollArea containing a QStackedWidget ? That way you would have one single QScrollArea and pilot its content with one tab bar.

      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
      • W Offline
        W Offline
        Wuzi
        wrote on last edited by
        #3

        Hi,

        thank you for your response. Perhabs with have different numbers of tabs and different content in the tabs. And this for quite a lot of items.
        Two examples:
        d0af4b79-a378-4e04-936d-52874ca28da5-image.png

        3f7e3de0-a8e4-4658-8903-2ae95b15094e-image.png

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

          One other way could be to trigger a resize when switching by requesting the sizeHint of the now facing widget.

          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
          • W Offline
            W Offline
            Wuzi
            wrote on last edited by
            #5

            Thanks at @SGaist I will try that out

            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