Skip to content

Commit

Permalink
Native style: Fix crash when opening a combobox
Browse files Browse the repository at this point in the history
Bug introduced by #1231
  • Loading branch information
ogoffart committed May 9, 2022
1 parent c160ec2 commit 226ceca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/backends/qt/qt_widgets/combobox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl Item for NativeComboBoxPopup {

fn_render! { _this dpr size painter widget initial_state =>
cpp!(unsafe [
painter as "QPainter*",
painter as "QPainterPtr*",
widget as "QWidget*",
size as "QSize",
dpr as "float",
Expand All @@ -214,7 +214,7 @@ impl Item for NativeComboBoxPopup {
auto style = qApp->style();

if (style->styleHint(QStyle::SH_ComboBox_Popup, &option, widget)) {
style->drawPrimitive(QStyle::PE_PanelMenu, &option, painter, widget);
style->drawPrimitive(QStyle::PE_PanelMenu, &option, painter->get(), widget);
} else {
option.lineWidth = 1;
}
Expand All @@ -224,7 +224,7 @@ impl Item for NativeComboBoxPopup {
else if ((frameStyle & QFrame::Shadow_Mask) == QFrame::Raised)
option.state |= QStyle::State_Raised;
option.frameShape = QFrame::Shape(frameStyle & QFrame::Shape_Mask);
style->drawControl(QStyle::CE_ShapedFrame, &option, painter, widget);
style->drawControl(QStyle::CE_ShapedFrame, &option, painter->get(), widget);
});
}
}
Expand Down

0 comments on commit 226ceca

Please sign in to comment.