Unsolved how add list of Qpushbuttons in gui application
-
Hi,
i want list of 3 pushbutton in a single row ,
row must be more than one
please give some suggestion -
I think you can use QHboxLayout and QVBoxLayout.
-
i want loop for example: pushbutton1,pushbutton2
pushbutton1,pushbuuton2
pushbutton1,pushbutton2 -
You can loop for that, for example
for( int i = 0 ; i < /*the row number you want*/ ; ++i ) { // add a row of pushbuttons to a QHBoxLayout // add the QHBoxLayout to QVBoxLayout }
Are all the pushbutton1 and pushbutton2 the same?
-
yes like audio call,video call button in every contact
-
Hello,
You can either add QPushButton through Qt creator designer or to add button horizontally from code.QHBoxLayout *_layout = new QHBoxLayout(); // You need Horizontal layout first ui->widget->setLayout(_layout); // Apply layout to parent widget QPushButton * p1 = new QPushButton(); QPushButton * p2 = new QPushButton(); _layout->addWidget(p1); // add buttons to layout _layout->addWidget(p2); // And so on.. ...
-
i want same buttons in multiple times like loops
i created widget with 3 buttons and i added that widget to qlistwidget,,,,,,i want same widget multiple times -
@Bharth said in how add list of Qpushbuttons in gui application:
qlistwidget
Hi,
Please look at this for adding custom widget to QListWidget .