Вопрос

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.

Это было полезно?

Решение

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

Другие советы

You can add widgets to QListWidget using its setIndexWidget function.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top