From e30bad8b244f935d8a025f94f7d20ee495bc43e1 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 11 Sep 2013 13:34:01 +0200 Subject: Windows style: Support underlined mnemonics from Qt Quick Controls We use the usual accessibility + private property combo pattern. Task-number: QTBUG-33030 Change-Id: I7fbb704c949ff2df163536534f6f46d2e226402d Reviewed-by: J-P Nurmi --- src/widgets/styles/qwindowsstyle.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/widgets/styles') diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 0acd6052c8..b153d05885 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -582,6 +582,12 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid ret = 1; } } +#ifndef QT_NO_ACCESSIBILITY + if (!ret && opt && opt->type == QStyleOption::SO_MenuItem + && QStyleHelper::isInstanceOf(opt->styleObject, QAccessible::MenuItem) + && opt->styleObject->property("_q_showUnderlined").toBool()) + ret = 1; +#endif // QT_NO_ACCESSIBILITY break; } #endif -- cgit v1.2.3 From 44a58de2aea6d2ac71efe7261a398effbf139f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 13 Sep 2013 10:42:40 +0200 Subject: Fix highdpi CE_HeaderLabel pixmaps in fusion style Make sure enough pixels is sourced by multiplying the layout rect size with the pixmaps devicePixelRatio. Task-number: QTBUG-31477 Change-Id: I742603c09a65a520587da3eef9479ef7f0c87022 Reviewed-by: Gabriel de Dietrich --- src/widgets/styles/qcommonstyle.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/widgets/styles') diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index ba6c222820..aaad4c3331 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1525,7 +1525,10 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, QRect aligned = alignedRect(header->direction, QFlag(header->iconAlignment), pixmap.size() / pixmap.devicePixelRatio(), rect); QRect inter = aligned.intersected(rect); - p->drawPixmap(inter.x(), inter.y(), pixmap, inter.x() - aligned.x(), inter.y() - aligned.y(), inter.width(), inter.height()); + p->drawPixmap(inter.x(), inter.y(), pixmap, + inter.x() - aligned.x(), inter.y() - aligned.y(), + aligned.width() * pixmap.devicePixelRatio(), + pixmap.height() * pixmap.devicePixelRatio()); if (header->direction == Qt::LeftToRight) rect.setLeft(rect.left() + pixw + 2); -- cgit v1.2.3