QListWidget Custom Widget, has more space on right side & Limit widget count for each line
Solved
General and Desktop
-
Hello,
I have QListWidget with red border.
I am using this code to set custom widget;lblResim = QLabel() lblResim.setPixmap(QPixmap(':/avatars/img/Avatars/Adam1.png').scaled(QSize(128,128),Qt.KeepAspectRatio, Qt.SmoothTransformation)) item = QListWidgetItem() listWidget.addItem(item) listWidget.setItemWidget(item, lblResim) item.setSizeHint(lblResim.sizeHint())
- Is there anyway to sync left and right space? (In picture, left side has 18 pixels space, right side has 72 pixels space, left and right should be has (72+18)/2 pixels space)
- As you see in picture, first and second line has 4 items/widgets. Is QListWidget has any function to set limit per line like listWidget.setCountPerLine(3) ?
I hope it was understandable, Thanks!
-
Hi,
You could check with the gridSize property.
As for limiting the number of column, it looks like you might rather be looking for a QTableWidget.