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. How to fit a label to a scroll Window Area in Qt designer?
Forum Update on Monday, May 27th 2025

How to fit a label to a scroll Window Area in Qt designer?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 2.1k Views
  • 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.
  • P Offline
    P Offline
    Pierrot2911
    wrote on last edited by
    #1

    I want to display a lot of icons in a label but as the number of icons is really high, I will need to be able to scroll horizontally and vertically in this label.

    What I did : I created a ScrollArea with a horizontal and vertical scrollbar and also a label. However, it doesn't seem to work. I wrote a long sentence in the label but the scroll bars does not move what is inside the label. Actually, I think the scroll bars only relate to the scroll area but not to the label.

    To summarize : I need a label of fixed size on my form where I would be able to scroll horizontally and vertically.

    1_1545251909670_2018-12-19_20h54_07.png 0_1545251909668_2018-12-19_21h25_32.png

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

      Hi,

      Why are you adding scrollbars to a QScrollArea ? It already has them integrated.

      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
      2
      • P Offline
        P Offline
        Pierrot2911
        wrote on last edited by
        #3

        I removed them but it still does not work. Should I set WidgetResizable to True or False ? I don't know if I need to set any particular layout ? My label should fit the whole scroll area I guess ? I set the frame shape to WinPanel, is it ok ?

        Actually, all I need is a label where I can scroll in it... I am just looking at the easiest solution for it

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

          Hi

          • I want to display a lot of icons in a label

          Why not use a ListWidget/ListView set to icon mode
          and left to right flow ?

          alt text
          it can scroll in both direction and also show icons/only show icons.
          alt text

          alt text

          1 Reply Last reply
          2

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved