diff options
author | Jerome Pasion <jerome.pasion@nokia.com> | 2011-03-31 07:59:20 (GMT) |
---|---|---|
committer | Jerome Pasion <jerome.pasion@nokia.com> | 2011-03-31 07:59:20 (GMT) |
commit | 2d0dd40702fe2be32b41efa915e6e71c310c45f1 (patch) | |
tree | 42fa20cf37516569c6934bd754f4fd6f6878a06e | |
parent | f910b7cc12301e72b67fb85328cac878c2ad9994 (diff) | |
parent | 97902c7f81228fa669acc6e075681dc05b404b1a (diff) | |
download | Qt-2d0dd40702fe2be32b41efa915e6e71c310c45f1.zip Qt-2d0dd40702fe2be32b41efa915e6e71c310c45f1.tar.gz Qt-2d0dd40702fe2be32b41efa915e6e71c310c45f1.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7
-rw-r--r-- | demos/spectrum/spectrum.pri | 6 | ||||
-rw-r--r-- | src/gui/kernel/qsoftkeymanager_s60.cpp | 8 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 9 | ||||
-rw-r--r-- | tests/auto/qdir/qdir.pro | 2 | ||||
-rw-r--r-- | tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp | 34 |
5 files changed, 35 insertions, 24 deletions
diff --git a/demos/spectrum/spectrum.pri b/demos/spectrum/spectrum.pri index 5773900..75c0113 100644 --- a/demos/spectrum/spectrum.pri +++ b/demos/spectrum/spectrum.pri @@ -41,9 +41,9 @@ win32 { # ..$${spectrum_build_dir} # without the result having a trailing slash where spectrum_build_dir # is undefined. - spectrum_build_dir = /release - if (!debug_and_release|build_pass): CONFIG(debug, debug|release) { - spectrum_build_dir = /debug + build_pass { + CONFIG(release, release|debug): spectrum_build_dir = /release + CONFIG(debug, release|debug): spectrum_build_dir = /debug } } diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index 3496297..09e2b5f 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -113,12 +113,20 @@ void QSoftKeyManagerPrivateS60::ensureCbaVisibilityAndResponsiviness(CEikButtonG void QSoftKeyManagerPrivateS60::clearSoftkeys(CEikButtonGroupContainer &cba) { +#ifdef SYMBIAN_VERSION_SYMBIAN3 + QT_TRAP_THROWING( + //EAknSoftkeyEmpty is used, because using -1 adds softkeys without actions on Symbian3 + cba.SetCommandL(0, EAknSoftkeyEmpty, KNullDesC); + cba.SetCommandL(2, EAknSoftkeyEmpty, KNullDesC); + ); +#else QT_TRAP_THROWING( //Using -1 instead of EAknSoftkeyEmpty to avoid flickering. cba.SetCommandL(0, -1, KNullDesC); // TODO: Should we clear also middle SK? cba.SetCommandL(2, -1, KNullDesC); ); +#endif realSoftKeyActions.clear(); } diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index aa68c23..da1528e 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2556,17 +2556,16 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, tb->sizePolicy().horizontalPolicy() == QSizePolicy::Maximum) && tb->orientation() == Qt::Horizontal; if (parentCanGrowHorizontally) { - int visibleButtons = 0; + int buttons = 0; //Make the auto-stretch to happen only for horizontal orientation if (tb && tb->orientation() == Qt::Horizontal) { QList<QAction*> actionList = tb->actions(); for (int i = 0; i < actionList.count(); i++) { - if (actionList.at(i)->isVisible()) - visibleButtons++; + buttons++; } } - if (widget->parentWidget() && visibleButtons > 0) { + if (widget->parentWidget() && buttons > 0) { QWidget *w = const_cast<QWidget *>(widget); int toolBarMaxWidth = 0; int totalMargin = 0; @@ -2589,7 +2588,7 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, toolBarMaxWidth -= totalMargin; //ensure that buttons are side-by-side and not on top of each other - const int toolButtonWidth = (toolBarMaxWidth / visibleButtons) + const int toolButtonWidth = (toolBarMaxWidth / buttons) - pixelMetric(QStyle::PM_ToolBarItemSpacing) - pixelMetric(QStyle::PM_ToolBarItemMargin) //toolbar frame needs to be reduced again, since QToolBarLayout adds it for each toolbar action diff --git a/tests/auto/qdir/qdir.pro b/tests/auto/qdir/qdir.pro index cf612f1..d81e428 100644 --- a/tests/auto/qdir/qdir.pro +++ b/tests/auto/qdir/qdir.pro @@ -4,7 +4,7 @@ RESOURCES += qdir.qrc QT = core wince*|symbian { - DirFiles.sources = testdir testdata searchdir resources entrylist types tst_qdir.cpp + DirFiles.sources = testdir testData searchdir resources entrylist types tst_qdir.cpp DirFiles.path = . DEPLOYMENT += DirFiles } diff --git a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp index 910d437..bd19afb 100644 --- a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp +++ b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp @@ -179,8 +179,8 @@ void tst_QSoftKeyManager::handleCommand() // QTest::keyPress(&w, Qt::Key_Context1); // QTest::keyPress(&w, Qt::Key_Context2); - simulateSymbianCommand(6000); - simulateSymbianCommand(6001); + simulateSymbianCommand(s60CommandStart); //0 = LSK position + simulateSymbianCommand(s60CommandStart + 2); //2 = RSK position QApplication::processEvents(); @@ -205,28 +205,32 @@ void tst_QSoftKeyManager::checkSoftkeyEnableStates() w.show(); QApplication::processEvents(); - QSignalSpy spy0(w.actions()[0], SIGNAL(triggered())); //restore defaults action - QSignalSpy spy1(w.actions()[1], SIGNAL(triggered())); //disabled help action + //According to StandardButton enum in QDialogButtonBox the Help action + //is inserted before RestoreDefaults and thus help action is in index 0 + QSignalSpy spy0(w.actions()[0], SIGNAL(triggered())); //disabled help action + QSignalSpy spy1(w.actions()[1], SIGNAL(triggered())); //restore defaults action //Verify that enabled button gets all the action trigger signals and //disabled button gets none. for (int i = 0; i < 10; i++) { - //simulate "Restore Defaults" softkey press - simulateSymbianCommand(s60CommandStart); //simulate "help" softkey press - simulateSymbianCommand(s60CommandStart + 1); + simulateSymbianCommand(s60CommandStart); + //simulate "Restore Defaults" softkey press + simulateSymbianCommand(s60CommandStart + 2); } QApplication::processEvents(); - QCOMPARE(spy0.count(), 10); - QCOMPARE(spy1.count(), 0); + //Restore defaults button is enabled and its signals are recorded to spy1 + QCOMPARE(spy0.count(), 0); + QCOMPARE(spy1.count(), 10); + spy0.clear(); spy1.clear(); for (int i = 0; i < 10; i++) { - //simulate "Restore Defaults" softkey press - simulateSymbianCommand(s60CommandStart); //simulate "help" softkey press - simulateSymbianCommand(s60CommandStart + 1); + simulateSymbianCommand(s60CommandStart); + //simulate "Restore Defaults" softkey press + simulateSymbianCommand(s60CommandStart + 2); //switch enabled button to disabled and vice versa pBHelp->setEnabled(!pBHelp->isEnabled()); pBDefaults->setEnabled(!pBDefaults->isEnabled()); @@ -261,7 +265,7 @@ void tst_QSoftKeyManager::noMergingOverWindowBoundary() //Verify that both base softkeys emit triggered signals simulateSymbianCommand(s60CommandStart); - simulateSymbianCommand(s60CommandStart + 1); + simulateSymbianCommand(s60CommandStart + 2); QCOMPARE(baseLeftSpy.count(), 1); QCOMPARE(baseRightSpy.count(), 1); @@ -275,7 +279,7 @@ void tst_QSoftKeyManager::noMergingOverWindowBoundary() QApplication::processEvents(); simulateSymbianCommand(s60CommandStart); - simulateSymbianCommand(s60CommandStart + 1); + simulateSymbianCommand(s60CommandStart + 2); QCOMPARE(baseLeftSpy.count(), 0); QCOMPARE(baseRightSpy.count(), 0); @@ -291,7 +295,7 @@ void tst_QSoftKeyManager::noMergingOverWindowBoundary() QApplication::processEvents(); simulateSymbianCommand(s60CommandStart); - simulateSymbianCommand(s60CommandStart + 1); + simulateSymbianCommand(s60CommandStart + 2); QCOMPARE(baseLeftSpy.count(), 0); QCOMPARE(baseRightSpy.count(), 0); |