Pregunta

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.

¿Fue útil?

Solución

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

Otros consejos

You can add widgets to QListWidget using its setIndexWidget function.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top