Center align the icon in QAbstractItemView using stylesheets
General and Desktop
3
Posts
2
Posters
5.4k
Views
1
Watching
-
I have a custom model for a table view. My data function returns a QImage for the decoration role. But this image is not center aligned (horizontally and vertically). I tried using the following style sheet. But the image is still not centered. Please help.
QAbstractItemView::icon {
border: 1px solid black;
}QAbstractItemView {
subcontrol-position: center center;
} -
Try to use QAbstractItemView::item