Having fixed size for dynamically created buttons!
Solved
General and Desktop
-
In my qt c++ application buttons are created dnamically! When the number of buttons are different the size of the buttons are also diffrent! I want to have a fixed size for the buttons!
void NewOrders::on_pushButton_clicked(){
QString LIst;
List<<"Hello"<<"John";for(int i=0;i<List.size();i++){
QString Name= QString::number(i);
f3 = new QFrame();
c= new QPushButton();
c->setText("Set "+List[i]);
c->setObjectName("Button"+Name);
ui->horizontalLayout->addWidget(c);}
}Here 2 buttons are created since List has 2 elements! But if I insert another element to the List 3 buttons are created but the size of a button in the 2 situations is different! How can I have a fixed size for the buttons for both the situations?