summaryrefslogtreecommitdiffstats
path: root/tests/auto/qapplication
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qapplication')
-rw-r--r--tests/auto/qapplication/modal/base.cpp21
-rw-r--r--tests/auto/qapplication/modal/base.h23
-rw-r--r--tests/auto/qapplication/modal/main.cpp11
-rw-r--r--tests/auto/qapplication/modal/modal.pro8
-rw-r--r--tests/auto/qapplication/qapplication.pro1
-rw-r--r--tests/auto/qapplication/tst_qapplication.cpp18
6 files changed, 82 insertions, 0 deletions
diff --git a/tests/auto/qapplication/modal/base.cpp b/tests/auto/qapplication/modal/base.cpp
new file mode 100644
index 0000000..d3a7de6
--- /dev/null
+++ b/tests/auto/qapplication/modal/base.cpp
@@ -0,0 +1,21 @@
+#include "base.h"
+
+base::base(QWidget *parent) :
+ QWidget(parent)
+{
+ m_timer = new QTimer(this);
+ m_modalStarted = false;
+ m_timer->setSingleShot(false);
+ connect(m_timer, SIGNAL(timeout()), this, SLOT(periodicTimer()));
+ m_timer->start(5000);
+}
+
+void base::periodicTimer()
+{
+ if(m_modalStarted)
+ exit(0);
+ m_modalDialog = new QDialog(this);
+ m_modalDialog->setModal(true);
+ m_modalDialog->show();
+ m_modalStarted = true;
+}
diff --git a/tests/auto/qapplication/modal/base.h b/tests/auto/qapplication/modal/base.h
new file mode 100644
index 0000000..ebf1198
--- /dev/null
+++ b/tests/auto/qapplication/modal/base.h
@@ -0,0 +1,23 @@
+#ifndef BASE_H
+#define BASE_H
+
+#include <QWidget>
+#include <QTimer>
+#include <QDialog>
+
+class base : public QWidget
+{
+Q_OBJECT
+ QTimer *m_timer;
+ bool m_modalStarted;
+ QDialog *m_modalDialog;
+public:
+ explicit base(QWidget *parent = 0);
+
+signals:
+
+public slots:
+ void periodicTimer();
+};
+
+#endif // BASE_H
diff --git a/tests/auto/qapplication/modal/main.cpp b/tests/auto/qapplication/modal/main.cpp
new file mode 100644
index 0000000..e1d39cf
--- /dev/null
+++ b/tests/auto/qapplication/modal/main.cpp
@@ -0,0 +1,11 @@
+#include <QtGui>
+
+#include <QApplication>
+#include "base.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ base *b = new base();
+ return app.exec();
+}
diff --git a/tests/auto/qapplication/modal/modal.pro b/tests/auto/qapplication/modal/modal.pro
new file mode 100644
index 0000000..836f6ff
--- /dev/null
+++ b/tests/auto/qapplication/modal/modal.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET =
+DEPENDPATH += .
+INCLUDEPATH += .
+SOURCES += main.cpp \
+ base.cpp
+DESTDIR = ./
+HEADERS += base.h
diff --git a/tests/auto/qapplication/qapplication.pro b/tests/auto/qapplication/qapplication.pro
index 7814ad3..becc6c6 100644
--- a/tests/auto/qapplication/qapplication.pro
+++ b/tests/auto/qapplication/qapplication.pro
@@ -1,6 +1,7 @@
TEMPLATE = subdirs
SUBDIRS = test \
desktopsettingsaware \
+ modal \
wincmdline
diff --git a/tests/auto/qapplication/tst_qapplication.cpp b/tests/auto/qapplication/tst_qapplication.cpp
index 1a38070..91ae921 100644
--- a/tests/auto/qapplication/tst_qapplication.cpp
+++ b/tests/auto/qapplication/tst_qapplication.cpp
@@ -146,6 +146,7 @@ private slots:
void symbianNeedForTraps();
void symbianLeaveThroughMain();
+ void qtbug_12673();
};
class EventSpy : public QObject
@@ -2239,6 +2240,23 @@ void tst_QApplication::symbianLeaveThroughMain()
#endif
}
+void tst_QApplication::qtbug_12673()
+{
+#ifdef Q_OS_SYMBIAN
+ QSKIP("This might not make sense in Symbian, but since I do not know how to test it I'll just skip it for now.", SkipAll);
+#else
+ QProcess testProcess;
+ QStringList arguments;
+#ifdef Q_OS_MAC
+ testProcess.start("modal/modal.app", arguments);
+#else
+ testProcess.start("modal/modal", arguments);
+#endif
+ QVERIFY(testProcess.waitForFinished(20000));
+ QCOMPARE(testProcess.exitStatus(), QProcess::NormalExit);
+#endif // Q_OS_SYMBIAN
+}
+
//QTEST_APPLESS_MAIN(tst_QApplication)
int main(int argc, char *argv[])
{