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->setIcon
(QPixmap(":/icon/icon.png"));
w.compItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
}
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);
}
To copy to clipboard, switch view to plain text mode
Qt.jpg
Bookmarks