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]QtabWidget, how to make it scrollable
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]QtabWidget, how to make it scrollable

Scheduled Pinned Locked Moved General and Desktop
17 Posts 4 Posters 19.6k 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
    andre
    wrote on last edited by
    #7

    Try putting everyting in proper layouts.

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      zeljko
      wrote on last edited by
      #8

      Looks like scrollbars policy is Qt::ScrollBarAlwaysOff (if container of your widgets is is QScrollArea).It should be Qt::ScrollBarAsNeeded (default) or Qt::ScrollBarAlwaysOn , so then you'll get desired result.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sharon_obl82
        wrote on last edited by
        #9

        yes, the scrollbar policy is set to Qt::ScrollBarAsNeeded. I changed it to Qt::ScrollBarAlwaysOn but it's not scrollable :(

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          zeljko
          wrote on last edited by
          #10

          strange, looks like controls parent isn't QScrollArea.
          Have you tried same thing on QMainWindow (add QScrollArea + child controls) ?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sharon_obl82
            wrote on last edited by
            #11

            Hi,
            I tested with just adding QScrollArea and child controls on the QMainWindow but the scrollbar doesn't appear too when it's being run. :O

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              zeljko
              wrote on last edited by
              #12

              Then I really don't know what's up.

              1 Reply Last reply
              0
              • C Offline
                C Offline
                ChrisW67
                wrote on last edited by
                #13

                Andre has a good suggestion.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sharon_obl82
                  wrote on last edited by
                  #14

                  Thanks guys, it was because of the layout problem. Btw, everytime i click "Layout in a Form layout" the scroll area automatically resizes to a small box on the top left corner. Is there a way to prevent this?

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    ChrisW67
                    wrote on last edited by
                    #15

                    Apply a layout at every level, including on the widget that contains the QScrollArea... Everywhere you see the Layout-with-a-red-crossed-circle icon in the Object Inspector should be looked at.

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      andre
                      wrote on last edited by
                      #16

                      If you use layouts, you have to use layouts all the way:

                      • Every widget (except the top level one) has to be in a layout
                      • Every widget that contains other widgets has to have a layout.

                      Recursively.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        sharon_obl82
                        wrote on last edited by
                        #17

                        Ok I understand. Thank Andre!

                        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