summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-07-09 09:50:58 (GMT)
committeraxis <qt-info@nokia.com>2009-07-09 09:50:58 (GMT)
commit3b1e30bb1d6651a626aba1f6b8883f5524598ed3 (patch)
tree075d7c08796ea25b9c5441c33718f6165926b049 /src/gui
parent86aec1ba2bb3275f4b2f562b42bdbae4e4ddeaf4 (diff)
parentb6377f43410b14125a66ffd02acde69cfb6e455e (diff)
downloadQt-3b1e30bb1d6651a626aba1f6b8883f5524598ed3.zip
Qt-3b1e30bb1d6651a626aba1f6b8883f5524598ed3.tar.gz
Qt-3b1e30bb1d6651a626aba1f6b8883f5524598ed3.tar.bz2
Merge branch 'fixing_tst_qdatetimeedit'
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp16
-rw-r--r--src/gui/kernel/qwidget.cpp6
-rw-r--r--src/gui/kernel/qwidget_p.h3
-rw-r--r--src/gui/kernel/qwidget_s60.cpp26
4 files changed, 37 insertions, 14 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index b954ddb..dd05806 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -659,20 +659,8 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
|| (qwidget->windowType() & Qt::Popup) == Qt::Popup)
return;
- if (IsFocused()) {
- QApplication::setActiveWindow(qwidget);
- // If widget is fullscreen, hide status pane and button container
- // otherwise show them.
- CEikStatusPane* statusPane = S60->statusPane();
- CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
- bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen;
- if (statusPane && (statusPane->IsVisible() == isFullscreen))
- statusPane->MakeVisible(!isFullscreen);
- if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen))
- buttonGroup->MakeVisible(!isFullscreen);
- } else {
- QApplication::setActiveWindow(0);
- }
+ QEvent *deferredFocusEvent = new QEvent(QEvent::SymbianDeferredFocusChanged);
+ QApplication::postEvent(qwidget, deferredFocusEvent);
}
void QSymbianControl::HandleResourceChange(int resourceType)
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index baacdf5..f1094c5 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -8018,6 +8018,12 @@ bool QWidget::event(QEvent *event)
d->needWindowChange = false;
break;
#endif
+ case QEvent::SymbianDeferredFocusChanged: {
+#ifdef Q_OS_SYMBIAN
+ d->handleSymbianDeferredFocusChanged();
+#endif
+ break;
+ }
#ifndef QT_NO_PROPERTIES
case QEvent::DynamicPropertyChange: {
const QByteArray &propName = static_cast<QDynamicPropertyChangeEvent *>(event)->propertyName();
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 0ad0255..24e7503 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -279,6 +279,9 @@ public:
#ifdef Q_WS_S60
void s60UpdateIsOpaque();
#endif
+#ifdef Q_OS_SYMBIAN
+ void handleSymbianDeferredFocusChanged();
+#endif
void raise_sys();
void lower_sys();
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index c8bca6e..3c7e424 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -421,6 +421,32 @@ void QWidgetPrivate::setFocus_sys()
q->effectiveWinId()->SetFocus(true);
}
+void QWidgetPrivate::handleSymbianDeferredFocusChanged()
+{
+ Q_Q(QWidget);
+ WId control = q->internalWinId();
+ if (!control) {
+ // This could happen if the widget was reparented, while the focuschange
+ // was in the event queue.
+ return;
+ }
+
+ if (control->IsFocused()) {
+ QApplication::setActiveWindow(q);
+ // If widget is fullscreen, hide status pane and button container
+ // otherwise show them.
+ CEikStatusPane* statusPane = S60->statusPane();
+ CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
+ bool isFullscreen = q->windowState() & Qt::WindowFullScreen;
+ if (statusPane && (statusPane->IsVisible() == isFullscreen))
+ statusPane->MakeVisible(!isFullscreen);
+ if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen))
+ buttonGroup->MakeVisible(!isFullscreen);
+ } else {
+ QApplication::setActiveWindow(0);
+ }
+}
+
void QWidgetPrivate::raise_sys()
{
Q_Q(QWidget);