From c24d4cb9eca0b06f411bc99be3d232ff1ee27516 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 10 Jun 2009 14:39:47 +0200 Subject: Changed to use proper conversion from qstring to hbuf --- src/gui/kernel/qwidget_s60.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index eb3180f..bc69d6d 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -95,7 +95,7 @@ void QWidgetPrivate::setSoftKeys_sys(const QList &softkeys) const QAction* softKeyAction = softkeys.at(index); if (softKeyAction->softKeyRole() != QAction::ContextMenuSoftKey) { - HBufC* text = qt_QString2HBufCNewL(softKeyAction->text()); + HBufC* text = qt_QString2HBufC(softKeyAction->text()); CleanupStack::PushL(text); if (softKeyAction->softKeyRole() == QAction::MenuSoftKey) { nativeContainer->SetCommandL(placeInScreen, EAknSoftkeyOptions, *text); -- cgit v0.12 From 959ff46310b8a27c82ef6b0c1d122b817270f8d9 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 10 Jun 2009 13:28:40 +0200 Subject: Revert "Fix to qapplication::setActiveWindow autotest case in Symbian." This reverts commit ba105741867dd96a9d58dcfcb78afef60e611bd6. --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 1dfb012..24abb58 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -43,7 +43,6 @@ #include "qcoefepinputcontext_p.h" #include -#include #include #include @@ -90,12 +89,9 @@ QCoeFepInputContext::~QCoeFepInputContext() // This is to make sure that the FEP manager "forgets" about us, // otherwise we may get callbacks even after we're destroyed. // The call is asynchronous though, so we must spin the event loop - // to make sure it gets detected. However we will not spin eventloop - // in case that app is closing, since eventDispatcher is already deleted. + // to make sure it gets detected. CCoeEnv::Static()->InputCapabilitiesChanged(); - if(!QApplicationPrivate::is_app_closing) { - QApplication::processEvents(); - } + QApplication::processEvents(); if (m_fepState) delete m_fepState; -- cgit v0.12 From 8ce6f4b96623d03031c65f396b6789520f114edc Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 10 Jun 2009 15:04:51 +0200 Subject: Fixed FEP crash during application exit. We use a synchronous call rather than an asynchronous one, so we don't risk the pointer being dereferenced after destruction is finished. --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 24abb58..b183e1b 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -88,10 +88,9 @@ QCoeFepInputContext::~QCoeFepInputContext() // This is to make sure that the FEP manager "forgets" about us, // otherwise we may get callbacks even after we're destroyed. - // The call is asynchronous though, so we must spin the event loop - // to make sure it gets detected. - CCoeEnv::Static()->InputCapabilitiesChanged(); - QApplication::processEvents(); + // The call below is essentially equivalent to InputCapabilitiesChanged(), + // but is synchronous, rather than asynchronous. + CCoeEnv::Static()->SyncNotifyFocusObserversOfChangeInFocus(); if (m_fepState) delete m_fepState; -- cgit v0.12 From a293cab198f51ca8920c3da1b671f51b26a9cb4a Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Wed, 10 Jun 2009 14:36:58 +0200 Subject: Build fix for GCCE. I believe all auto tests for GCCE were previously failing because of this. Reviewed-by: Brad --- src/corelib/tools/qlist.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 89e082b..7540035 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -117,7 +117,14 @@ public: inline int size() const { return p.size(); } inline void detach() { if (d->ref != 1) detach_helper(); } - inline void detachShared() { if (d->ref != 1 && d != &QListData::shared_null) detach_helper(); } + + inline void detachShared() + { + // The "this->" qualification is needed for GCCE. + if (d->ref != 1 && this->d != &QListData::shared_null) + detach_helper(); + } + inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } -- cgit v0.12 From 07c2b197b294043893ff792c851f5833736e41e3 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 10 Jun 2009 15:32:13 +0200 Subject: doc: document the Symbian exception helpers --- src/corelib/global/qglobal.cpp | 97 ++++++++++++++++++++++++++++++++++++++++-- src/corelib/global/qglobal.h | 3 +- 2 files changed, 95 insertions(+), 5 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 484c618..32c9139 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -3214,14 +3214,85 @@ bool QInternal::callFunction(InternalFunction func, void **args) #include -const char* QSymbianLeaveException::what() const throw() +/*! \macro QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(function) + \relates QSymbianLeaveException + + TRAP leaves from Symbian \a function and throws an appropriate + standard C++ exception instead. + This must be used when calling Symbian OS leaving functions + from inside Qt or standard C++ code, so that the code can respond + correctly to the exception. + + \warning This macro is only available on Symbian. + + \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE() +*/ + +/*! \macro QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(error, function) + \relates QSymbianLeaveException + \ingroup qts60 + + Catch standard C++ exceptions from a \a function and convert them to a Symbian OS + \a error code, or \c KErrNone if there is no exception. + This must be used inside Qt or standard C++ code when using exception throwing + code (practically anything) and returning an error code to Symbian OS. + + \warning This macro is only available on Symbian. + + \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(), QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION() +*/ + +/*! \macro QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(function) + \relates QSymbianLeaveException + \ingroup qts60 + + Catch standard C++ exceptions from \a function and convert them to Symbian OS + leaves. This must be used inside Qt or standard C++ code when using exception + throwing code (practically anything) and returning to Symbian OS from a leaving function. + For example inside a Symbian active object's \c RunL function implemented with Qt code. + + \warning This macro is only available on Symbian. + + \sa QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR() +*/ + +/*! \class QSymbianLeaveException + \ingroup qts60 + \brief Exception class representing a Symbian leave code. + + \warning This class is only available on Symbian. +*/ + +/*! \fn QSymbianLeaveException::QSymbianLeaveException(int error) + + Constructs a QSymbianLeaveException object that stores the given + Symbian \a error code. +*/ + +/*! \fn const char *QSymbianLeaveException::what() const + + Returns a C-style character string describing the general + cause of the current error. + + The string is not localized. +*/ +const char *QSymbianLeaveException::what() const throw() { - static const char str[] = "Symbian leave exception %d"; - static char msg[sizeof(str)+12]; - sprintf(msg, str, error); + static char msg[36]; + snprintf(msg, sizeof(msg), "Symbian leave exception %d", error); return msg; } +/*! \relates QSymbianLeaveException + \ingroup qts60 + + Throws a QSymbianLeaveException if the \a error parameter is a symbian error code. + This is the exception throwing equivalent of Symbian's User::LeaveIfError. + + \warning This function is only available on Symbian. + + \sa qt_translateExceptionToSymbianErrorL(), qt_translateExceptionToSymbianError() +*/ void qt_translateSymbianErrorToException(int error) { if (error >= KErrNone) @@ -3234,11 +3305,29 @@ void qt_translateSymbianErrorToException(int error) } } +/*! \relates QSymbianLeaveException + \ingroup qts60 + + Convert a caught standard C++ exception \a aThrow to a Symbian leave + + \warning This function is only available on Symbian. + + \sa qt_translateSymbianErrorToException(), qt_translateExceptionToSymbianError() +*/ void qt_translateExceptionToSymbianErrorL(const std::exception& aThrow) { User::Leave(qt_translateExceptionToSymbianError(aThrow)); } +/*! \relates QSymbianLeaveException + \ingroup qts60 + + Convert a caught standard C++ exception \a aThrow to a Symbian error code + + \warning This function is only available on Symbian. + + \sa qt_translateSymbianErrorToException(), qt_translateExceptionToSymbianErrorL() +*/ int qt_translateExceptionToSymbianError(const std::exception& aThrow) { const std::type_info& atype = typeid(aThrow); diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 030840e..3d441e3 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -2468,10 +2468,11 @@ QT_LICENSED_MODULE(DBus) #if defined(Q_OS_SYMBIAN) #include + class QSymbianLeaveException : public std::exception { public: - QSymbianLeaveException(int err) : error(err){ } + inline QSymbianLeaveException(int err) : error(err) {} const char* what() const throw(); public: int error; -- cgit v0.12 From 03a86003bc5bd05f0cbfe1c2274f517a175d1ffe Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 10 Jun 2009 15:38:32 +0200 Subject: add some preliminary exception safety documentation --- doc/src/exceptionsafety.qdoc | 144 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 doc/src/exceptionsafety.qdoc diff --git a/doc/src/exceptionsafety.qdoc b/doc/src/exceptionsafety.qdoc new file mode 100644 index 0000000..4e3e89e --- /dev/null +++ b/doc/src/exceptionsafety.qdoc @@ -0,0 +1,144 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page exceptionsafety.html + \title Exception Safety + \ingroup architecture + \brief A guide to exception safety in Qt. + + \bold {Preliminary warning}: Exception safety is not feature complete! + Common cases should work, but classes might still leak or even crash. + + Qt itself will not throw exceptions. Instead, error codes are used. + In addition, some classes have user visible error messages, for example + \l QIODevice::errorString() or \l QSqlQuery::lastError(). + This has historical and practical reasons - turning on exceptions + can increase the library size by over 20%. + + The following sections describe Qt's behavior if exception support is + enabled at compile time. + + \tableofcontents + + \section1 Exception safe modules + + \section2 Containers + + Qt's \l{container classes} are generally exception neutral. They pass any + exception that happens within their contained type \c T to the user + while keeping their internal state valid. + + Example: + + \code + QList list; + ... + try { + list.append("hello"); + } catch (...) { + } + // list is safe to use - the exception did not affect it. + \endcode + + Exceptions to that rule are containers for types that can throw during assignment + or copy constructions. For those types, functions that modify the container as well as + returning a value, are unsafe to use: + + \code + MyType s = list.takeAt(2); + \endcode + + If an exception occurs during the assignment of \c s, the value at index 2 is already + removed from the container, but hasn't been assigned to \c s yet. It is lost + without chance of recovery. + + The correct way to write it: + + \code + MyType s = list.at(2); + list.removeAt(2); + \endcode + + If the assignment throws, the container still contains the value, no data loss occured. + + Note that implicitly shared Qt classes will not throw in their assignment + operators or copy constructors, so the limitation above does not apply. + + \section1 Out of memory handling + + Most desktop operating systems overcommit memory. This means that \c malloc() + or \c{operator new} return a valid pointer, even though there is not enough + memory available at allocation time. On such systems, no exception of type + \c std::bad_alloc is thrown. + + On all other operating systems, Qt will throw an exception of type std::bad_alloc + if any allocation fails. Allocations can fail if the system runs out of memory or + doesn't have enough continuous memory to allocate the requested size. + + Exceptions to that rule are documented. As an example, \l QImage::create() + returns false if not enough memory exists instead of throwing an exception. + + \section1 Recovering from exceptions + + Currently, the only supported use case for recovering from exceptions thrown + within Qt (for example due to out of memory) is to exit the event loop and do + some cleanup before exiting the application. + + Typical use case: + + \code + QApplication app(argc, argv); + ... + try { + app.exec(); + } catch (const std::bad_alloc &) { + // clean up here, e.g. save the session + // and close all config files. + + return 0; // exit the application + } + \endcode + + After an exception is thrown, the connection to the windowing server + might already be closed. It is not safe to call a GUI related function + after catching an exception. +*/ -- cgit v0.12 From fa57db3b5c1662430802f8a963b7dff2c83c300b Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 10 Jun 2009 16:11:31 +0200 Subject: add Symbian platform notes --- doc/src/platform-notes.qdoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/src/platform-notes.qdoc b/doc/src/platform-notes.qdoc index c8046c4..63b721a 100644 --- a/doc/src/platform-notes.qdoc +++ b/doc/src/platform-notes.qdoc @@ -512,6 +512,19 @@ */ /*! + \page platform-notes-symbian.html + \title Platform Notes - Symbian + \contentspage Platform Notes + + This page contains information about the Symbian platforms Qt is currently known + to run on. More information about the combinations of platforms and compilers + supported by Qt can be found on the \l{Supported Platforms} page. + + For information about mixing exceptions with symbian leaves, + see \l QSymbianLeaveException. +*/ + +/*! \page platform-notes-embedded-linux.html \title Platform Notes - Embedded Linux \contentspage Platform Notes -- cgit v0.12 From 0f1486d6f36d25a08a7b75dfd5fdfa36c2ad98d2 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 10 Jun 2009 16:14:51 +0200 Subject: doc: fix typo --- src/corelib/tools/qscopedpointer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp index 8150a18..f34aec8 100644 --- a/src/corelib/tools/qscopedpointer.cpp +++ b/src/corelib/tools/qscopedpointer.cpp @@ -112,7 +112,7 @@ /*! \fn void QScopedPointer::reset(T *other = 0) - Deletes the existing object its pointing to if any, and sets its pointer to + Deletes the existing object it is pointing to if any, and sets its pointer to \a other. QScopedPointer now owns \a other and will delete it in its destructor. -- cgit v0.12 From 57c434c3fdf53e99b88646496e154708b3c141f5 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 10 Jun 2009 16:29:47 +0200 Subject: doc: added code examples --- src/corelib/global/qglobal.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 32c9139..e493831 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -3225,6 +3225,18 @@ bool QInternal::callFunction(InternalFunction func, void **args) \warning This macro is only available on Symbian. + Example: + + \code + // A Symbian leaving function is being called within a Qt function. + // Any leave must be converted to an exception + CAknTitlePane* titlePane = S60->titlePane(); + if (titlePane) { + TPtrC captionPtr(qt_QString2TPtrC(caption)); + QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(titlePane->SetTextL(captionPtr)); + } + \endcode + \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE() */ @@ -3239,6 +3251,23 @@ bool QInternal::callFunction(InternalFunction func, void **args) \warning This macro is only available on Symbian. + Example: + + \code + // An exception might be thrown in this Symbian TInt error returning function. + // It is caught and translated to an error code + TInt QServerApp::Connect(const QString &serverName) + { + TPtrC name; + TInt err; + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, name.Set(qt_QString2TPtrC(serverName))); + if (err != KErrNone) + return err; + return iServer.Connect(name); + } + \endcode +} + \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(), QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION() */ @@ -3253,6 +3282,19 @@ bool QInternal::callFunction(InternalFunction func, void **args) \warning This macro is only available on Symbian. + Example: + + \code + // This active object signals Qt code + // Exceptions from the Qt code must be converted to Symbian OS leaves for the active scheduler + void QWakeUpActiveObject::RunL() + { + iStatus = KRequestPending; + SetActive(); + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->wakeUpWasCalled()); + } + \endcode + \sa QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR() */ -- cgit v0.12 From 5fcc4febed6f88790d80f7869b647629f7e294af Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Wed, 10 Jun 2009 16:32:39 +0200 Subject: Shrink the emergency qWarning buffer to 256 bytes. Reviewed-by: Harald Fernengel --- src/corelib/global/qglobal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 32c9139..c1f1f24 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2207,10 +2207,10 @@ void qt_message_output(QtMsgType msgType, const char *buf) */ static void qEmergencyOut(QtMsgType msgType, const char *msg, va_list ap) { - char emergency_buf[1024] = { '\0' }; - emergency_buf[1023] = '\0'; + char emergency_buf[256] = { '\0' }; + emergency_buf[255] = '\0'; if (msg) - qvsnprintf(emergency_buf, 1023, msg, ap); + qvsnprintf(emergency_buf, 255, msg, ap); qt_message_output(msgType, emergency_buf); } #endif -- cgit v0.12 From d5f6ac0e25ddf84c908965eb5de68fe84cf897f3 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 10 Jun 2009 17:08:46 +0200 Subject: Changed the openssl include path to use platform_paths.prf. RevBy: Miikka Heikkinen --- src/network/ssl/ssl.pri | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri index 5427370..dd7b917 100644 --- a/src/network/ssl/ssl.pri +++ b/src/network/ssl/ssl.pri @@ -3,11 +3,7 @@ contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) { symbian { - TRY_INCLUDEPATHS = $${EPOCROOT}epoc32/include $${EPOCROOT}epoc32/include/stdapis $${EPOCROOT}epoc32/include/stdapis/sys $$OS_LAYER_LIBC_SYSTEMINCLUDE - for(p, TRY_INCLUDEPATHS) { - pp = $$join(p, "", "", "/openssl") - exists($$pp):INCLUDEPATH *= $$pp - } + exists($${EPOCROOT}$$OS_LAYER_SSL_SYSTEMINCLUDE):INCLUDEPATH *= $$OS_LAYER_SSL_SYSTEMINCLUDE } else { include($$QT_SOURCE_TREE/config.tests/unix/openssl/openssl.pri) } -- cgit v0.12 From b487ec78791b08d9a6568f4b0ab7c0479b5124a2 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 11 Jun 2009 13:15:41 +0200 Subject: Doc: Moved the definition of QSymbianLeaveException and fixed the brief description. Reviewed-by: Trust Me --- src/corelib/global/qglobal.cpp | 2 +- src/corelib/global/qglobal.h | 90 ++++++++++++++++++++++-------------------- 2 files changed, 48 insertions(+), 44 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 32c9139..a828e84 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -3258,7 +3258,7 @@ bool QInternal::callFunction(InternalFunction func, void **args) /*! \class QSymbianLeaveException \ingroup qts60 - \brief Exception class representing a Symbian leave code. + \brief The QSymbianLeaveException class represents a block of Symbian leave code. \warning This class is only available on Symbian. */ diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 3d441e3..450fd86 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -2310,6 +2310,50 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathTranslations(); QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); #endif +#if defined(Q_OS_SYMBIAN) + +#include + +class QSymbianLeaveException : public std::exception +{ +public: + inline QSymbianLeaveException(int err) : error(err) {} + const char* what() const throw(); +public: + int error; +}; + +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); + +#define QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(f) \ + { \ + TInt error; \ + TRAP(error, f); \ + if (error) \ + qt_translateSymbianErrorToException(error); \ + } + +#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \ + { \ + err = KErrNone; \ + try { \ + f; \ + } catch (const std::exception &ex) { \ + err = qt_translateExceptionToSymbianError(ex); \ + } \ + } + +#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(f) \ + { \ + TInt err; \ + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \ + User::LeaveIfError(err); \ + } +#endif + + /* This gives us the possibility to check which modules the user can use. These are purely compile time checks and will generate no code. @@ -2383,6 +2427,9 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); #define QT_LICENSED_MODULE(x) \ enum QtValidLicenseFor##x##Module { Licensed##x = true }; +/* qdoc is really unhappy with the following block of preprocessor checks, + making it difficult to document classes properly after this point. */ + #if (QT_EDITION & QT_MODULE_CORE) QT_LICENSED_MODULE(Core) #endif @@ -2465,49 +2512,6 @@ QT_LICENSED_MODULE(DBus) # define QT_NO_CONCURRENT_FILTER #endif -#if defined(Q_OS_SYMBIAN) - -#include - -class QSymbianLeaveException : public std::exception -{ -public: - inline QSymbianLeaveException(int err) : error(err) {} - const char* what() const throw(); -public: - int error; -}; - -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); - -#define QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(f) \ - { \ - TInt error; \ - TRAP(error, f); \ - if (error) \ - qt_translateSymbianErrorToException(error); \ - } - -#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \ - { \ - err = KErrNone; \ - try { \ - f; \ - } catch (const std::exception &ex) { \ - err = qt_translateExceptionToSymbianError(ex); \ - } \ - } - -#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(f) \ - { \ - TInt err; \ - QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \ - User::LeaveIfError(err); \ - } -#endif - QT_END_NAMESPACE QT_END_HEADER -- cgit v0.12 From 92c979126ea9d0217ceddb05b7909c12f47dc504 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Thu, 11 Jun 2009 13:09:54 +0200 Subject: Newer version of GCC only recognized __func__ (as a static function). Reviewed-by: aportale --- src/gui/styles/qs60style_simulated.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 7667f92..ff70e0a 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -61,13 +61,20 @@ QT_BEGIN_NAMESPACE static const quint32 blobVersion = 1; static const int pictureSize = 256; +#if defined(Q_CC_GNU) +#if __GNUC__ >= 2 +#define __FUNCTION__ __func__ +#endif +#endif + + bool saveThemeToBlob(const QString &themeBlob, const QHash &partPictures, const QHash, QColor> &colors) { QFile blob(themeBlob); if (!blob.open(QIODevice::WriteOnly)) { - qWarning() << __FUNCTION__": Could not create blob: " << themeBlob; + qWarning() << __FUNCTION__ << ": Could not create blob: " << themeBlob; return false; } @@ -106,7 +113,7 @@ bool loadThemeFromBlob(const QString &themeBlob, { QFile blob(themeBlob); if (!blob.open(QIODevice::ReadOnly)) { - qWarning() << __FUNCTION__": Could not read blob: " << themeBlob; + qWarning() << __FUNCTION__ << ": Could not read blob: " << themeBlob; return false; } QDataStream blobIn(&blob); @@ -115,7 +122,7 @@ bool loadThemeFromBlob(const QString &themeBlob, blobIn >> version; if (version != blobVersion) { - qWarning() << __FUNCTION__": Invalid blob version: " << version << " ...expected: " << blobVersion; + qWarning() << __FUNCTION__ << ": Invalid blob version: " << version << " ...expected: " << blobVersion; return false; } @@ -148,7 +155,7 @@ bool loadThemeFromBlob(const QString &themeBlob, } if (dataIn.status() != QDataStream::Ok) { - qWarning() << __FUNCTION__": Invalid data blob: " << themeBlob; + qWarning() << __FUNCTION__ << ": Invalid data blob: " << themeBlob; return false; } return true; -- cgit v0.12 From f2d29cf7cdc456e6507064a4f2d9bf33929da471 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Thu, 11 Jun 2009 13:10:39 +0200 Subject: Fix includes, append the .h suffix to the file names. Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 6ee63e6..8f7a61b 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -44,8 +44,8 @@ #include "qapplication.h" #include "qpainter.h" #include "qstyleoption.h" -#include "qresizeevent" -#include "qpixmapcache" +#include "qresizeevent.h" +#include "qpixmapcache.h" #include "qcalendarwidget.h" #include "qdial.h" -- cgit v0.12 From 0eff433bb3406943802e4fff30d4a892cd74a422 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Thu, 11 Jun 2009 13:34:07 +0200 Subject: Fix compile, include qdesktopwidget.h. Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style_simulated.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index ff70e0a..362e29c 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -53,6 +53,7 @@ #include "qmetaobject.h" #include "qdebug.h" #include "qbuffer.h" +#include "qdesktopwidget.h" #if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN) -- cgit v0.12 From 434563a6cd857c26d120c08a51742622d675cca0 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Thu, 11 Jun 2009 13:41:56 +0200 Subject: Correcting my previous patch, there is only qevent.h. Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 8f7a61b..0d003a6 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -44,7 +44,7 @@ #include "qapplication.h" #include "qpainter.h" #include "qstyleoption.h" -#include "qresizeevent.h" +#include "qevent.h" #include "qpixmapcache.h" #include "qcalendarwidget.h" -- cgit v0.12 From 82180781420acde96be0e464011ee187a2448541 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Thu, 11 Jun 2009 13:47:52 +0200 Subject: Fix include, it should be pulled from private directory. Reviewed-by: Markku Luukkainen --- src/gui/itemviews/qabstractitemview.cpp | 2 +- src/gui/widgets/qactiontokeyeventmapper.cpp | 2 +- src/gui/widgets/qcombobox.cpp | 2 +- src/gui/widgets/qmenu.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index af84ea6..2576724 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -61,7 +61,7 @@ #ifndef QT_NO_ACCESSIBILITY #include #endif -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/gui/widgets/qactiontokeyeventmapper.cpp b/src/gui/widgets/qactiontokeyeventmapper.cpp index 5cce415..280b1c6 100644 --- a/src/gui/widgets/qactiontokeyeventmapper.cpp +++ b/src/gui/widgets/qactiontokeyeventmapper.cpp @@ -41,7 +41,7 @@ #include "qapplication.h" #include "qevent.h" -#include "QActionToKeyEventMapper_p.h" +#include "qactiontokeyeventmapper_p.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 2da5cd0..a6a5e08 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -63,7 +63,7 @@ #include #include #include -#include +#include #ifdef Q_WS_X11 #include #endif diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 3486574..6d4dcf2 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -60,7 +60,7 @@ #ifndef QT_NO_WHATSTHIS # include #endif -#include +#include #include "qmenu_p.h" #include "qmenubar_p.h" -- cgit v0.12 From e99b5b716400bd64b06d0a45e1979a39d35c3329 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Thu, 11 Jun 2009 13:48:58 +0200 Subject: Added documentation for softkeys --- src/gui/kernel/qwidget.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 103577e..13f031e 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -885,6 +885,34 @@ void QWidget::setAutoFillBackground(bool enabled) \endlist \sa QEvent, QPainter, QGridLayout, QBoxLayout + + \section1 SoftKeys + \since 4.6 + \preliminary + Softkeys are visualization and platform independent way of setting actions + to widgets. Some platforms might omit the visualization part and map + hardware keys directly to actions. Softkeys are needed by users + who want to take full advantage of hardware keys and toolbars + in underlying platform. + + There are three major use cases supported. First one is a mobile device + with keypad navigation and no touch ui. Second use case is a mobile + device with touch ui. Third use case is desktop. For now the softkey API is + only implemented for Series60. + + The most common use case for mobile platforms is to map a menu to + left softkey. Another very common use case is to have buttons from dialog + such as ok/cancel mapped to softkeys which then can be mapped to hardware + keys. + + Softkeys API allows user to set any amount of softkeys. Focused widget + will automatically handle setting the softkeys. Though one should + be aware that there might be restrictions to amount of softkeys that can + be used by the device. + + \o Series60: For series60 menu button is automatically mapped to left + soft key if there is QMainWindow with QMenuBar in widgets parent hierarchy. + */ QWidgetMapper *QWidgetPrivate::mapper = 0; // widget with wid @@ -11555,6 +11583,9 @@ void QWidget::clearMask() } /*! + \preliminary + \since 4.6 + Returns the (possibly empty) list of this widget's softkeys. Returned list cannot be changed. Softkeys should be added and removed via method called setSoftKeys @@ -11573,6 +11604,9 @@ const QList& QWidget::softKeys() const } /*! + \preliminary + \since 4.6 + Sets the softkey \a softkey to this widget's list of softkeys, Setting 0 as softkey will clear all the existing softkeys set to the widget -- cgit v0.12 From 1f996801bf27c422ab4b8f82507d11e031d941d2 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Thu, 11 Jun 2009 14:07:10 +0200 Subject: Polished the documentation of softkey API --- src/gui/kernel/qwidget.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 13f031e..94c7599 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -889,26 +889,19 @@ void QWidget::setAutoFillBackground(bool enabled) \section1 SoftKeys \since 4.6 \preliminary - Softkeys are visualization and platform independent way of setting actions - to widgets. Some platforms might omit the visualization part and map - hardware keys directly to actions. Softkeys are needed by users - who want to take full advantage of hardware keys and toolbars - in underlying platform. + Softkeys API is a platform independent way of mapping actions to (hardware)keys + and toolbars provided by the underlying platform. + There are three major use cases supported. First one is a mobile device with keypad navigation and no touch ui. Second use case is a mobile device with touch ui. Third use case is desktop. For now the softkey API is only implemented for Series60. - - The most common use case for mobile platforms is to map a menu to - left softkey. Another very common use case is to have buttons from dialog - such as ok/cancel mapped to softkeys which then can be mapped to hardware - keys. - Softkeys API allows user to set any amount of softkeys. Focused widget - will automatically handle setting the softkeys. Though one should - be aware that there might be restrictions to amount of softkeys that can - be used by the device. + QActions are set to widget(s) via softkey API. Actions in focused widget are + mapped to native toolbar or hardware keys. Even though the API allows to set + any amount of widgets there might be physical restrictions to amount of + softkeys that can be used by the device and this shou \o Series60: For series60 menu button is automatically mapped to left soft key if there is QMainWindow with QMenuBar in widgets parent hierarchy. -- cgit v0.12 From d29dbdf82202942a59d12446d99751dc51050b93 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Thu, 11 Jun 2009 14:15:34 +0200 Subject: Even more polish to softkey API --- src/gui/kernel/qwidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 94c7599..a83a79f 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -901,10 +901,13 @@ void QWidget::setAutoFillBackground(bool enabled) QActions are set to widget(s) via softkey API. Actions in focused widget are mapped to native toolbar or hardware keys. Even though the API allows to set any amount of widgets there might be physical restrictions to amount of - softkeys that can be used by the device and this shou + softkeys that can be used by the device. \o Series60: For series60 menu button is automatically mapped to left soft key if there is QMainWindow with QMenuBar in widgets parent hierarchy. + + \sa softKeys() + \sa setSoftKey() */ -- cgit v0.12 From a44f0d21c607738fa95e3c2354e3fbbd7bc18441 Mon Sep 17 00:00:00 2001 From: mread Date: Thu, 11 Jun 2009 13:57:15 +0100 Subject: new symbian exception safety documentation --- doc/src/symbian-exceptionsafety.qdoc | 184 +++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 doc/src/symbian-exceptionsafety.qdoc diff --git a/doc/src/symbian-exceptionsafety.qdoc b/doc/src/symbian-exceptionsafety.qdoc new file mode 100644 index 0000000..212f707 --- /dev/null +++ b/doc/src/symbian-exceptionsafety.qdoc @@ -0,0 +1,184 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page symbianexceptionsafety.html + \title Exception Safety with Symbian + \ingroup qts60 + \brief A guide to integrating exception safety in Qt with Symbian. + + The following sections describe how Qt code can interoperate with Symbian's + exception safety system. + + \tableofcontents + + \section1 What the problem is + + Qt and Symbian have different exception systems. Qt works with standard C++ + exceptions, whereas Symbian has its TRAP/Leave/CleanupStack system. So, what would + happen if + you mix the two systems? It could go wrong in a number of ways. + + Cleanup ordering would be different between the two. When Symbian code + leaves, the cleanup stack is cleaned up before anything else happens. After + that, the objects on the call stack would be cleaned up as with a normal + exception. So if there are any dependencies between stack based and cleanup stack + owned objects, there could be problems due to this ordering. + + Symbian's \c XLeaveException, which is used when Symbian implements leaves as + exceptions, is not derived from \c std::exception, so would not be caught in + Qt catch statements designed to catch \c std::exception. + + Qt's and standard C++'s \c std::exception derived exceptions result in program + termination if they fall back to a Symbian TRAP. + + These problems can be solved with barrier macros and helper functions that + will translate between the two exception systems. Use them, in Qt code, + whenever calling into or being called from Symbian code. + + \section1 Qt calls to Symbian + + When calling Symbian leaving functions from Qt code, we want to translate + Symbian leaves to standard C++ exceptions. The following help is provided: + + \list + \o \l qt_translateSymbianErrorToException(int error) takes a Symbian + error code and throws an appropriate exception to represent it. + This will do nothing if the error code is not in fact an error. The + function is equivalent to Symbian's \c User::LeaveIfError. + \o \l QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(f) takes a Symbian leaving + code fragment f and runs it under a trap harness converting any resulting + error into an exception. + \o \c TRAP and \c TRAPD from the Symbian libraries can be used to convert + leaves to error codes. + \endlist + + \code + HBufC* buf=0; + // this will throw a std::bad_alloc because we've asked for too much memory + QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(buf = HBufC::NewL(100000000)); + + _LIT(KStr,"abc"); + TInt pos = KStr().Locate('c'); + // pos is a good value, >= 0, so no exception is thrown + qt_translateSymbianErrorToException(pos); + + pos = KStr().Locate('d'); + // pos == KErrNotFound, so this throws an exception + qt_translateSymbianErrorToException(pos); + \endcode + + \section1 Qt called from Symbian + + When Qt code is called from Symbian, we want to translate standard C++ + exceptions to Symbian leaves or error codes. The following help is + provided: + + \list + \o \l qt_translateExceptionToSymbianError(const std::exception& ex) - + this takes a standard exception and gives an appropriate Symbian + error code. If no mapping is known for the exception type, + \c KErrGeneral is returned. + \o \l qt_translateExceptionToSymbianErrorL(const std::exception& ex) - + this takes a standard exception and generates an appropriate Symbian + leave. + \o \l QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) - this macro + takes the standard C++ code fragment \c f, catches any std::exceptions + thrown from it, and sets err to the corresponding Symbian error code. + err is set to \c KErrNone otherwise. + \o \l QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(f) - this macro takes the + standard C++ code fragment \c f, catches any std::exceptions thrown from + it, and throws a corresponding Symbian leave. + \endlist + + \code + TInt DoTickL() // called from an active object RunL, ie Symbian leaves expected + { + // without the translation to Symbian Leave, we get a USER:0 panic + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE({ + int* x = new int[100000000]; // compiled as Qt code, will throw std::bad_alloc + delete [] x; + }); + return 0; + } + \endcode + + \section1 Common sense things + + Try to minimise the interleaving of Symbian and Qt code, every switch + requires a barrier. Grouping the code styles in different blocks will + minimise the problems. For instance, examine the following code. + + \code + 1. TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this); + 2. QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath(); + 3. filepath = QDir::toNativeSeparators(filepath); + 4. m_playUtility->OpenFileL(qt_QString2TPtrC(filepath))); + \endcode + + Line 1 starts a Symbian leave handling block, which is good because it + also uses a Symbian leave generating function. + + Line 2 creates a \l QString, uses \l QFileInfo and various member functions. + These could all throw exceptions, which is not good inside a \c TRAP block. + + Line 3 is unclear as to whether it might throw an exception, but since + it's dealing with strings it probably does, again bad. + + Line 4 is tricky, it calls a leaving function which is ok within a \c TRAP, + but it also uses \l qt_QString2TPtrC. You might think this is safe, but + there is a potential realloc call in there, so this can cause an unwelcome + exception. + + We could rewrite this with nested exception translations, but it's much + easier to refactor it. + + \code + QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath(); + filepath = QDir::toNativeSeparators(filepath); + TPtrC filepathPtr(qt_QString2TPtrC(filepath)); + TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this); + m_playUtility->OpenFileL(filepathPtr)); + \endcode + + Now the exception generating functions are separated from the leaving + functions. +*/ -- cgit v0.12 From a986d3f4948a782a8df71849464161bc4eff0766 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Thu, 11 Jun 2009 16:28:41 +0200 Subject: Updated example to tell which softkey was pressed --- examples/widgets/softkeys/softkeys.cpp | 24 ++++++++++++++++-------- examples/widgets/softkeys/softkeys.h | 3 +++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp index edf38b9..b29be2b 100644 --- a/examples/widgets/softkeys/softkeys.cpp +++ b/examples/widgets/softkeys/softkeys.cpp @@ -3,6 +3,15 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { + central = new QWidget(this); + setCentralWidget(central); + infoLabel = new QLabel(tr("Funky stuff in menu!")); + + layout = new QVBoxLayout; + layout->addWidget(infoLabel); + central->setLayout(layout); + central->setFocusPolicy(Qt::TabFocus); + fileMenu = menuBar()->addMenu(tr("&File")); openDialogAct = new QAction(tr("&Open Dialog"), this); addSoftKeysAct = new QAction(tr("&Add Softkeys"), this); @@ -13,12 +22,6 @@ MainWindow::MainWindow(QWidget *parent) connect(openDialogAct, SIGNAL(triggered()), this, SLOT(openDialog())); connect(addSoftKeysAct, SIGNAL(triggered()), this, SLOT(addSoftKeys())); connect(clearSoftKeysAct, SIGNAL(triggered()), this, SLOT(clearSoftKeys())); - QWidget *central = new QWidget(this); - central->setLayout(new QVBoxLayout); -// central->setFocus(); - setCentralWidget(central); - QPushButton button1; -// QAction* menuAction = } MainWindow::~MainWindow() @@ -43,19 +46,24 @@ void MainWindow::addSoftKeys() QList softkeys; softkeys.append(ok); softkeys.append(cancel); - setSoftKeys(softkeys); + central->setSoftKeys(softkeys); + central->setFocus(); } void MainWindow::clearSoftKeys() { - setSoftKey(0); + central->setSoftKey(0); } void MainWindow::okPressed() { + infoLabel->setText(tr("OK pressed")); + central->setSoftKey(0); } void MainWindow::cancelPressed() { + infoLabel->setText(tr("Cancel pressed")); + central->setSoftKey(0); } diff --git a/examples/widgets/softkeys/softkeys.h b/examples/widgets/softkeys/softkeys.h index 2bc74ba..11db419 100644 --- a/examples/widgets/softkeys/softkeys.h +++ b/examples/widgets/softkeys/softkeys.h @@ -59,6 +59,9 @@ public: MainWindow(QWidget *parent = 0); ~MainWindow(); private: + QVBoxLayout *layout; + QWidget *central; + QLabel *infoLabel; QMenu* fileMenu; QAction* openDialogAct; QAction* addSoftKeysAct; -- cgit v0.12 From a28afcd379faa0c7af2bec23aef8d4023623e616 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Thu, 11 Jun 2009 18:23:13 +0200 Subject: Initialize softKeyRole in the constructor. Reviewed-by: Alessandro Portale --- src/gui/kernel/qaction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index 8263cbc..b1db8d6 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -81,7 +81,8 @@ static QString qt_strippedText(QString s) QActionPrivate::QActionPrivate() : group(0), enabled(1), forceDisabled(0), visible(1), forceInvisible(0), checkable(0), checked(0), separator(0), fontSet(false), - menuRole(QAction::TextHeuristicRole), iconVisibleInMenu(-1) + menuRole(QAction::TextHeuristicRole), softKeyRole(QAction::OptionsSoftKey), + iconVisibleInMenu(-1) { #ifdef QT3_SUPPORT static int qt_static_action_id = -1; -- cgit v0.12 From 8a0aa903bcb32a51304557e0e724478aca140233 Mon Sep 17 00:00:00 2001 From: Espen Riskedal Date: Thu, 11 Jun 2009 18:46:16 +0200 Subject: add correct license headers --- examples/widgets/softkeys/main.cpp | 36 ++++++++++++++++++++++--- examples/widgets/softkeys/softkeys.cpp | 41 +++++++++++++++++++++++++++++ src/corelib/tools/qscopedpointer.cpp | 34 ++++++++++++++++++++++-- src/gui/widgets/qactiontokeyeventmapper_p.h | 13 ++++++++- 4 files changed, 118 insertions(+), 6 deletions(-) diff --git a/examples/widgets/softkeys/main.cpp b/examples/widgets/softkeys/main.cpp index a355f93..a544b28 100644 --- a/examples/widgets/softkeys/main.cpp +++ b/examples/widgets/softkeys/main.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the examples of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp index b29be2b..87d11c9 100644 --- a/examples/widgets/softkeys/softkeys.cpp +++ b/examples/widgets/softkeys/softkeys.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "softkeys.h" MainWindow::MainWindow(QWidget *parent) diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp index f34aec8..0239575 100644 --- a/src/corelib/tools/qscopedpointer.cpp +++ b/src/corelib/tools/qscopedpointer.cpp @@ -3,9 +3,39 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/widgets/qactiontokeyeventmapper_p.h b/src/gui/widgets/qactiontokeyeventmapper_p.h index da336e8..c54e612 100644 --- a/src/gui/widgets/qactiontokeyeventmapper_p.h +++ b/src/gui/widgets/qactiontokeyeventmapper_p.h @@ -42,6 +42,17 @@ #ifndef QACTIONTOKEYEVENTMAPPER_P_H #define QACTIONTOKEYEVENTMAPPER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #include "QtGui/qaction.h" QT_BEGIN_HEADER @@ -67,4 +78,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif //QACTIONTOKEYEVENTMAPPER_H +#endif //QACTIONTOKEYEVENTMAPPER_P_H -- cgit v0.12 From 213b58ec4401170813801a26708c87032196a5d9 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 11 Jun 2009 18:49:23 +0200 Subject: Using QPixmap as paint device. Makes more sense in this case. At least on X11 and MacOS. Reviewed-by: Ariya Hidayat --- src/gui/styles/qs60style_simulated.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 362e29c..684f232 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -274,7 +274,7 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, const QRect leftRect = rightRect.translated(cornerWidth - rectWidth, 0); const QRect centerRect = drawOnlyCenter ? rect : rect.adjusted(cornerWidth, cornerWidth, -cornerWidth, -cornerWidth); - QImage result(size, QImage::Format_ARGB32); + QPixmap result(size); result.fill(Qt::transparent); QPainter painter(&result); @@ -303,7 +303,7 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, drawPart(center, &painter, centerRect, flags); #endif - return QPixmap::fromImage(result); + return result; } void QS60StylePrivate::setStyleProperty_specific(const char *name, const QVariant &value) -- cgit v0.12 From 17f4de60fb4e13e470ae2101460174b41e828e1f Mon Sep 17 00:00:00 2001 From: Espen Riskedal Date: Thu, 11 Jun 2009 19:44:44 +0200 Subject: start on changes file for Tower release --- dist/changes-4.5.2-tower | 101 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 dist/changes-4.5.2-tower diff --git a/dist/changes-4.5.2-tower b/dist/changes-4.5.2-tower new file mode 100644 index 0000000..1a039ba --- /dev/null +++ b/dist/changes-4.5.2-tower @@ -0,0 +1,101 @@ +Qt 4.5.2-tower +--------------- + +The Qt for S60 "Tower" release is the fifth pre-release from the Qt for +S60 porting project. "Tower" is based on the Qt 4.5 codebase. + +Up to and including SHA: not yet started :D + +Lists just S60 fixes, for general 4.5.0 changes go to: + + http://www.qtsoftware.com/developer/changes/changes-4.5.0 + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Task Tracker: + + http://qtsoftware.com/developer/task-tracker + +Each of these identifiers can be entered in the task tracker to obtain +more information about a particular change. Sometimes the task is internal +and cannot be viewed by the public, a lot of them are non-public for Qt for +S60 at the moment. + +**************************************************************************** +* New features * +**************************************************************************** + +New modules +----------- + +- QtSql + * todo +- QtWebkit + * todo +- Phonon + * todo + + +New classes +------------ + +- todo + * todo + +Ported classes +-------------- + +- todo + * todo + +Features +-------- + +- todo + * todo + +Optimizations +------------- + +- todo + * todo + +**************************************************************************** +* Build issues * +**************************************************************************** + +- todo + +**************************************************************************** +* Changes to existing classes * +**************************************************************************** + +- todo + * todo + +**************************************************************************** +* Examples and demos * +**************************************************************************** + +- todo + * todo + +**************************************************************************** +* Tools * +**************************************************************************** + +- todo + * todo + +**************************************************************************** +* Plugins * +**************************************************************************** + +- todo + * todo + +**************************************************************************** +* Important Behavior Changes * +**************************************************************************** + +- todo + * todo -- cgit v0.12 From 09e3e740adfc08723275c8c7d9860d37fc61d8dd Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 3 Jun 2009 11:48:02 +1000 Subject: Fixed recursive QMAKE_EXTRA_TARGETS not being generated correctly for SUBDIRS projects when using abld. Acked-by: Miikka Heikkinen --- qmake/generators/makefile.cpp | 101 +++++++++++++++++------------- qmake/generators/makefile.h | 3 + qmake/generators/symbian/symmake_abld.cpp | 12 +++- 3 files changed, 70 insertions(+), 46 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 82703c5..5f38bc7 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2234,8 +2234,8 @@ MakefileGenerator::writeHeader(QTextStream &t) t << endl; } -void -MakefileGenerator::writeSubDirs(QTextStream &t) +QList +MakefileGenerator::findSubDirsSubTargets() const { QList targets; { @@ -2332,6 +2332,13 @@ MakefileGenerator::writeSubDirs(QTextStream &t) } } } + return targets; +} + +void +MakefileGenerator::writeSubDirs(QTextStream &t) +{ + QList targets = findSubDirsSubTargets(); t << "first: make_default" << endl; int flags = SubTargetInstalls; if(project->isActiveConfig("ordered")) @@ -2348,39 +2355,43 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListtarget; + t << endl << endl; + } writeExtraVariables(t); - t << "SUBTARGETS = "; // subtargets are sub-directory - for(int target = 0; target < targets.size(); ++target) - t << " \\\n\t\t" << targets.at(target)->target; - t << endl << endl; QStringList targetSuffixes; const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH"); - targetSuffixes << "make_default" << "make_first" << "all" << "clean" << "distclean" - << QString((flags & SubTargetInstalls) ? "install_subtargets" : "install") - << QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall"); + if (!(flags & SubTargetSkipDefaultTargets)) { + targetSuffixes << "make_default" << "make_first" << "all" << "clean" << "distclean" + << QString((flags & SubTargetInstalls) ? "install_subtargets" : "install") + << QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall"); + } // generate target rules for(int target = 0; target < targets.size(); ++target) { @@ -2500,23 +2511,25 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListvalues("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1) - project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all"); + if (!(flags & SubTargetSkipDefaultTargets)) { + if(project->values("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1) + project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all"); - writeMakeQmake(t); + writeMakeQmake(t); - t << "qmake_all:"; - if(!targets.isEmpty()) { - for(QList::Iterator it = targets.begin(); it != targets.end(); ++it) { - if(!(*it)->profile.isEmpty()) - t << " " << (*it)->target << "-" << "qmake_all"; + t << "qmake_all:"; + if(!targets.isEmpty()) { + for(QList::Iterator it = targets.begin(); it != targets.end(); ++it) { + if(!(*it)->profile.isEmpty()) + t << " " << (*it)->target << "-" << "qmake_all"; + } } + if(project->isEmpty("QMAKE_NOFORCE")) + t << " FORCE"; + if(project->isActiveConfig("no_empty_targets")) + t << "\n\t" << "@cd ."; + t << endl << endl; } - if(project->isEmpty("QMAKE_NOFORCE")) - t << " FORCE"; - if(project->isActiveConfig("no_empty_targets")) - t << "\n\t" << "@cd ."; - t << endl << endl; for(int s = 0; s < targetSuffixes.size(); ++s) { QString suffix = targetSuffixes.at(s); diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index 9896c1d..a6eec52 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -121,9 +121,12 @@ protected: enum SubTargetFlags { SubTargetInstalls=0x01, SubTargetOrdered=0x02, + SubTargetSkipDefaultVariables=0x04, + SubTargetSkipDefaultTargets=0x08, SubTargetsNoFlags=0x00 }; + QList findSubDirsSubTargets() const; void writeSubTargets(QTextStream &t, QList subtargets, int flags); //extra compiler interface diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index 32d08f6..8501224 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -184,6 +184,10 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool t << "#" << endl; t << "# ==============================================================================" << "\n" << endl; t << endl; + QString ofile = Option::fixPathToTargetOS(Option::output.fileName()); + if(ofile.lastIndexOf(Option::dir_sep) != -1) + ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1); + t << "MAKEFILE = " << ofile << endl; t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl; t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; @@ -273,8 +277,6 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool } - writeExtraTargets(t); - // pre_targetdeps target depends on: // - all targets specified in PRE_TARGETDEPS // - the GENERATED_SOURCES sources (so that they get generated) @@ -285,6 +287,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool // so supporting generating sources is the best we can do. This is enough for mocs. if (!isSubdirs) { + writeExtraTargets(t); writeExtraCompilerTargets(t); t << CREATE_TEMPS_TARGET ":" << endl; @@ -345,6 +348,11 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool } t << endl; } + else { + QList subtargets = findSubDirsSubTargets(); + writeSubTargets(t, subtargets, SubTargetSkipDefaultVariables|SubTargetSkipDefaultTargets); + qDeleteAll(subtargets); + } writeDeploymentTargets(t); -- cgit v0.12 From 9598176349d070966fa84eeb8c77b23d0c9644af Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Tue, 9 Jun 2009 09:32:50 +1000 Subject: Fixed recursive QMAKE_EXTRA_TARGETS not being generated correctly for SUBDIRS projects when using sbsv2. Acked-by: Miikka Heikkinen --- qmake/generators/symbian/symmake_sbsv2.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index 33431d2..7b739c7 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -124,6 +124,10 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo t << "#" << endl; t << "# ==============================================================================" << "\n" << endl; t << endl; + QString ofile = Option::fixPathToTargetOS(Option::output.fileName()); + if(ofile.lastIndexOf(Option::dir_sep) != -1) + ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1); + t << "MAKEFILE = " << ofile << endl; t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl; t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; @@ -206,11 +210,15 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo // Add all extra targets including extra compiler targest also to wrapper makefile, // even though many of them may have already been added to bld.inf as FLMs. // This is to enable use of targets like 'mocables', which call targets generated by extra compilers. - t << extraTargetsCache; - if (!isSubdirs) { + t << extraTargetsCache; t << extraCompilersCache; } + else { + QList subtargets = findSubDirsSubTargets(); + writeSubTargets(t, subtargets, SubTargetSkipDefaultVariables|SubTargetSkipDefaultTargets); + qDeleteAll(subtargets); + } t << "dodistclean:" << endl; foreach(QString item, project->values("SUBDIRS")) { -- cgit v0.12 From f0044749d5e9905e2f7af9c0aa54e4d77cab13af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 12 Jun 2009 09:12:07 +0300 Subject: S60Style: Remove key accelerators --- src/gui/styles/qs60style.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 0d003a6..4ba5351 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2314,6 +2314,8 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w case SH_BlinkCursorWhenTextSelected: retValue = true; break; + case SH_UnderlineShortcut: + retValue = 0; default: break; } -- cgit v0.12 From e0690577327097ec3d9be99205bfcf01f8404d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 12 Jun 2009 10:36:42 +0300 Subject: S60Style: Drivelist combobox in AddressBook example causes crash due to null pointer use in S60Style. --- src/gui/styles/qs60style.cpp | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 4ba5351..83f1698 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -574,7 +574,7 @@ void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start, if (startRect.topRight().y() > endRect.bottomLeft().y()) { const int overlap = (startRect.topRight().y() - endRect.bottomLeft().y())>>1; startRect.setHeight(startRect.height()-overlap); - endRect.adjust(0,overlap,0,0); + endRect.adjust(0,overlap,0,0); } } @@ -1129,7 +1129,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom copy.state |= State_Raised; copy.state &= ~State_Sunken; } - pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ? + pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ? PE_IndicatorSpinPlus : PE_IndicatorSpinUp; @@ -1156,7 +1156,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom copy.state |= State_Raised; copy.state &= ~State_Sunken; } - pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ? + pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ? PE_IndicatorSpinMinus : PE_IndicatorSpinDown; @@ -1586,12 +1586,12 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QPixmap tabIcon = optionTab.icon.pixmap(iconSize, (optionTab.state & State_Enabled) ? QIcon::Normal : QIcon::Disabled); if (tab->text.isEmpty()) - painter->drawPixmap(tr.center().x() - (tabIcon.height() >>1), - tr.center().y() - (tabIcon.height() >>1), + painter->drawPixmap(tr.center().x() - (tabIcon.height() >>1), + tr.center().y() - (tabIcon.height() >>1), tabIcon); else - painter->drawPixmap(tr.left() + tabOverlap, - tr.center().y() - (tabIcon.height() >>1), + painter->drawPixmap(tr.left() + tabOverlap, + tr.center().y() - (tabIcon.height() >>1), tabIcon); tr.setLeft(tr.left() + iconSize.width() + 4); } @@ -1822,7 +1822,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } } QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, mtyRect, adjFlags); - + QRegion clipRegion = painter->clipRegion(); painter->setClipRect(option->rect); drawControl(CE_HeaderSection, header, painter, widget); @@ -2038,8 +2038,18 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti #endif //QT_NO_SPINBOX case PE_FrameFocusRect: // Calendar widget and combox both do not use styled itemDelegate - if (!(widget && qobject_cast(widget->parent())) || - qobject_cast(widget)) { + if ( widget && ( +#ifndef QT_NO_CALENDARWIDGET + (qobject_cast(widget->parent())) +#else + false +#endif //QT_NO_CALENDARWIDGET +#ifndef QT_NO_COMBOBOX + || (qobject_cast(widget)) +#else + || false +#endif //QT_NO_COMBOBOX + )) { // no focus selection for touch if (option->state & State_HasFocus && !QS60StylePrivate::isTouchSupported()) { painter->save(); @@ -2292,9 +2302,9 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w retValue = true; break; case SH_ProgressDialog_TextLabelAlignment: - retValue = (QApplication::layoutDirection() == Qt::LeftToRight) ? + retValue = (QApplication::layoutDirection() == Qt::LeftToRight) ? Qt::AlignLeft : - Qt::AlignRight; + Qt::AlignRight; break; case SH_Menu_SubMenuPopupDelay: retValue = 300; @@ -2408,7 +2418,7 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple const int y = frameThickness + spinbox->rect.y(); const int x = spinbox->rect.x() + spinbox->rect.width() - frameThickness - 2*buttonSize.width(); - + switch (scontrol) { case SC_SpinBoxUp: if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) @@ -2643,7 +2653,7 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con // a) highlight border does not cross the rect // b) in s60 list checkbox is smaller than normal checkbox //todo; magic three - ret.setRect(opt->rect.left()+3, opt->rect.top() + heightOffset, + ret.setRect(opt->rect.left()+3, opt->rect.top() + heightOffset, indicatorWidth-3, indicatorHeight-3); } else { ret.setRect(opt->rect.right() - indicatorWidth - spacing, opt->rect.top() + heightOffset, @@ -2782,8 +2792,8 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon, QS60StyleEnums::SkinParts part; QS60StylePrivate::SkinElementFlags adjustedFlags; if (option) - adjustedFlags = (option->state & State_Enabled) ? - QS60StylePrivate::SF_StateEnabled : + adjustedFlags = (option->state & State_Enabled) ? + QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled; switch(standardIcon) { -- cgit v0.12 From 915e8a40866d0e86bcaaf3d72d26897bebf00a41 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 12 Jun 2009 11:03:55 +0300 Subject: Fixes FEP crash when changing the focused Qt widget to NULL. --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index b183e1b..7d79422 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -329,6 +329,8 @@ void QCoeFepInputContext::updateHints() m_lastImHints = hints; applyHints(hints); } + } else { + CCoeEnv::Static()->InputCapabilitiesChanged(); } } -- cgit v0.12