summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSami Merilä <sami.merila@nokia.com>2009-09-18 16:06:46 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-09-21 08:06:19 (GMT)
commit58b92a951899f74b63048a36c451d3355c0c5a7f (patch)
treefec4e8be5ca11570979e3f0a8de3f6a7407c661f /tests
parent75c4d11b8260ab74bcbf403c32333b81e5ef30e3 (diff)
downloadQt-58b92a951899f74b63048a36c451d3355c0c5a7f.zip
Qt-58b92a951899f74b63048a36c451d3355c0c5a7f.tar.gz
Qt-58b92a951899f74b63048a36c451d3355c0c5a7f.tar.bz2
S60 native looking dialog support.
Related to QTSSIXTY-63 "Make Qt dialogs look native" S60 dialog support: * Positioning according S60 rules: - in portrait dialogs at the bottom of the screen, - in landscape positioned in the center of the screen [unless device supports bottom softkeys], so that softkeys are not covered by the dialog * If dialog shows extension, then dialog is re-positioned * Dialog size: - in portrait screen wide dialog, height can change - in landscape width is the same size as width in portrait (some dialogs are maximized) * No push buttons or DialogButtonBoxes in internal qt dialogs (QWizard, QInputDialog, QFileDialog, QFontDialog, QColorDialog, QProgressDialog, QErrorMessage, QMessageBox), instead signals are remapped to softkeys. * Globally, dialogbuttonboxes are converted automatically to softkeys. OPEN: * Needs to be re-factored slightly after softkey API refactoring is finished. BUGS: QWizard layout switch is wonky - dialog is not re-sized correctly. QFontDialog will not fit into device screen (too much widgets in it). Some effort needed to be make it smaller. Cannot set one softkey at the time softkeys => Options menu and right softkey cannot be set separately [SoftKey re-factoring will help] Dialogs cannot get touch events to softkeys [SoftKey re-factoring will help] Reviewed-by: Alessandro Portale Reviewed-by: Jason Barron Reviewed-by: mread Reviewed-by: Shane Kearns
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp b/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
index a1e0fc1..98eb7cb 100644
--- a/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
+++ b/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
@@ -109,6 +109,7 @@ private slots:
void testSignalOrder();
void testDefaultButton_data();
void testDefaultButton();
+ void testS60SoftKeys();
void task191642_default();
private:
@@ -713,6 +714,27 @@ void tst_QDialogButtonBox::testDefaultButton_data()
QTest::newRow("third accept explicit after add") << 0 << 2 << 2;
}
+void tst_QDialogButtonBox::testS60SoftKeys()
+{
+#ifdef Q_WS_S60
+ QDialog dialog(0);
+ QDialogButtonBox buttonBox(&dialog);
+ buttonBox.setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+ dialog.show();
+ QList<QAction*> softKeys = dialog.softKeys();
+ QCOMPARE( softKeys.count(), 2);
+
+ QDialog dialog2(0);
+ QDialogButtonBox buttonBox2(&dialog2);
+ buttonBox2.setStandardButtons(QDialogButtonBox::Cancel);
+ dialog2.show();
+ softKeys = dialog2.softKeys();
+ QCOMPARE( softKeys.count(), 1);
+#else
+ QSKIP();
+#endif
+}
+
void tst_QDialogButtonBox::testDefaultButton()
{
QFETCH(int, whenToSetDefault);