QT 6.9 QTableView QStyledItemDelegate Button CSS not working
-
wrote 21 days ago last edited by
Button Css does not apply on qtableview button drawn inside a QStyledItemDelegate with QT 6.9. QT 6.8 works fine. Below is the code that draws the button.
QStyleOptionButton button;
button.rect = option.rect.adjusted(2,2,-2,-2);
button.state = QStyle::State_Enabled | QStyle::State_Raised;
button.icon= QIcon(index.column()==0 ? ":/images/svg/media/media_play.svg" : ":/images/png/eye.png");
button.iconSize= QSize(12,12);
btn.style()->drawControl(QStyle::CE_PushButton, &button, painter, &btn);QT 6.8 Snapshot
QT 6.9 Snapshot
CSS
QPushButton {
color: rgb(226, 226, 226);
background-color: #333333;
padding: 4px 20px;
margin-bottom: 0px;
border: 1px outset #333333;
border-radius: 0px;
}Please observe the first and last columns. in QT 6.9 , the borders of the buttons are not showing
-
Please provide a minimal, compilable example of your problem - I would guess it's not more than 30 lines.
2/2