summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorpeknurmi <qt-info@nokia.com>2009-06-03 06:44:41 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-06-03 06:47:34 (GMT)
commit3d19bb6e7572cad3644863f3f89cf67a3b7160d7 (patch)
treea815a85eac74c4b19a76cb19fb54a014eed38387 /src/gui/styles
parente7341afb8050cfd8bc0f5c423ff0d495b510df58 (diff)
downloadQt-3d19bb6e7572cad3644863f3f89cf67a3b7160d7.zip
Qt-3d19bb6e7572cad3644863f3f89cf67a3b7160d7.tar.gz
Qt-3d19bb6e7572cad3644863f3f89cf67a3b7160d7.tar.bz2
Now qs60style does not send extra resize event in orientation change.
QSymbianControl::HandleResourceChange contained global event handling. So Qt handled same issues unnecessarily (for each shown top level widget). Now this global event handling is encapsulated to s60ResourceChange (new method) called by s60main. In addition, qs60style generated unnecessary resize events. If widget was fullscreen or maximized, then this caused incorrect resize events (old size delivered). With these changes, qs60style just informs widgets of style change (similarly as in qstylesheetstyle). Task-number: 251085 Reviewed-by: Jason Barron <jason.barron@nokia.com> Conflicts: src/gui/kernel/qapplication.h src/gui/styles/qs60style.cpp
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qs60style.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index fde1cc6..3aaa839 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -119,6 +119,22 @@ static const int frameElementsCount =
const int KNotFound = -1;
+static void updateWidgets(const QList<QWidget *>& widgets)
+{
+ // This is based on updateWidgets in qstylesheetstyle.cpp.
+
+ for (int i = 0; i < widgets.size(); ++i) {
+ QWidget *widget = const_cast<QWidget *>(widgets.at(i));
+ if (widget == 0)
+ continue;
+ widget->style()->polish(widget);
+ QEvent event(QEvent::StyleChange);
+ qApp->sendEvent(widget, &event);
+ widget->update();
+ widget->updateGeometry();
+ }
+}
+
QS60StylePrivate::~QS60StylePrivate()
{
clearCaches(); //deletes also background image
@@ -584,14 +600,8 @@ QPixmap QS60StylePrivate::cachedFrame(SkinFrameElements frame, const QSize &size
}
void QS60StylePrivate::refreshUI()
-{
- foreach (QWidget *topLevelWidget, QApplication::allWidgets()) {
- topLevelWidget->updateGeometry();
- //todo: study how we can get rid of this. Apparently scrollbars cache pixelmetrics values, and we need them to update themselves
- // maybe styleChanged event is enough?
- //QCoreApplication::postEvent(topLevelWidget, new QEvent(QEvent::StyleChange));
- QCoreApplication::postEvent(topLevelWidget, new QResizeEvent(topLevelWidget->size(), topLevelWidget->size()));
- }
+{
+ updateWidgets(QApplication::allWidgets());
}
void QS60StylePrivate::setFont(QWidget *widget) const