QTableView::indicator doesn't work on Qt6.2 or Qt6.3
-
Hi,
I want to show a QTableWidget on a custom dialog, so I do this for the dialog:
this->setAttribute(Qt::WA_TranslucentBackground);//set background transparently
this->setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);//set frameless
Then, I want to set StyleSheet for QTableWidget. The stylesheet is:
QTableWidget::indicator {
border: none;
margin-left: 40px;
margin-top: 1px;
width: 35px;
height: 34px;
}
QTableWidget::indicator:unchecked {
image: url(':/task_unchecked.png');
}
QTableWidget::indicator:checked {
image: url(':/task_checked.png');
}
On Qt5.x, the stylesheet works well.
On Qt6.2, the stylesheet dosen't work. The indicator is still origin style, and doesn't load image.
On Qt6.3, the stylesheet works incorrectly. Both the origin indicator and loaded image show in the table cell. If I disable "this->setAttribute(Qt::WA_TranslucentBackground);", it works well.
Many thanks.
Jimmy -
Hi and welcome to devnet,
Please provide a minimal compilable example that shows that issue.
You should also check the bug report system. If memory serves well, there has been some issues related to stylesheets.