Question

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.

Was it helpful?

Solution

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

OTHER TIPS

You can add widgets to QListWidget using its setIndexWidget function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top