MCPcopy Create free account
hub / github.com/IChooseYou/Reclass / drawControl

Method drawControl

tests/test_editor.cpp:1204–1221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1202 QProxyStyle::drawPrimitive(elem, opt, p, w);
1203 }
1204 void drawControl(ControlElement element, const QStyleOption* opt,
1205 QPainter* p, const QWidget* w) const override {
1206 if (element == CE_MenuItem || element == CE_MenuBarItem) {
1207 if (auto* mi = qstyleoption_cast<const QStyleOptionMenuItem*>(opt)) {
1208 if ((mi->state & State_Selected)
1209 && mi->menuItemType != QStyleOptionMenuItem::Separator) {
1210 QStyleOptionMenuItem patched = *mi;
1211 patched.palette.setColor(QPalette::Highlight,
1212 mi->palette.color(QPalette::Mid));
1213 patched.palette.setColor(QPalette::HighlightedText,
1214 mi->palette.color(QPalette::Link));
1215 QProxyStyle::drawControl(element, &patched, p, w);
1216 return;
1217 }
1218 }
1219 }
1220 QProxyStyle::drawControl(element, opt, p, w);
1221 }
1222 };
1223
1224 // Install our style as the app style (same as main.cpp does)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected