how to add button list?
-
hi,I need to generate some QPushButtons in a HLayout line. When there are too many buttons generated,the buttons will be shown as follows:![alt text]( image url).I have set the min width of each button to make the label of the button to show wholely.In such case, I want to generate a special button.the result is shown as follows . I guess I need to calculate the whole width of all buttons. If the width of the QWidget is not enough to contain all the buttons,then put the rest buttons into a list. How can I realize it in QT, the picture is a web.
thanks -
It's not what you want, but the Flow Layout Example might be helpful for you to figure out how to create a custom layout class that does what you want.
-
I need to show all(or part) buttons in one line. If some buttons cannot show in the panel,then hide it and show it in a list,just as the result in the picture
-
@yangyanhui4
There is no "in-built" facility for that, you need to write it yourself. As @mchinand wrote the Flow Layout Example may give you a good starting point.