Hi,
I have a problem - I created QListWidget that contains QPushButtons and I would like to make space between these buttons, but function setContentsMargins doesn't work.
Do you have any idea, what it do that?
Snippets - creating QListWidgetItem and set margins:
button->setContentsMargins(20, 10, 20, 10);
ui->listMenuWidget->addItem(item);
ui->listMenuWidget->setItemWidget(item, button);
QListWidgetItem *item = new QListWidgetItem;
QPushButton *button = new QPushButton(ui->listMenuWidget);
button->setContentsMargins(20, 10, 20, 10);
ui->listMenuWidget->addItem(item);
ui->listMenuWidget->setItemWidget(item, button);
To copy to clipboard, switch view to plain text mode
I created several buttons and what is also important, each of them has a border, so i can't use i.e. padding.
I have lost a few hours on it and I have no clue how I can do that.
BR!
Bookmarks