diff options
author | aavit <qt-info@nokia.com> | 2011-06-09 07:36:34 (GMT) |
---|---|---|
committer | aavit <qt-info@nokia.com> | 2011-06-09 07:36:34 (GMT) |
commit | 161fd33b199c96a92fbda4b009e85f910f73acc0 (patch) | |
tree | 736e139d09f8cf8fee5fa4315fb3381d5c4f492b /src/gui/kernel | |
parent | 809fc41c9b19388a21ee8e23601156579780cda3 (diff) | |
parent | 3916feefc5ebadba3320029a29ecf02d8934e879 (diff) | |
download | Qt-161fd33b199c96a92fbda4b009e85f910f73acc0.zip Qt-161fd33b199c96a92fbda4b009e85f910f73acc0.tar.gz Qt-161fd33b199c96a92fbda4b009e85f910f73acc0.tar.bz2 |
Merge remote branch 'qt-mainline/4.8'
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_qws.cpp | 24 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 34 | ||||
-rw-r--r-- | src/gui/kernel/qdesktopwidget.qdoc | 10 | ||||
-rw-r--r-- | src/gui/kernel/qeventdispatcher_s60.cpp | 66 | ||||
-rw-r--r-- | src/gui/kernel/qeventdispatcher_s60_p.h | 27 | ||||
-rw-r--r-- | src/gui/kernel/qsessionmanager_qws.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qsoftkeymanager.cpp | 14 | ||||
-rw-r--r-- | src/gui/kernel/qsoftkeymanager_common_p.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qsoftkeymanager_s60.cpp | 4 |
9 files changed, 41 insertions, 143 deletions
diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp index 14f7790..1197c77 100644 --- a/src/gui/kernel/qapplication_qws.cpp +++ b/src/gui/kernel/qapplication_qws.cpp @@ -112,19 +112,6 @@ #include <qvfbhdr.h> -#ifndef QT_NO_QWS_MULTIPROCESS -#ifdef QT_NO_QSHM -#include <sys/ipc.h> -#include <sys/shm.h> -#ifndef Q_OS_DARWIN -# include <sys/sem.h> -#endif -#include <sys/socket.h> -#else -#include "private/qwssharedmemory_p.h" -#endif -#endif - QT_BEGIN_NAMESPACE #ifndef QT_NO_DIRECTPAINTER @@ -230,7 +217,7 @@ QString qws_dataDir() qFatal("Qt for Embedded Linux data directory has incorrect permissions: %s", dataDir.constData()); #endif - result.append("/"); + result.append(QLatin1Char('/')); return result; } @@ -3565,13 +3552,8 @@ bool QETWidget::translateKeyEvent(const QWSKeyEvent *event, bool grab) /* grab i QEvent::KeyPress : QEvent::KeyRelease; bool autor = event->simpleData.is_auto_repeat; QString text; - char ascii = 0; - if (event->simpleData.unicode) { - QChar ch(event->simpleData.unicode); - if (ch.unicode() != 0xffff) - text += ch; - ascii = ch.toLatin1(); - } + if (event->simpleData.unicode && event->simpleData.unicode != 0xffff) + text += QChar(event->simpleData.unicode); code = event->simpleData.keycode; #if defined QT3_SUPPORT && !defined(QT_NO_SHORTCUT) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index e9d58c7..31d02d4 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -74,6 +74,7 @@ # include <centralrepository.h> # include "qs60mainappui.h" # include "qinputcontext.h" +# include <private/qgraphicssystemex_symbian_p.h> #endif #if defined(Q_WS_S60) @@ -1694,7 +1695,7 @@ void qt_init(QApplicationPrivate * /* priv */, int) if (commandLine) { // After this construction, CEikonEnv will be available from CEikonEnv::Static(). // (much like our qApp). - QtEikonEnv* coe = new QtEikonEnv; + CEikonEnv* coe = new CEikonEnv; //not using QT_TRAP_THROWING, because coe owns the cleanupstack so it can't be pushed there. TRAPD(err, coe->ConstructAppFromCommandLineL(factory, *commandLine)); if(err != KErrNone) { @@ -1850,26 +1851,12 @@ void qt_init(QApplicationPrivate * /* priv */, int) #ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE QApplicationPrivate::instance()->useTranslucentEGLSurfaces = true; - const TUid KIvePropertyCat = {0x2726beef}; - enum TIvePropertyChipType { - EVCBCM2727B1 = 0x00000000, - EVCBCM2763A0 = 0x04000100, - EVCBCM2763B0 = 0x04000102, - EVCBCM2763C0 = 0x04000103, - EVCBCM2763C1 = 0x04000104, - EVCBCMUnknown = 0x7fffffff - }; - - TInt chipType = EVCBCMUnknown; - if (RProperty::Get(KIvePropertyCat, 0 /*chip type*/, chipType) == KErrNone) { - if (chipType == EVCBCM2727B1) { - // We have only 32MB GPU memory. Use raster surfaces - // for transparent TLWs. - QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false; - } - } else { + if (QSymbianGraphicsSystemEx::hasBCM2727()) { + // We have only 32MB GPU memory. Use raster surfaces + // for transparent TLWs. QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false; } + if (QApplicationPrivate::graphics_system_name == QLatin1String("raster")) QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false; #else @@ -2027,7 +2014,7 @@ void QApplicationPrivate::openPopup(QWidget *popup) QApplicationPrivate::popupWidgets->append(popup); // Cancel focus widget pointer capture and long tap timer - if (QApplication::focusWidget()) { + if (QApplication::focusWidget() && QApplication::focusWidget()->effectiveWinId()) { static_cast<QSymbianControl*>(QApplication::focusWidget()->effectiveWinId())->CancelLongTapTimer(); QApplication::focusWidget()->effectiveWinId()->SetPointerCapture(false); } @@ -2278,6 +2265,7 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent #if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS) case EEventDisplayChanged: #endif + { if (callSymbianEventFilters(symbianEvent)) return 1; if (S60) @@ -2289,6 +2277,12 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent QResizeEvent e(qt_desktopWidget->size(), oldSize); QApplication::sendEvent(qt_desktopWidget, &e); } + // Close non-native QMenus (that should act like context menus, i.e. close + // automatically when the orientation changes). + QMenu *activeMenu = qobject_cast<QMenu *>(QApplication::activePopupWidget()); + if (activeMenu) + activeMenu->close(); + } return 0; // Propagate to CONE case EEventWindowVisibilityChanged: if (controlInMap) { diff --git a/src/gui/kernel/qdesktopwidget.qdoc b/src/gui/kernel/qdesktopwidget.qdoc index f71155e..b93bcb3 100644 --- a/src/gui/kernel/qdesktopwidget.qdoc +++ b/src/gui/kernel/qdesktopwidget.qdoc @@ -151,6 +151,11 @@ on Mac OS X, or the task bar on Windows). The default screen is used if \a screen is -1. + \note In Symbian devices the available geometry reported by QDesktopWidget is + not guaranteed to be correct at the time the geometry change resize event + is passed to widgets. The correct way to listen for available geometry changes + is to connect to the workAreaResized() signal of QDesktopWidget. + \sa screenNumber(), screenGeometry() */ @@ -179,6 +184,11 @@ Returns the geometry of the screen with index \a screen. The default screen is used if \a screen is -1. + \note In Symbian devices the screen geometry reported by QDesktopWidget is + not guaranteed to be correct at the time the geometry change resize event + is passed to widgets. The correct way to listen for screen geometry changes + is to connect to the resized() signal of QDesktopWidget. + \sa screenNumber() */ diff --git a/src/gui/kernel/qeventdispatcher_s60.cpp b/src/gui/kernel/qeventdispatcher_s60.cpp index 3f20c08..d5a2761 100644 --- a/src/gui/kernel/qeventdispatcher_s60.cpp +++ b/src/gui/kernel/qeventdispatcher_s60.cpp @@ -45,62 +45,6 @@ QT_BEGIN_NAMESPACE -QtEikonEnv::QtEikonEnv() - : m_lastIterationCount(0) - , m_savedStatusCode(KRequestPending) - , m_hasAlreadyRun(false) -{ -} - -QtEikonEnv::~QtEikonEnv() -{ -} - -void QtEikonEnv::RunL() -{ - QEventDispatcherS60 *dispatcher = qobject_cast<QEventDispatcherS60 *>(QAbstractEventDispatcher::instance()); - if (!dispatcher) { - CEikonEnv::RunL(); - return; - } - - if (m_lastIterationCount != dispatcher->iterationCount()) { - m_hasAlreadyRun = false; - m_lastIterationCount = dispatcher->iterationCount(); - } - - if (m_hasAlreadyRun) { - // Fool the active scheduler into believing we are still waiting for events. - // The window server thinks we are not, however. - m_savedStatusCode = iStatus.Int(); - iStatus = KRequestPending; - SetActive(); - dispatcher->queueDeferredActiveObjectsCompletion(); - } else { - m_hasAlreadyRun = true; - CEikonEnv::RunL(); - } -} - -void QtEikonEnv::DoCancel() -{ - complete(); - - CEikonEnv::DoCancel(); -} - -void QtEikonEnv::complete() -{ - if (m_hasAlreadyRun) { - if (m_savedStatusCode != KRequestPending) { - TRequestStatus *status = &iStatus; - QEventDispatcherSymbian::RequestComplete(status, m_savedStatusCode); - m_savedStatusCode = KRequestPending; - } - m_hasAlreadyRun = false; - } -} - QEventDispatcherS60::QEventDispatcherS60(QObject *parent) : QEventDispatcherSymbian(parent), m_noInputEvents(false) @@ -183,14 +127,4 @@ void QEventDispatcherS60::removeInputEventsForWidget(QObject *object) } } -// reimpl -void QEventDispatcherS60::reactivateDeferredActiveObjects() -{ - if (S60->qtOwnsS60Environment) { - static_cast<QtEikonEnv *>(CCoeEnv::Static())->complete(); - } - - QEventDispatcherSymbian::reactivateDeferredActiveObjects(); -} - QT_END_NAMESPACE diff --git a/src/gui/kernel/qeventdispatcher_s60_p.h b/src/gui/kernel/qeventdispatcher_s60_p.h index 49ec568..c7cf2b2 100644 --- a/src/gui/kernel/qeventdispatcher_s60_p.h +++ b/src/gui/kernel/qeventdispatcher_s60_p.h @@ -62,31 +62,6 @@ QT_BEGIN_NAMESPACE class QEventDispatcherS60; -class QtEikonEnv : public CEikonEnv -{ -public: - QtEikonEnv(); - ~QtEikonEnv(); - - // from CActive. - void RunL(); - void DoCancel(); - - void complete(); - -private: - // Workaround for a BC break from S60 3.2 -> 5.0, where the CEikonEnv override was removed. - // To avoid linking to that when we build against 3.2, define an empty body here. - // Reserved_*() have been verified to be empty in the S60 code. - void Reserved_1() {} - void Reserved_2() {} - -private: - int m_lastIterationCount; - TInt m_savedStatusCode; - bool m_hasAlreadyRun; -}; - class Q_GUI_EXPORT QEventDispatcherS60 : public QEventDispatcherSymbian { Q_OBJECT @@ -102,8 +77,6 @@ public: void saveInputEvent(QSymbianControl *control, QWidget *widget, QInputEvent *event); - void reactivateDeferredActiveObjects(); - private: bool sendDeferredInputEvents(); diff --git a/src/gui/kernel/qsessionmanager_qws.cpp b/src/gui/kernel/qsessionmanager_qws.cpp index efe688e..e437635 100644 --- a/src/gui/kernel/qsessionmanager_qws.cpp +++ b/src/gui/kernel/qsessionmanager_qws.cpp @@ -43,6 +43,9 @@ #ifndef QT_NO_SESSIONMANAGER +#include <qapplication.h> +#include <private/qobject_p.h> + QT_BEGIN_NAMESPACE class QSessionManagerPrivate : public QObjectPrivate diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 7d7c56f..57893f9 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -50,7 +50,7 @@ #include "private/qsoftkeymanager_s60_p.h" #endif -#ifdef SYMBIAN_VERSION_SYMBIAN3 +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) #include "private/qt_s60_p.h" #endif @@ -105,7 +105,7 @@ QSoftKeyManager::QSoftKeyManager() : QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *actionWidget) { QAction *action = new QAction(standardSoftKeyText(standardKey), actionWidget); -#ifdef SYMBIAN_VERSION_SYMBIAN3 +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) int key = 0; switch (standardKey) { case OkSoftKey: @@ -171,7 +171,7 @@ void QSoftKeyManager::cleanupHash(QObject *obj) Q_D(QSoftKeyManager); QAction *action = qobject_cast<QAction*>(obj); d->keyedActions.remove(action); -#ifdef SYMBIAN_VERSION_SYMBIAN3 +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) d->softKeyCommandActions.remove(action); #endif } @@ -193,9 +193,11 @@ void QSoftKeyManager::sendKeyEvent() void QSoftKeyManager::updateSoftKeys() { - QSoftKeyManager::instance()->d_func()->pendingUpdate = true; - QEvent *event = new QEvent(QEvent::UpdateSoftKeys); - QApplication::postEvent(QSoftKeyManager::instance(), event); + if (QApplication::activeWindow()) { + QSoftKeyManager::instance()->d_func()->pendingUpdate = true; + QEvent *event = new QEvent(QEvent::UpdateSoftKeys); + QApplication::postEvent(QSoftKeyManager::instance(), event); + } } bool QSoftKeyManager::appendSoftkeys(const QWidget &source, int level) diff --git a/src/gui/kernel/qsoftkeymanager_common_p.h b/src/gui/kernel/qsoftkeymanager_common_p.h index bf4c747..5b76e60 100644 --- a/src/gui/kernel/qsoftkeymanager_common_p.h +++ b/src/gui/kernel/qsoftkeymanager_common_p.h @@ -72,7 +72,7 @@ protected: QMultiHash<int, QAction*> requestedSoftKeyActions; QWidget *initialSoftKeySource; bool pendingUpdate; -#ifdef SYMBIAN_VERSION_SYMBIAN3 +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) QHash<QAction*, int> softKeyCommandActions; #endif }; diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index ab71064..acdb0e5 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -113,7 +113,7 @@ void QSoftKeyManagerPrivateS60::ensureCbaVisibilityAndResponsiviness(CEikButtonG void QSoftKeyManagerPrivateS60::clearSoftkeys(CEikButtonGroupContainer &cba) { -#ifdef SYMBIAN_VERSION_SYMBIAN3 +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) QT_TRAP_THROWING( //EAknSoftkeyEmpty is used, because using -1 adds softkeys without actions on Symbian3 cba.SetCommandL(0, EAknSoftkeyEmpty, KNullDesC); @@ -297,7 +297,7 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba, QString text = softkeyText(*action); TPtrC nativeText = qt_QString2TPtrC(text); int command = S60_COMMAND_START + position; -#ifdef SYMBIAN_VERSION_SYMBIAN3 +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) if (softKeyCommandActions.contains(action)) command = softKeyCommandActions.value(action); #endif |