PDA

View Full Version : QListWidget margin/padding space



Hennessy
28th March 2014, 15:01
Hi guys, need help. I want to delete space between left edge and right edge equivalent, or be able to control it, thanks!
Real important things, I rewrite resizeEvent for my main QWidget instance (for change size of my QListWidget).




w.compListWidg->setIconSize(QSize(32,32));
w.compListWidg->setViewMode(QListView::IconMode);
w.compListWidg->setResizeMode(QListView::Adjust);
w.compListWidg->setGridSize(QSize(100, 60));


w.compList << inst1.getValueName() << inst2.getValueName() << inst3.getValueName() << inst4.getValueName()
<< inst5.getValueName() << inst6.getValueName() << inst7.getValueName() << inst8.getValueName();

foreach(QString nameItem, w.compList) {
w.compItem = new QListWidgetItem(nameItem, w.compListWidg);
w.compItem->setIcon(QPixmap(":/icon/icon.png"));
w.compItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
}


10200