diff options
author | Alessandro Portale <aportale@trolltech.com> | 2009-08-11 16:48:24 (GMT) |
---|---|---|
committer | Alessandro Portale <aportale@trolltech.com> | 2009-08-11 16:48:24 (GMT) |
commit | 7bd60b56dee678ae6a013983fcd403d5c00a20d1 (patch) | |
tree | ae906e65e811aadb45766745eabac2ff71460290 | |
parent | ebb0b4046cab4ea94795e8fb2ceb3242393e1040 (diff) | |
download | Qt-7bd60b56dee678ae6a013983fcd403d5c00a20d1.zip Qt-7bd60b56dee678ae6a013983fcd403d5c00a20d1.tar.gz Qt-7bd60b56dee678ae6a013983fcd403d5c00a20d1.tar.bz2 |
Cleaned public Api of QS60Style due to review by Volker Hilsheimer.
Moved handleDynamicLayoutVariantSwitch and handleSkinChange from
QS60Style to QS60StylePrivate. QApplication (the only one calling
those functions) is now a friend, thus has access to the private
class.
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 4 | ||||
-rw-r--r-- | src/gui/styles/qs60style.h | 7 | ||||
-rw-r--r-- | src/gui/styles/qs60style_p.h | 5 | ||||
-rw-r--r-- | src/gui/styles/qs60style_s60.cpp | 20 |
4 files changed, 17 insertions, 19 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index d2183d2..db78349 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1100,7 +1100,7 @@ void QApplication::symbianResourceChange(int type) s60Style = qobject_cast<QS60Style*>(QApplication::style()); if (s60Style) - s60Style->handleDynamicLayoutVariantSwitch(); + s60Style->d_func()->handleDynamicLayoutVariantSwitch(); #endif } break; @@ -1108,7 +1108,7 @@ void QApplication::symbianResourceChange(int type) #ifndef QT_NO_STYLE_S60 case KAknsMessageSkinChange: if (QS60Style *s60Style = qobject_cast<QS60Style*>(QApplication::style())) - s60Style->handleSkinChange(); + s60Style->d_func()->handleSkinChange(); break; #endif #endif // Q_WS_S60 diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h index bdd8c8a..7711b19 100644 --- a/src/gui/styles/qs60style.h +++ b/src/gui/styles/qs60style.h @@ -89,12 +89,6 @@ public: bool saveS60ThemeToBlob(const QString &blobFile) const; #endif // !Q_WS_S60 -#ifdef Q_WS_S60 -public Q_SLOTS: - void handleDynamicLayoutVariantSwitch(); - void handleSkinChange(); -#endif // Q_WS_S60 - protected Q_SLOTS: QIcon standardIconImplementation( StandardPixmap standardIcon, const QStyleOption * option = 0, const QWidget * widget = 0 ) const; @@ -102,6 +96,7 @@ protected Q_SLOTS: private: Q_DISABLE_COPY(QS60Style) friend class QStyleFactory; + friend class QApplication; }; #endif // QT_NO_STYLE_S60 diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 0cd2310..680d787 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -455,6 +455,11 @@ public: SkinElementFlags flags = KDefaultSkinElementFlags); static QPixmap backgroundTexture(); +#ifdef Q_WS_S60 + void handleDynamicLayoutVariantSwitch(); + void handleSkinChange(); +#endif // Q_WS_S60 + private: static void drawPart(QS60StyleEnums::SkinParts part, QPainter *painter, const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags); diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 635442b..45be2eb 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -1358,26 +1358,24 @@ QS60Style::QS60Style() { } -void QS60Style::handleDynamicLayoutVariantSwitch() +void QS60StylePrivate::handleDynamicLayoutVariantSwitch() { - Q_D(QS60Style); - d->clearCaches(QS60StylePrivate::CC_LayoutChange); - d->setActiveLayout(); - d->refreshUI(); - d->setBackgroundTexture(qApp); + clearCaches(QS60StylePrivate::CC_LayoutChange); + setActiveLayout(); + refreshUI(); + setBackgroundTexture(qApp); foreach (QWidget *widget, QApplication::allWidgets()) widget->ensurePolished(); } -void QS60Style::handleSkinChange() +void QS60StylePrivate::handleSkinChange() { - Q_D(QS60Style); - d->clearCaches(QS60StylePrivate::CC_ThemeChange); - d->setThemePalette(qApp); + clearCaches(QS60StylePrivate::CC_ThemeChange); + setThemePalette(qApp); foreach (QWidget *topLevelWidget, QApplication::allWidgets()){ QEvent e(QEvent::StyleChange); QApplication::sendEvent(topLevelWidget, &e); - d->setThemePalette(topLevelWidget); + setThemePalette(topLevelWidget); topLevelWidget->ensurePolished(); } } |