diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-06-18 06:41:10 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-06-18 06:41:10 (GMT) |
commit | 9ad849c8520e3a1efe47f1f67fb675c8e7754054 (patch) | |
tree | 188622a4c277d4ff0f372ec78216fcefec8c466a | |
parent | 2b09eb0937985015e1ecc42a8bd39f0bc4c84b17 (diff) | |
parent | f0f77eadbefdae45c70945392f6acdc21d47c601 (diff) | |
download | Qt-9ad849c8520e3a1efe47f1f67fb675c8e7754054.zip Qt-9ad849c8520e3a1efe47f1f67fb675c8e7754054.tar.gz Qt-9ad849c8520e3a1efe47f1f67fb675c8e7754054.tar.bz2 |
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
-rw-r--r-- | demos/browser/browser.pro | 2 | ||||
-rw-r--r-- | dist/changes-4.5.2-tower | 29 | ||||
-rw-r--r-- | doc/src/installation.qdoc | 5 | ||||
-rw-r--r-- | examples/webkit/fancybrowser/fancybrowser.pro | 2 | ||||
-rw-r--r-- | examples/webkit/formextractor/formextractor.pro | 2 | ||||
-rw-r--r-- | examples/webkit/googlechat/googlechat.pro | 2 | ||||
-rw-r--r-- | examples/webkit/previewer/previewer.pro | 2 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_symbian.cpp | 11 | ||||
-rw-r--r-- | src/corelib/tools/qlocale_symbian.cpp | 5 | ||||
-rw-r--r-- | src/corelib/tools/qringbuffer_p.h | 8 | ||||
-rw-r--r-- | src/gui/dialogs/qfscompleter_p.h | 5 | ||||
-rw-r--r-- | src/gui/image/qpixmap.h | 9 | ||||
-rw-r--r-- | src/gui/kernel/qaction.h | 9 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 14 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 65 | ||||
-rw-r--r-- | src/gui/widgets/qmainwindow.cpp | 4 |
17 files changed, 130 insertions, 50 deletions
diff --git a/demos/browser/browser.pro b/demos/browser/browser.pro index c500788..7b7c448 100644 --- a/demos/browser/browser.pro +++ b/demos/browser/browser.pro @@ -91,3 +91,5 @@ sources.path = $$[QT_INSTALL_DEMOS]/browser INSTALLS += target sources include($$QT_SOURCE_TREE/demos/demobase.pri) + +symbian:TARGET.UID3 = 0xA000CF70
\ No newline at end of file diff --git a/dist/changes-4.5.2-tower b/dist/changes-4.5.2-tower index 41dc8c8..1ed5aaa 100644 --- a/dist/changes-4.5.2-tower +++ b/dist/changes-4.5.2-tower @@ -61,6 +61,11 @@ Features - QSslSocket * Added support for -openssl option i.e. runtime resolving of OpenSSL symbols + +- QWidget + * Basic widgets are now navigatable and usable via keypad on SDK 3 + FP 1 and FP 2. + - todo * todo @@ -169,6 +174,8 @@ Optimizations * Fix for frame masks with color depth other than EGrey2. * Fix for squeezed QTabBars. * Fix memory leak when color skinning graphics. + * Show focus/Editfocus visualization for KeyPad navigation on + SDK 3 FP 1 and FP 2 - QDesktopServices * Switched QDesktopServices mail-to URL handling to RSendAs in Symbian, @@ -199,6 +206,21 @@ Optimizations * Fix to Open C bug: select sometimes returns -1 and errno is ECONNREFUSED +- QWidget + * Added API for setting softkeys + +- QMenuBar + * Native menus are handled properly even when application has multiple QMainWindows + * Fixed a bug causing both native and qt menu to be created + * Fix for disappearing options menu after coming back from dialog + +- QFontDataBase + * Now, also fonts from the user's /resources/fonts direactories are + available. + +- QFontMetrics + * Fixed the boundingRect calculation for text. + **************************************************************************** * Examples and demos * **************************************************************************** @@ -224,12 +246,15 @@ Optimizations since the issue has been fixed in qmake. * Included drilldown to demonstrate QtSql usage * Updated screenshots to S60 style + * Added softkeys example + +- Softkeys + * New example showing how to use softkeys API in QWidget **************************************************************************** * Tools * **************************************************************************** - - qmake * Support for generating Symbian "test" targets: CONFIG += symbian_test. * Support for Symbian Build System, version 2 (aka Raptor) via @@ -259,7 +284,7 @@ Optimizations * Will now patch also vendor id. **************************************************************************** -* Documnetation * +* Documentation * **************************************************************************** - qmake-manual * 250370: Added documentation for ICON keyword diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index 05188c7..c8310ff 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -906,8 +906,9 @@ If you are using pre-built binaries, follow the instructions \list \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}. + \o \bold{Note:} It may be necessary to update the Carbide compiler. + See \l{http://pepper.troll.no/s60prereleases/patches/}{here} for instructions how to check your + compiler version and how to patch it, if needed. \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}. diff --git a/examples/webkit/fancybrowser/fancybrowser.pro b/examples/webkit/fancybrowser/fancybrowser.pro index 3de3036..afc0cc2 100644 --- a/examples/webkit/fancybrowser/fancybrowser.pro +++ b/examples/webkit/fancybrowser/fancybrowser.pro @@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/webkit/fancybrowser sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/fancybrowser INSTALLS += target sources + +symbian:TARGET.UID3 = 0xA000CF6C
\ No newline at end of file diff --git a/examples/webkit/formextractor/formextractor.pro b/examples/webkit/formextractor/formextractor.pro index ddd39b4..ecb264c 100644 --- a/examples/webkit/formextractor/formextractor.pro +++ b/examples/webkit/formextractor/formextractor.pro @@ -16,3 +16,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/formextractor INSTALLS += target sources include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000CF6D
\ No newline at end of file diff --git a/examples/webkit/googlechat/googlechat.pro b/examples/webkit/googlechat/googlechat.pro index 14b7085..bc2aad3 100644 --- a/examples/webkit/googlechat/googlechat.pro +++ b/examples/webkit/googlechat/googlechat.pro @@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/webkit/googlechat sources.files = $$SOURCES $$HEADERS $$FORMS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/googlechat INSTALLS += target sources + +symbian:TARGET.UID3 = 0xA000CF6E
\ No newline at end of file diff --git a/examples/webkit/previewer/previewer.pro b/examples/webkit/previewer/previewer.pro index 4c8a09d..ce7906b 100644 --- a/examples/webkit/previewer/previewer.pro +++ b/examples/webkit/previewer/previewer.pro @@ -13,3 +13,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/previewer INSTALLS += target sources include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000CF6F
\ No newline at end of file diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 361c038..14b6895 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -2314,10 +2314,12 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); #endif #if defined(Q_OS_SYMBIAN) - +QT_END_NAMESPACE // forward declare std::exception +#ifdef __cplusplus namespace std { class exception; } - +#endif +QT_BEGIN_NAMESPACE Q_CORE_EXPORT void qt_translateSymbianErrorToException(int error); Q_CORE_EXPORT void qt_translateExceptionToSymbianErrorL(const std::exception& ex); Q_CORE_EXPORT int qt_translateExceptionToSymbianError(const std::exception& ex); diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 423fbaa..17bb9a7 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -231,6 +231,9 @@ void QTimerActiveObject::RunL() void QTimerActiveObject::Run() { + if (!okToRun()) + return; + if (m_timerInfo->interval > 0) { // Start a new timer immediately so that we don't lose time. iStatus = KRequestPending; @@ -644,9 +647,9 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla QT_TRY { Q_D(QAbstractEventDispatcher); - // It is safe if this counter overflows. The main importance is that each - // iteration count is different from the last. - m_iterationCount++; + // It is safe if this counter overflows. The main importance is that each + // iteration count is different from the last. + m_iterationCount++; RThread &thread = d->threadData->symbian_thread_handle; @@ -719,7 +722,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla break; } block = false; - if (timeState == TimeStarted && time.elapsed() > 100) { + if (timeState == TimeStarted && time.elapsed() > 100) { priority = m_processHandle.Priority(); m_processHandle.SetPriority(EPriorityLow); time.start(); diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp index c11a7b9..976227d 100644 --- a/src/corelib/tools/qlocale_symbian.cpp +++ b/src/corelib/tools/qlocale_symbian.cpp @@ -47,11 +47,12 @@ #include <e32std.h> #include "private/qcore_symbian_p.h" -// Located in qlocale.cpp -extern void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry); QT_BEGIN_NAMESPACE +// Located in qlocale.cpp +extern void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry); + static TExtendedLocale _s60Locale; // Type definitions for runtime resolved function pointers diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h index ac33353..a1bfab0 100644 --- a/src/corelib/tools/qringbuffer_p.h +++ b/src/corelib/tools/qringbuffer_p.h @@ -199,8 +199,12 @@ public: inline void clear() { if(!buffers.isEmpty()) { - // remove all but the first - buffers.erase(buffers.begin() + 1, buffers.end()); + QByteArray tmp = buffers[0]; + buffers.clear(); + buffers << tmp; + //TODO merge this optimization ? + //buffers.erase(buffers.begin() + 1, buffers.end()); + //>>>>>>> 08ae7ee1fb930e7d4b4039e2294cba69f9380964:src/corelib/tools/qringbuffer_p.h if (buffers.at(0).size() != basicBlockSize) buffers[0].resize(basicBlockSize); } diff --git a/src/gui/dialogs/qfscompleter_p.h b/src/gui/dialogs/qfscompleter_p.h index 37d9c74..c65eeea 100644 --- a/src/gui/dialogs/qfscompleter_p.h +++ b/src/gui/dialogs/qfscompleter_p.h @@ -55,8 +55,9 @@ #include "qcompleter.h" #include <QtGui/qfilesystemmodel.h> - +QT_BEGIN_NAMESPACE #ifndef QT_NO_COMPLETER + /*! QCompleter that can deal with QFileSystemModel */ @@ -76,6 +77,6 @@ public: QFileSystemModel *sourceModel; }; #endif // QT_NO_COMPLETER - +QT_END_NAMESPACE #endif // QCOMPLETOR_P_H diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h index 9ef5347..6c24055 100644 --- a/src/gui/image/qpixmap.h +++ b/src/gui/image/qpixmap.h @@ -51,6 +51,10 @@ QT_BEGIN_HEADER +#if defined(Q_OS_SYMBIAN) +class CFbsBitmap; +#endif + QT_BEGIN_NAMESPACE QT_MODULE(Gui) @@ -59,13 +63,8 @@ class QImageWriter; class QColor; class QVariant; class QX11Info; - class QPixmapData; -#if defined(Q_OS_SYMBIAN) -class CFbsBitmap; -#endif - class Q_GUI_EXPORT QPixmap : public QPaintDevice { public: diff --git a/src/gui/kernel/qaction.h b/src/gui/kernel/qaction.h index dfa4933..3449acf 100644 --- a/src/gui/kernel/qaction.h +++ b/src/gui/kernel/qaction.h @@ -91,11 +91,10 @@ class Q_GUI_EXPORT QAction : public QObject public: enum MenuRole { NoRole, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole, AboutRole, PreferencesRole, QuitRole }; - enum SoftKeyRole { OptionsSoftKey, SelectSoftKey, BackSoftKey, NextSoftKey, PreviousSoftKey, - OkSoftKey, CancelSoftKey, EditSoftKey, ViewSoftKey, BackSpaceSoftKey, - EndEditSoftKey, RevertEditSoftKey, DeselectSoftKey, FinishSoftKey, - MenuSoftKey, ContextMenuSoftKey, ExitSoftKey, Key1SoftKey, Key2SoftKey, - Key3SoftKey, Key4SoftKey, CustomSoftKey }; + enum SoftKeyRole { OptionsSoftKey, SelectSoftKey, BackSoftKey, NextSoftKey, PreviousSoftKey, + OkSoftKey, CancelSoftKey, EditSoftKey, ViewSoftKey, BackSpaceSoftKey, + EndEditSoftKey, RevertEditSoftKey, DeselectSoftKey, FinishSoftKey, + MenuSoftKey, ContextMenuSoftKey, ExitSoftKey }; explicit QAction(QObject* parent); QAction(const QString &text, QObject* parent); QAction(const QIcon &icon, const QString &text, QObject* parent); diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 42faf98..b7561e4 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -343,7 +343,7 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons QMouseEvent mEvent(QEvent::MouseButtonPress, alienWidget->mapFrom(qwidget, widgetPos), globalPos, Qt::RightButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier); sendMouseEvent(alienWidget, &mEvent); - m_previousEventLongTap = false; + m_previousEventLongTap = true; } void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent) @@ -821,18 +821,20 @@ void QApplicationPrivate::openPopup(QWidget *popup) WId id = popup->effectiveWinId(); id->SetPointerCapture(true); id->SetGloballyCapturing(true); - autoGrabWindow = id; } // popups are not focus-handled by the window system (the first // popup grabbed the keyboard), so we have to do that manually: A // new popup gets the focus - if (popup->focusWidget()) { - popup->focusWidget()->setFocus(Qt::PopupFocusReason); + if (QApplication::focusWidget()) + static_cast<QSymbianControl*>(QApplication::focusWidget()->effectiveWinId())->CancelLongTapTimer(); + QWidget *fw = popup->focusWidget(); + if (fw) { + fw->setFocus(Qt::PopupFocusReason); } else if (QApplicationPrivate::popupWidgets->count() == 1) { // this was the first popup - if (QWidget *fw = QApplication::focusWidget()) { - static_cast<QSymbianControl*>(fw->effectiveWinId())->CancelLongTapTimer(); + fw = QApplication::focusWidget(); + if (fw) { QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason); q_func()->sendEvent(fw, &e); } diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index bc69d6d..6109f17 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -85,29 +85,62 @@ void QWidgetPrivate::setSoftKeys_sys(const QList<QAction*> &softkeys) if (isEqual(old, softkeys )) return; } - CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); - CAknAppUi* aknAppUi = static_cast <CAknAppUi*>(appui); - CEikButtonGroupContainer* nativeContainer = aknAppUi->Cba(); + CEikButtonGroupContainer* nativeContainer = S60->buttonGroupContainer(); nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); - int placeInScreen=0; + int position = -1; + int command; + bool needsExitButton = true; + for (int index = 0; index < softkeys.count(); index++) { const QAction* softKeyAction = softkeys.at(index); - if (softKeyAction->softKeyRole() != QAction::ContextMenuSoftKey) { + switch (softKeyAction->softKeyRole()) { + // Positive Actions go on LSK + case QAction::OptionsSoftKey: + case QAction::MenuSoftKey: + case QAction::ContextMenuSoftKey: + command = EAknSoftkeyOptions; //Calls DynInitMenuPane in AppUI + position = 0; + break; + case QAction::SelectSoftKey: + case QAction::PreviousSoftKey: + case QAction::OkSoftKey: + case QAction::EditSoftKey: + case QAction::ViewSoftKey: + case QAction::EndEditSoftKey: + case QAction::FinishSoftKey: + command = SOFTKEYSTART + index; + position = 0; + break; + // Negative Actions on the RSK + case QAction::BackSoftKey: + case QAction::NextSoftKey: + case QAction::CancelSoftKey: + case QAction::BackSpaceSoftKey: + case QAction::RevertEditSoftKey: + case QAction::DeselectSoftKey: + needsExitButton = false; + command = SOFTKEYSTART + index; + position = 2; + break; + case QAction::ExitSoftKey: + needsExitButton = false; + command = EAknSoftkeyExit; //Calls HandleCommand in AppUI + position = 2; + break; + default: + break; + } - HBufC* text = qt_QString2HBufC(softKeyAction->text()); - CleanupStack::PushL(text); - if (softKeyAction->softKeyRole() == QAction::MenuSoftKey) { - nativeContainer->SetCommandL(placeInScreen, EAknSoftkeyOptions, *text); - } else { - nativeContainer->SetCommandL(placeInScreen, SOFTKEYSTART + index, *text); - } - CleanupStack::PopAndDestroy(); - placeInScreen++; + if (position != -1) { + TPtrC text = qt_QString2TPtrC(softKeyAction->text()); + nativeContainer->SetCommandL(position, command, text); } - if (placeInScreen==1) - placeInScreen=2; } + + if (needsExitButton) + nativeContainer->SetCommandL(2, EAknSoftkeyExit, qt_QString2TPtrC(QObject::tr("Exit"))); + nativeContainer->DrawDeferred(); // 3.1 needs an extra invitation } diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 5f8371c..394523a 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -482,7 +482,7 @@ void QMainWindow::setMenuBar(QMenuBar *menuBar) } d->layout->setMenuBar(menuBar); if (menuBar) { - QAction* menu = new QAction(QString::fromLatin1("Menu"), this); + QAction* menu = new QAction(QString::fromLatin1("Options"), this); menu->setSoftKeyRole(QAction::MenuSoftKey); setSoftKey(menu); } @@ -1400,7 +1400,7 @@ bool QMainWindow::event(QEvent *event) 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); + QAction* menu = new QAction(QString::fromLatin1("Options"), this); menu->setSoftKeyRole(QAction::MenuSoftKey); setSoftKey(menu); } |