0

i have a QTreeWidget with the following structure

 Row 1 --> QPushButton
    |
    |--> Child 1 --> QFrame
                       |
                       |->QVBoxLayout
                             |
                             |->QListView

The number of rows and thus the size of QListView can change, so i implemented a QStyledItemDelegate to set the sizehint according to size of QListView. My problem is that when i insert a row in QListView the QTreeWidget does not update the size of the row with the new sizehint value, if i use updateGeometry() the sizehint in the delegate is not called, but if i collapse and axpand the item then the row gets resized. how can i force the QTreeWidget to resize the row according to the sizehint without having to collapse and expand the root item, Thanks

Rui Sebastião
  • 855
  • 1
  • 18
  • 36
  • can you turn your edit with the solution into an answer and accept it so as to signal that your question does no longer need an answer? – Erik Aug 14 '14 at 09:26
  • 1
    ok, great, now you only have to click the hollow checkmark on the left to mark the answer as 'accepted' – Erik Aug 14 '14 at 09:39

1 Answers1

1

Ok i got the answer... i need to call TreeView::doItemsLayout()

Rui Sebastião
  • 855
  • 1
  • 18
  • 36