문제

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