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 put many controls in a window with scrollbars?
Forum Updated to NodeBB v4.3 + New Features

How to put many controls in a window with scrollbars?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 4 Posters 358 Views 2 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.
  • jronaldJ Offline
    jronaldJ Offline
    jronald
    wrote on last edited by jronald
    #1

    In my case, that are hundres of buttons to show, I need a scroll view.
    ( The buttons are arranged by categories, the user should see all of them at a glance.)

    What's the proper way?


    I have tried to put a QWidget (with adjustSize) in QScrollArea, it works.
    But adjustSize has limits, the doc says:

    For windows, the screen size is also taken into account. If the sizeHint() is less than (200, 100) and the size policy is expanding, the window will be at least (200, 100). The maximum size of a window is 2/3 of the screen's width and height.

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Any chance you'd rather want a QTableView/QListView with a delegate that looks like a button instead?

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      JonBJ 1 Reply Last reply
      1
      • VRoninV VRonin

        Any chance you'd rather want a QTableView/QListView with a delegate that looks like a button instead?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @VRonin
        You are on a mission to drastically reduce the total number of QWidgets in The Universe, aren't you? ;)

        mrjjM 1 Reply Last reply
        0
        • JonBJ JonB

          @VRonin
          You are on a mission to drastically reduce the total number of QWidgets in The Universe, aren't you? ;)

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          @JonB
          Only when they are used with setIndexWidget() ;)

          In this case its more due to the fact that a QScrollArea with
          "hundres of buttons" gets slow pretty fast on non
          Desktop class devices.

          So View + Delegate is the sure road to better performance and
          in many cases the preferred way which you likely already know. :)

          1 Reply Last reply
          4

          • Login

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