diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-08-12 13:50:16 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-08-12 13:50:16 (GMT) |
commit | 7086488612e3a1d877c237d10d89640d5384b1d9 (patch) | |
tree | 36c0a3f69307a785b2d39b792c112cc611f91ee8 /src/gui | |
parent | f11bdd5bd0b46f759e4711de1c2c3ef5006433fa (diff) | |
parent | 1dc0a2ccd645abd26b13fd67313a03bbc722a74d (diff) | |
download | Qt-7086488612e3a1d877c237d10d89640d5384b1d9.zip Qt-7086488612e3a1d877c237d10d89640d5384b1d9.tar.gz Qt-7086488612e3a1d877c237d10d89640d5384b1d9.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Fix softkeys cleanup
Fix clientRect usage in QWidgetPrivate::setGeometry_sys()
Do not allow fullscreen/maximized windows to expand beyond client rect
Do not modify window size for fullscreen windows in setGeometry_sys
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qsoftkeymanager.cpp | 14 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 13 |
2 files changed, 24 insertions, 3 deletions
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 2700bbb..80e6ec6 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -126,8 +126,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) { @@ -160,7 +162,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 @@ -169,7 +177,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 5630706..c490572 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -235,11 +235,22 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) QSize oldSize(q->size()); QRect oldGeom(data.crect); + 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 = S60->clientRect(); + w = qMin(w, r.Width()); + h = qMin(h, r.Height()); + + if (w == r.Width() && h == r.Height()) + checkExtra = false; + } + // Lose maximized status if deliberate resize if (w != oldSize.width() || h != oldSize.height()) data.window_state &= ~Qt::WindowMaximized; - if (extra) { // any size restrictions? + if (checkExtra && extra) { // any size restrictions? w = qMin(w,extra->maxw); h = qMin(h,extra->maxh); w = qMax(w,extra->minw); |