diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-08-16 06:00:17 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-08-16 06:00:17 (GMT) |
commit | 1c0ed07f8f65a2b8d5a189ac3e438bd798a87ed1 (patch) | |
tree | 65b658582151aa9b47a6b9843463dddd032a8323 /src/gui/kernel | |
parent | ab90235dfa1874e5c70875ed9b68817e698a55b3 (diff) | |
parent | 35665053a56f7c74e45d65234630a130ba24a27a (diff) | |
download | Qt-1c0ed07f8f65a2b8d5a189ac3e438bd798a87ed1.zip Qt-1c0ed07f8f65a2b8d5a189ac3e438bd798a87ed1.tar.gz Qt-1c0ed07f8f65a2b8d5a189ac3e438bd798a87ed1.tar.bz2 |
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts:
src/gui/kernel/qwidget_s60.cpp
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qcursor_win.cpp | 1 | ||||
-rw-r--r-- | src/gui/kernel/qsoftkeymanager.cpp | 14 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/src/gui/kernel/qcursor_win.cpp b/src/gui/kernel/qcursor_win.cpp index 9f0c516..cef83f5 100644 --- a/src/gui/kernel/qcursor_win.cpp +++ b/src/gui/kernel/qcursor_win.cpp @@ -477,6 +477,7 @@ void QCursorData::update() QPixmap pixmap = QApplicationPrivate::instance()->getPixmapCursor(cshape); hcurs = create32BitCursor(pixmap, hx, hy); } + break; default: qWarning("QCursor::update: Invalid cursor shape %d", cshape); return; diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 510705f..9caa37e 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -123,8 +123,10 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act default: break; }; - if (key != 0) + if (key != 0) { QSoftKeyManager::instance()->d_func()->softKeyCommandActions.insert(action, key); + connect(action, SIGNAL(destroyed(QObject*)), QSoftKeyManager::instance(), SLOT(cleanupHash(QObject*))); + } #endif QAction::SoftKeyRole softKeyRole = QAction::NoSoftKey; switch (standardKey) { @@ -157,7 +159,13 @@ QAction *QSoftKeyManager::createKeyedAction(StandardSoftKey standardKey, Qt::Key QScopedPointer<QAction> action(createAction(standardKey, actionWidget)); connect(action.data(), SIGNAL(triggered()), QSoftKeyManager::instance(), SLOT(sendKeyEvent())); + +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2) + // Don't connect destroyed slot if is was already connected in createAction + if (!(QSoftKeyManager::instance()->d_func()->softKeyCommandActions.contains(action.data()))) +#endif connect(action.data(), SIGNAL(destroyed(QObject*)), QSoftKeyManager::instance(), SLOT(cleanupHash(QObject*))); + QSoftKeyManager::instance()->d_func()->keyedActions.insert(action.data(), key); return action.take(); #endif //QT_NO_ACTION @@ -166,7 +174,9 @@ QAction *QSoftKeyManager::createKeyedAction(StandardSoftKey standardKey, Qt::Key void QSoftKeyManager::cleanupHash(QObject *obj) { Q_D(QSoftKeyManager); - QAction *action = qobject_cast<QAction*>(obj); + // Can't use qobject_cast in destroyed() signal handler as that'll return NULL, + // so use static_cast instead. Since the pointer is only used as a hash key, it is safe. + QAction *action = static_cast<QAction *>(obj); d->keyedActions.remove(action); #if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2) d->softKeyCommandActions.remove(action); diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index d6aaa3f..807f68e 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -238,7 +238,7 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) bool checkExtra = true; if (q->isWindow() && (data.window_state & (Qt::WindowFullScreen | Qt::WindowMaximized))) { // Do not allow fullscreen/maximized windows to expand beyond client rect - TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); + TRect r = S60->clientRect(); w = qMin(w, r.Width()); h = qMin(h, r.Height()); |