So, it is as I thought. But what if I do something like that:
QVector<QPushButton*> btn;
btn.clear();
for(int j=0; j<HOW_MANY_BUTTONS; j++)
{
b->setGeometry(0,0,40,40);
btn << b;
ui->verticalLayout->addWidget(btn[j],Qt::AlignVCenter);
}
QVector<QPushButton*> btn;
btn.clear();
for(int j=0; j<HOW_MANY_BUTTONS; j++)
{
QPushButton *b = new QPushButton;
b->setGeometry(0,0,40,40);
btn << b;
ui->verticalLayout->addWidget(btn[j],Qt::AlignVCenter);
}
To copy to clipboard, switch view to plain text mode
Can I then remove item from layout using:
ui->verticalLayout->removeWidget(btn[i]);
ui->verticalLayout->removeWidget(btn[i]);
To copy to clipboard, switch view to plain text mode
Or maybe different pointer points on that widget?
thanks in advance
best regards
Tomasz
Bookmarks