diff options
author | Janne Koskinen <janne.p.koskinen@digia.com> | 2009-06-17 13:51:46 (GMT) |
---|---|---|
committer | Janne Koskinen <janne.p.koskinen@digia.com> | 2009-06-17 13:51:46 (GMT) |
commit | d9911390f17426801f553cb82654e102fe0400b9 (patch) | |
tree | 5c0dd218d44d0989761c01007d128de2d0e60f4c /src/gui | |
parent | 75140c4776934744c37a34b10b7d4b8665aa4dc1 (diff) | |
parent | 06346d241d3a66bb488addcacae8a6e0d0d6e59c (diff) | |
download | Qt-d9911390f17426801f553cb82654e102fe0400b9.zip Qt-d9911390f17426801f553cb82654e102fe0400b9.tar.gz Qt-d9911390f17426801f553cb82654e102fe0400b9.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 7 | ||||
-rw-r--r-- | src/gui/kernel/qlayout.cpp | 14 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 12 | ||||
-rw-r--r-- | src/gui/widgets/qmainwindow.cpp | 11 |
5 files changed, 35 insertions, 11 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 7d79422..9e70cff 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -74,8 +74,6 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent) m_fepState->SetFlags(EAknEditorFlagDefault); m_fepState->SetDefaultInputMode( EAknEditorTextInputMode ); m_fepState->SetPermittedInputModes( EAknEditorAllInputModes ); - m_fepState->SetLocalLanguage(ELangEnglish); - m_fepState->SetDefaultLanguage(ELangEnglish); m_fepState->SetDefaultCase( EAknEditorLowerCase ); m_fepState->SetPermittedCases( EAknEditorLowerCase|EAknEditorUpperCase ); m_fepState->SetSpecialCharacterTableResourceId( 0 ); diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 9a2bbe6..3bd6e6b 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1075,9 +1075,10 @@ void QApplication::symbianHandleCommand(int command) default: if (command >= SOFTKEYSTART && command <= SOFTKEYEND) { int index= command-SOFTKEYSTART; - QWidget* focused = QApplication::focusWidget(); - const QList<QAction*>& softKeys = focused->softKeys(); - Q_ASSERT(index<softKeys.count()); + QWidget *focused = QApplication::focusWidget(); + QWidget *softKeySource = focused ? focused : QApplication::activeWindow(); + const QList<QAction*>& softKeys = softKeySource->softKeys(); + Q_ASSERT(index < softKeys.count()); softKeys.at(index)->activate(QAction::Trigger); } else diff --git a/src/gui/kernel/qlayout.cpp b/src/gui/kernel/qlayout.cpp index 4463aab..d8d8234 100644 --- a/src/gui/kernel/qlayout.cpp +++ b/src/gui/kernel/qlayout.cpp @@ -145,7 +145,12 @@ QLayout::QLayout(QLayoutPrivate &dd, QLayout *lay, QWidget *w) } else { d->topLevel = true; w->d_func()->layout = this; - invalidate(); + QT_TRY { + invalidate(); + } QT_CATCH(...) { + w->d_func()->layout = 0; + QT_RETHROW; + } } } } @@ -230,7 +235,12 @@ QLayout::QLayout(QWidget *parent, int margin, int spacing, const char *name) } else { d->topLevel = true; parent->d_func()->layout = this; - invalidate(); + QT_TRY { + invalidate(); + } QT_CATCH(...) { + parent->d_func()->layout = 0; + QT_RETHROW; + } } } } diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index a83a79f..8d2569e 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5781,7 +5781,6 @@ bool QWidget::hasFocus() const void QWidget::setFocus(Qt::FocusReason reason) { Q_D(QWidget); - d->setSoftKeys_sys(softKeys()); if (!isEnabled()) return; @@ -7733,6 +7732,7 @@ bool QWidget::event(QEvent *event) #if defined(Q_WS_WIN) QInputContextPrivate::updateImeStatus(this, true); #endif + d->setSoftKeys_sys(softKeys()); focusInEvent((QFocusEvent*)event); break; @@ -7885,6 +7885,10 @@ bool QWidget::event(QEvent *event) if (w && w->isVisible() && !w->isWindow()) QApplication::sendEvent(w, event); } + + if (isWindow() && isActiveWindow()) + d->setSoftKeys_sys(softKeys()); + break; } case QEvent::LanguageChange: @@ -11617,7 +11621,8 @@ void QWidget::setSoftKey(QAction *softKey) d->softKeys.clear(); if (softKey) d->softKeys.append(softKey); - if (QApplication::focusWidget() == this) + if ((!QApplication::focusWidget() && this == QApplication::activeWindow()) + || QApplication::focusWidget() == this) d->setSoftKeys_sys(this->softKeys()); } @@ -11634,7 +11639,8 @@ void QWidget::setSoftKeys(const QList<QAction*> &softKeys) d->softKeys.clear(); d->softKeys = softKeys; - if ((QApplication::focusWidget() == this) || (QApplication::focusWidget()==0)) + if ((!QApplication::focusWidget() && this == QApplication::activeWindow()) + || QApplication::focusWidget() == this) d->setSoftKeys_sys(this->softKeys()); } diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 2f3b412..5f8371c 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1396,7 +1396,16 @@ bool QMainWindow::event(QEvent *event) } break; #endif - +#ifndef QT_NO_MENUBAR + case QEvent::WindowActivate: + if (d->layout->menuBar()) { + // ### TODO: This is evil, there is no need to create a new action every time + QAction* menu = new QAction(QString::fromLatin1("Menu"), this); + menu->setSoftKeyRole(QAction::MenuSoftKey); + setSoftKey(menu); + } + break; +#endif default: break; } |