From 5f8978a02bde7f84dc48b63d3722b925730790f0 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 22 Oct 2009 10:34:44 +0200 Subject: move default QAbstractButton font setup on Win mobile to QApplication The original approach of modifying the font for QAbstractButtons in QWindowsMobileStyle::polish broke the autotest tst_qstylesheetstyle::fontPropagation. Reviewed-by: thartman --- src/gui/kernel/qapplication_win.cpp | 2 ++ src/gui/styles/qwindowsmobilestyle.cpp | 25 +------------------------ 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 1babb69..5a4f4e6 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -624,6 +624,8 @@ static void qt_set_windows_font_resources() if (qt_wince_is_mobile()) { smallerFont.setPointSize(systemFont.pointSize()-1); QApplication::setFont(smallerFont, "QTabBar"); + smallerFont.setBold(true); + QApplication::setFont(smallerFont, "QAbstractButton"); } #endif// Q_OS_WINCE } diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp index 32e39b2..f04a4b2 100644 --- a/src/gui/styles/qwindowsmobilestyle.cpp +++ b/src/gui/styles/qwindowsmobilestyle.cpp @@ -3130,34 +3130,11 @@ void QWindowsMobileStyle::polish(QWidget *widget) { else #endif //QT_NO_TOOLBAR -#ifndef QT_NO_PROPERTIES - if (QAbstractButton *pushButton = qobject_cast(widget)) { - QVariant oldFont = widget->property("_q_styleWindowsMobileFont"); - if (!oldFont.isValid()) { - QFont f = pushButton->font(); - widget->setProperty("_q_styleWindowsMobileFont", f); - f.setBold(true); - int p = f.pointSize(); - if (p > 2) - f.setPointSize(p-1); - pushButton->setFont(f); - } - } -#endif - QWindowsStyle::polish(widget); + QWindowsStyle::polish(widget); } void QWindowsMobileStyle::unpolish(QWidget *widget) { -#ifndef QT_NO_PROPERTIES - if (QAbstractButton *pushButton = qobject_cast(widget)) { - QVariant oldFont = widget->property("_q_styleWindowsMobileFont"); - if (oldFont.isValid()) { - widget->setFont(qVariantValue(oldFont)); - widget->setProperty("_q_styleWindowsMobileFont", QVariant()); - } - } -#endif QWindowsStyle::unpolish(widget); } -- cgit v0.12