diff options
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 9 | ||||
-rw-r--r-- | tests/auto/qtemporaryfile/qtemporaryfile.pro | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 11cb974..e32e272 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -319,7 +319,8 @@ void QWidgetPrivate::hide_sys() deactivateWidgetCleanup(); WId id = q->internalWinId(); if (q->isWindow() && id) { - id->SetFocus(false); + if(id->IsFocused()) // Avoid unnecessry calls to FocusChanged() + id->SetFocus(false); id->MakeVisible(false); id->ControlEnv()->AppUi()->RemoveFromStack(id); if (QWidgetBackingStore *bs = maybeBackingStore()) @@ -335,7 +336,8 @@ void QWidgetPrivate::setFocus_sys() { Q_Q(QWidget); if (q->testAttribute(Qt::WA_WState_Created) && q->window()->windowType() != Qt::Popup) - q->effectiveWinId()->SetFocus(true); + if(!q->effectiveWinId()->IsFocused()) // Avoid unnecessry calls to FocusChanged() + q->effectiveWinId()->SetFocus(true); } void QWidgetPrivate::raise_sys() @@ -922,7 +924,8 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) releaseKeyboard(); if (destroyWindow && !(windowType() == Qt::Desktop) && internalWinId()) { WId id = internalWinId(); - id->SetFocus(false); + if(id->IsFocused()) // Avoid unnecessry calls to FocusChanged() + id->SetFocus(false); id->ControlEnv()->AppUi()->RemoveFromStack(id); CBase::Delete(id); diff --git a/tests/auto/qtemporaryfile/qtemporaryfile.pro b/tests/auto/qtemporaryfile/qtemporaryfile.pro index a3a3910..0f2a6ea 100644 --- a/tests/auto/qtemporaryfile/qtemporaryfile.pro +++ b/tests/auto/qtemporaryfile/qtemporaryfile.pro @@ -2,4 +2,11 @@ load(qttest_p4) SOURCES += tst_qtemporaryfile.cpp QT = core -!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" + +symbian { + testData.sources = tst_qtemporaryfile.cpp + testData.path = . + DEPLOYMENT += testData +}else { + DEFINES += SRCDIR=\\\"$$PWD/\\\" +} |