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. Cannot scroll vertically after dynamically setting the size of a child of a QListWidget

Cannot scroll vertically after dynamically setting the size of a child of a QListWidget

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

    Hi,

    I have a horizontal QListWidget that holds other vertical QListWidget as child elements. The heights of the children lists (the vertical ones) are set dynamically when the user appends to these lists. They are made so they don't scroll, their heights are the total size of all their children's heights, which are other widgets of no importance for this question. The way I do it is by making these children lists be of a class that sub-classes QListWidget, reimplementing the sizeHint() and minimumSizeHint() methods, which take care or the "resizing" of the list.

    The problem I am facing is the following: appending more children lists to the horizontal (parent) list makes the parent list scrollable horizontally, as is intended. However, when the user appends widgets to the children lists, these lists expand in height, but they do not make the parent list vertically scrollable, even thought they are in fact way "taller" than their containing, parent list.

    I hope this is clear enough, it's bit hard to describe.

    (Additionally, I noticed that if I resize the main window, which space is taken almost entirely by the parent list described above, the parent list does become vertically scrollable after reaching the size of the "minimum size" of the widgets which are children of the vertical lists, specified in the editor.)

    I get the sense that the list's "scrollability" isn't being refreshed propery. Is that right? Is there another way to force the parent list to be scrollable vertically after one of its child have been resized to a greater height?

    Thank you so much for your answers.

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

      Hi and welcome to devnet,

      Not a direct answer but why not use a QScrollArea to contain your "list" of QListWidget ?

      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

      • Login

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