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:
Qt Code:
  1. QPushButton *button = new QPushButton(ui->listMenuWidget);
  2. button->setContentsMargins(20, 10, 20, 10);
  3. ui->listMenuWidget->addItem(item);
  4. 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!