Frage

I'd like to create a list of QPushButtons that are added and removed at runtime. I figure that an item view widget would accomplish this (QListWidget). The reason for wanting to use an item view instead of a layout is that I would like to scroll through a list of buttons instead of just trying make them all fit. However, I don't see too many examples of QListWidgets being used to store a QPushButtons.

I'd like some tips, pointers, or examples.

War es hilfreich?

Lösung

I think you should not use QListWidget in this case. Create a widget with a layout and all your buttons. Then put in QScrollArea.

Andere Tipps

You can add widgets to QListWidget using its setIndexWidget function.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top