From 9d78e1132427ec803f08b2861ab27587ca72cfbf Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Tue, 16 Jun 2009 11:45:30 +0200 Subject: Update softkeys correctly when no focus widget is present. In the case where there is no focus widget present, the button group container should be updated with the softkeys from the currently active window if it has softkeys. This patch enables this behavior. Also modify QMainWindow such that the soft keys are updated when the main window becomes the active window and not only when the menu bar is set. At the moment, this creates a new QAction and this should be changed since it will continuously grow the memory. As a final fix, move the soft key setting out of setFocus() because it is much to early. At the point, the widget does not know for certain that it actually will get focus since it could be disabled or have a focus proxy. --- src/gui/kernel/qapplication_s60.cpp | 7 ++++--- src/gui/kernel/qwidget.cpp | 12 +++++++++--- src/gui/widgets/qmainwindow.cpp | 11 ++++++++++- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 4c008fb..42faf98 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1072,9 +1072,10 @@ void QApplication::symbianHandleCommand(int command) default: if (command >= SOFTKEYSTART && command <= SOFTKEYEND) { int index= command-SOFTKEYSTART; - QWidget* focused = QApplication::focusWidget(); - const QList& softKeys = focused->softKeys(); - Q_ASSERT(index& softKeys = softKeySource->softKeys(); + Q_ASSERT(index < softKeys.count()); softKeys.at(index)->activate(QAction::Trigger); } else 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 &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; } -- cgit v0.12 From 8de706d342b31b863e9e7b8eb222a0cb2ab57054 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 16 Jun 2009 14:44:59 +0300 Subject: Fix Qt network autotest compilation for ARMV5. The build was broken by commit: 7604f8087f88171ef933d8ae08f501467e647338 --- tests/auto/network-settings.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index 0924c57..01a732c 100644 --- a/tests/auto/network-settings.h +++ b/tests/auto/network-settings.h @@ -50,7 +50,8 @@ #include #include #endif -#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) +#if defined(Q_OS_SYMBIAN) +#if defined(Q_CC_NOKIAX86) // In emulator we use WINSOCK connectivity by default. Unfortunately winsock // does not work very well with UDP sockets. This defines skips some test // cases which have known problems. @@ -59,6 +60,7 @@ // network tests. WINPCAP connectivity uses Symbian OS IP stack, // correspondingly as HW does. When using WINPCAP disable this define //#define SYMBIAN_WINSOCK_CONNECTIVITY +#endif // Q_CC_NOKIAX86 class QtNetworkSettingsRecord { public: @@ -80,7 +82,7 @@ private: QString strRecordValue; }; -#endif +#endif // Q_OS_SYMBIAN class QtNetworkSettings { -- cgit v0.12 From 5c858bdb9cfb1998b202c76c48913a3fd96c8dee Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 16 Jun 2009 14:59:52 +0300 Subject: Installation instructions update --- doc/src/installation.qdoc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index 13af50c..05188c7 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -554,9 +554,9 @@ in the \l{Qt for S60 Requirements} document. \note Qt for S60 has some requirements that are given in more detail in the \l{Qt for S60 Requirements} document. -\note This document describes how to install Qt for S60 from the source package. -Go \l{Installing Qt on S60 using binary package}{here} for instructions on how to install -Qt using binary package. +\note \bold {This document describes how to install and configure Qt for S60 from scratch. +If you are using pre-built binaries, follow the instructions +\l{Installing Qt on S60 using binary package}{here}.} \list 1 @@ -904,7 +904,11 @@ Qt using binary package. Qt for S60 requires the following software installed on your development PC: \list - \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher} + \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher} + \list + \o \bold{Note:} It is necessary to update Carbide compiler if you are using Carbide 2.0.2 or older. + You can find a compiler patch \l{http://pepper.troll.no/s60prereleases/patches/}{here}. + \endlist \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/S60SDK/}{S60 Platform SDK 3rd Edition FP1 or higher} \o \l{http://www.forum.nokia.com/main/resources/technologies/openc_cpp/}{Open C/C++ v1.6.0 or higher}. Install this to all S60 SDKs you plan to use Qt with. -- cgit v0.12