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. Scroll area not showing the vertical scroll bar
Forum Updated to NodeBB v4.3 + New Features

Scroll area not showing the vertical scroll bar

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 1.7k 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
    summit
    wrote on last edited by
    #1

    I am using a combination of QT creator and code to add widgets to a layout.

    QT CREATOR

    1) Drop a scroll area
    2) Drop verticallayout in scroll area.
    
    

    Now in my code i am adding widgets to the verticalLayout

    QLabel *labelPosTime = new QLabel;
    verticallayout->addWidget(labelPosTime);
    
    

    It seems as if the scroll area is totally unaffected by the addition of widgets and it does not show the vertical scroll bar when the widgets exceed the scroll area.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rondog
      wrote on last edited by Rondog
      #2

      The scrollbars only show up when needed unless you change the scrollbar policy of the scroll area. I don't know if you tried this.

      setVerticalScrollBarPolicy(Qt::ScrollBarPolicy)
      1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        When you write

        • Drop verticallayout in scroll area.
          If that is a red one, its wrong.

        You should place one widget in scroll area, then RIGHT click and use Layout menu.
        Then you can delete the widget again.
        And insert from code.

        The red layouts are for inserting into other layouts. not use as base layouts.

        S 2 Replies Last reply
        2
        • mrjjM mrjj

          Hi
          When you write

          • Drop verticallayout in scroll area.
            If that is a red one, its wrong.

          You should place one widget in scroll area, then RIGHT click and use Layout menu.
          Then you can delete the widget again.
          And insert from code.

          The red layouts are for inserting into other layouts. not use as base layouts.

          S Offline
          S Offline
          summit
          wrote on last edited by summit
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • mrjjM mrjj

            Hi
            When you write

            • Drop verticallayout in scroll area.
              If that is a red one, its wrong.

            You should place one widget in scroll area, then RIGHT click and use Layout menu.
            Then you can delete the widget again.
            And insert from code.

            The red layouts are for inserting into other layouts. not use as base layouts.

            S Offline
            S Offline
            summit
            wrote on last edited by
            #5

            @mrjj Thank you very much this works now , really appreciate your valuable help.

            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