From 85e940d2fa5e8d2caf0d157f214bb826fc392e7b Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Wed, 20 May 2009 09:20:09 +0200 Subject: Removed accidental allocation in QRingBuffer::clear() --- src/corelib/tools/qringbuffer_p.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h index 3a0901d..99c89f8 100644 --- a/src/corelib/tools/qringbuffer_p.h +++ b/src/corelib/tools/qringbuffer_p.h @@ -62,8 +62,10 @@ class Q_CORE_EXPORT QRingBuffer { public: inline QRingBuffer(int growth = 4096) : basicBlockSize(growth) { + head = tail = 0; + tailBuffer = 0; + bufferSize = 0; buffers << QByteArray(); - clear(); } inline int nextDataBlockSize() const { @@ -104,8 +106,12 @@ public: } inline char *reserve(int bytes) { + if (isEmpty()) { + buffers[tailBuffer].resize(qMax(basicBlockSize, bytes)); + bufferSize = tail = bytes; + return buffers[tailBuffer].data(); + } bufferSize += bytes; - // if there is already enough space, simply return. if (tail + bytes <= buffers.at(tailBuffer).size()) { char *writePtr = buffers[tailBuffer].data() + tail; @@ -198,7 +204,7 @@ public: } inline void clear() { - if(!buffers.isEmpty()) { + if(!isEmpty()) { QByteArray tmp = buffers[0]; buffers.clear(); buffers << tmp; -- cgit v0.12 From 7442925bd3a88a15ac0db0dce9bb5d7a3aa6e622 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 17 Jun 2009 12:10:06 +0300 Subject: Added proper UID for webkit examples and browser demo --- demos/browser/browser.pro | 2 ++ examples/webkit/fancybrowser/fancybrowser.pro | 2 ++ examples/webkit/formextractor/formextractor.pro | 2 ++ examples/webkit/googlechat/googlechat.pro | 2 ++ examples/webkit/previewer/previewer.pro | 2 ++ 5 files changed, 10 insertions(+) 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/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 -- cgit v0.12 From 31f97fae841b31e846e7f8754e84320f5925bff5 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 17 Jun 2009 12:48:32 +0200 Subject: Readded code that was lost during exception integration. AutoTest: Passed RevBy: Trust me --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 423fbaa..c0b9e02 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; -- cgit v0.12 From e601e40bcae0baee92793c0ec1222ddf9e51607b Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 17 Jun 2009 12:49:25 +0200 Subject: Fixed indentation. --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index c0b9e02..17bb9a7 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -647,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; @@ -722,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(); -- cgit v0.12 From 46de9152fcd2a8ca28ffd1e37c6566aced47f35b Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 17 Jun 2009 15:23:38 +0300 Subject: Removed incorrect Carbide version from compiler patching instructions. --- doc/src/installation.qdoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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}. -- cgit v0.12 From 2ede08bce669ddb68070ec1344a51b97ddc945d2 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Wed, 17 Jun 2009 15:42:12 +0200 Subject: Revert "Removed accidental allocation in QRingBuffer::clear()" This reverts commit 85e940d2fa5e8d2caf0d157f214bb826fc392e7b. --- src/corelib/tools/qringbuffer_p.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h index d4d0af7..a1bfab0 100644 --- a/src/corelib/tools/qringbuffer_p.h +++ b/src/corelib/tools/qringbuffer_p.h @@ -62,10 +62,8 @@ class Q_CORE_EXPORT QRingBuffer { public: inline QRingBuffer(int growth = 4096) : basicBlockSize(growth) { - head = tail = 0; - tailBuffer = 0; - bufferSize = 0; buffers << QByteArray(); + clear(); } inline int nextDataBlockSize() const { @@ -106,12 +104,8 @@ public: } inline char *reserve(int bytes) { - if (isEmpty()) { - buffers[tailBuffer].resize(qMax(basicBlockSize, bytes)); - bufferSize = tail = bytes; - return buffers[tailBuffer].data(); - } bufferSize += bytes; + // if there is already enough space, simply return. if (tail + bytes <= buffers.at(tailBuffer).size()) { char *writePtr = buffers[tailBuffer].data() + tail; @@ -204,7 +198,7 @@ public: } inline void clear() { - if(!isEmpty()) { + if(!buffers.isEmpty()) { QByteArray tmp = buffers[0]; buffers.clear(); buffers << tmp; -- cgit v0.12 From 75140c4776934744c37a34b10b7d4b8665aa4dc1 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Wed, 17 Jun 2009 15:50:16 +0200 Subject: longtap event gets properly cancelled when entering popup --- src/gui/kernel/qapplication_s60.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 4c008fb..9a2bbe6 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,21 @@ 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(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(fw->effectiveWinId())->CancelLongTapTimer(); + fw = QApplication::focusWidget(); + if (fw) { +// static_cast(fw->effectiveWinId())->CancelLongTapTimer(); QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason); q_func()->sendEvent(fw, &e); } -- cgit v0.12 From 86b28b0bf7ddd278f1b878db0b5961762e9272b2 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Wed, 17 Jun 2009 15:54:02 +0200 Subject: namespace fixes. s60main and corelib now compiles under a namespace --- src/corelib/global/qglobal.h | 5 +++-- src/corelib/tools/qlocale_symbian.cpp | 5 +++-- src/gui/image/qpixmap.h | 9 ++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 361c038..6e9250f 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -795,6 +795,9 @@ namespace QT_NAMESPACE {} # define Q_WS_WIN #endif +// forward declare std::exception +namespace std { class exception; } + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -2315,8 +2318,6 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); #if defined(Q_OS_SYMBIAN) -// forward declare std::exception -namespace std { class exception; } Q_CORE_EXPORT void qt_translateSymbianErrorToException(int error); Q_CORE_EXPORT void qt_translateExceptionToSymbianErrorL(const std::exception& ex); 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 #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/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: -- cgit v0.12 From 87ac26f0c489911d9a43bab04aef03cadbe8bbe6 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Wed, 17 Jun 2009 16:03:22 +0200 Subject: removed commented code --- src/gui/kernel/qapplication_s60.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 3bd6e6b..b7561e4 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -835,7 +835,6 @@ void QApplicationPrivate::openPopup(QWidget *popup) } else if (QApplicationPrivate::popupWidgets->count() == 1) { // this was the first popup fw = QApplication::focusWidget(); if (fw) { -// static_cast(fw->effectiveWinId())->CancelLongTapTimer(); QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason); q_func()->sendEvent(fw, &e); } -- cgit v0.12 From 30525b802f17c2c815f02d81a1c771b8cee71458 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 17 Jun 2009 16:38:41 +0200 Subject: Improve softkey implementation and add a default 'Exit' button to RSK. The previous implementation had some problems where the actual position of the softkey was determined by it's position in the list. This is suboptimal since the position should be tied to the role. Actions that have "negative" conotation should be located on the right soft key (RSK) while "positive" actions go on the left soft key (LSK). This is according to the S60 User Interface Guide. It is also standard practice in S60 to have an 'Exit' button on the RSK so we add one of those if there is not already a key present there. Task-number: 256365 Reviewed-by: Markku Luukkainen --- src/gui/kernel/qaction.h | 9 +++--- src/gui/kernel/qwidget_s60.cpp | 65 +++++++++++++++++++++++++++++++----------- 2 files changed, 53 insertions(+), 21 deletions(-) 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/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 &softkeys) if (isEqual(old, softkeys )) return; } - CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); - CAknAppUi* aknAppUi = static_cast (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 } -- cgit v0.12 From 4a5a9b23f41afb062fae4aaab429fcef35b3d42c Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 17 Jun 2009 16:40:46 +0200 Subject: added changes done to tower --- dist/changes-4.5.2-tower | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.5.2-tower b/dist/changes-4.5.2-tower index 41dc8c8..9d28465 100644 --- a/dist/changes-4.5.2-tower +++ b/dist/changes-4.5.2-tower @@ -198,6 +198,13 @@ Optimizations * Fixed active scheduler removal when calling QThread::terminate * 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 + **************************************************************************** * Examples and demos * @@ -224,12 +231,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 +269,7 @@ Optimizations * Will now patch also vendor id. **************************************************************************** -* Documnetation * +* Documentation * **************************************************************************** - qmake-manual * 250370: Added documentation for ICON keyword -- cgit v0.12 From bb0be7961f66b8d351c39d61fc0ab3f38d032223 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 17 Jun 2009 16:55:11 +0200 Subject: Renamed "menu" to "options" for S60. This follows the native style --- src/gui/widgets/qmainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } -- cgit v0.12 From 1ec7f4029a47d22f7585c554d32ae975946ab3ce Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 17 Jun 2009 17:24:37 +0200 Subject: aportales changes for Qt for S60 "Tower" --- dist/changes-4.5.2-tower | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dist/changes-4.5.2-tower b/dist/changes-4.5.2-tower index 9d28465..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, @@ -198,13 +205,21 @@ Optimizations * Fixed active scheduler removal when calling QThread::terminate * 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 * -- cgit v0.12 From f59bc255922730bcee7b594d04fea28b278cee7c Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Wed, 17 Jun 2009 17:36:46 +0200 Subject: make qglobal.h compile when inlcuded from c-files --- src/corelib/global/qglobal.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 6e9250f..14b6895 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -795,9 +795,6 @@ namespace QT_NAMESPACE {} # define Q_WS_WIN #endif -// forward declare std::exception -namespace std { class exception; } - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -2317,8 +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); -- cgit v0.12 From 4dcd6946fdc6940388b2ba573650143b9469d532 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Wed, 17 Jun 2009 17:59:11 +0200 Subject: added namespace guards --- src/gui/dialogs/qfscompleter_p.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 - +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 -- cgit v0.12 From 2b09eb0937985015e1ecc42a8bd39f0bc4c84b17 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Thu, 18 Jun 2009 09:36:33 +0300 Subject: Fixed FTP default IAP setting. Accidentaly reverted by ce409be66. It is important to close the RConnection before calling setdefaultif. This because setdefaultif triesd to open the connection, and if it is already open it may fail. --- examples/network/ftp/main.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/network/ftp/main.cpp b/examples/network/ftp/main.cpp index 118dcfc..17423b8 100644 --- a/examples/network/ftp/main.cpp +++ b/examples/network/ftp/main.cpp @@ -112,15 +112,14 @@ static void setDefaultIapL() { User::LeaveIfError(conn.GetDesSetting(TPtrC(KIapNameSetting), iap8Name)); iap8Name.ZeroTerminate(); + conn.Stop(); + CleanupStack::PopAndDestroy(&conn); + CleanupStack::PopAndDestroy(&serv); + struct ifreq ifReq; strcpy( ifReq.ifr_name, (char*)iap8Name.Ptr()); User::LeaveIfError(setdefaultif( &ifReq )); - conn.Stop(); - conn.Close(); - serv.Close(); - CleanupStack::PopAndDestroy(&conn); - CleanupStack::PopAndDestroy(&serv); } monitor.Close(); CleanupStack::PopAndDestroy(&monitor); -- cgit v0.12 From 553a0a8fb83b8ff82574e9b0831ba56d0fd93054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Thu, 18 Jun 2009 14:34:11 +0300 Subject: S60Style: Palette has gets cleared when setting themePalette. --- src/gui/styles/qs60style.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index d2bd679..b80adc2 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -478,7 +478,9 @@ void QS60StylePrivate::setThemePalette(QApplication *app) const Q_UNUSED(app) QPalette widgetPalette = QPalette(Qt::white); setThemePalette(&widgetPalette); - QApplication::setPalette(widgetPalette); + QApplication::setPalette(widgetPalette); //calling QApplication::setPalette clears palette hash + setThemePaletteHash(&widgetPalette); + storeThemePalette(&widgetPalette); } void QS60StylePrivate::setThemePalette(QStyleOption *option) const @@ -664,7 +666,7 @@ void QS60StylePrivate::setThemePalette(QWidget *widget) const { if(!widget) return; - QPalette widgetPalette = widget->palette(); + QPalette widgetPalette = QApplication::palette(widget); //header view and its viewport need to be set 100% transparent button color, since drawing code will //draw transparent theme graphics to table column and row headers. @@ -716,9 +718,6 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const palette->setColor(QPalette::Midlight, palette->color(QPalette::Button).lighter(125)); palette->setColor(QPalette::Mid, palette->color(QPalette::Button).darker(150)); palette->setColor(QPalette::Shadow, Qt::black); - - setThemePaletteHash(palette); - storeThemePalette(palette); } void QS60StylePrivate::deleteThemePalette() @@ -791,6 +790,18 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const QApplication::setPalette(widgetPalette, "QLineEdit"); widgetPalette = *palette; + widgetPalette.setColor(QPalette::All, QPalette::Text, + s60Color(QS60StyleEnums::CL_QsnTextColors, 34, 0)); + widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, + s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); + QApplication::setPalette(widgetPalette, "QTextEdit"); + widgetPalette = *palette; + + widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, + s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); + QApplication::setPalette(widgetPalette, "QComboBox"); + widgetPalette = *palette; + widgetPalette.setColor(QPalette::WindowText, mainAreaTextColor); widgetPalette.setColor(QPalette::Button, QApplication::palette().color(QPalette::Button)); widgetPalette.setColor(QPalette::Dark, mainAreaTextColor.darker()); @@ -1662,7 +1673,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_MenuItem: if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast(option)) { QStyleOptionMenuItem optionMenuItem = *menuItem; - + bool drawSubMenuIndicator = false; switch(menuItem->menuItemType) { case QStyleOptionMenuItem::Scroller: -- cgit v0.12