diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-23 12:57:12 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-23 12:57:12 (GMT) |
commit | 726694c873104ac484a3d09c1a9f64f06a88f864 (patch) | |
tree | 0f51fbd61e6778b636ef54d83b7b6f141e0673a3 /tests/manual/qtouchevent/main.cpp | |
parent | 429f29a305559313f92866ac19cf224ad1497b33 (diff) | |
download | Qt-726694c873104ac484a3d09c1a9f64f06a88f864.zip Qt-726694c873104ac484a3d09c1a9f64f06a88f864.tar.gz Qt-726694c873104ac484a3d09c1a9f64f06a88f864.tar.bz2 |
the start of a manual test for touch events
Diffstat (limited to 'tests/manual/qtouchevent/main.cpp')
-rw-r--r-- | tests/manual/qtouchevent/main.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/manual/qtouchevent/main.cpp b/tests/manual/qtouchevent/main.cpp new file mode 100644 index 0000000..c406543 --- /dev/null +++ b/tests/manual/qtouchevent/main.cpp @@ -0,0 +1,58 @@ +#include <QtGui> +#include <QtTest> + +#include "ui_form.h" +#include "touchwidget.h" + +class MultitouchTestWidget : public QWidget, public Ui::Form +{ + Q_OBJECT + +public: + MultitouchTestWidget(QWidget *parent = 0) + : QWidget(parent) + { + setupUi(this); + } +}; + +class tst_ManualMultitouch : public QObject +{ + Q_OBJECT + +public: + tst_ManualMultitouch(); + ~tst_ManualMultitouch(); + +private slots: + void touchBeginPropagation(); +}; + +tst_ManualMultitouch::tst_ManualMultitouch() +{ } + +tst_ManualMultitouch::~tst_ManualMultitouch() +{ } + +void tst_ManualMultitouch::touchBeginPropagation() +{ + MultitouchTestWidget testWidget; + testWidget.testNameLabel->setText("Touch event propagation"); + testWidget.testDescriptionLabel->setText("Touch, move, and release your finger over the green widget, the close this window."); + testWidget.greenWidget->setAttribute(Qt::WA_AcceptTouchEvents); + testWidget.greenWidget->acceptTouchBegin = true; + testWidget.show(); + + (void) qApp->exec(); + + QVERIFY(testWidget.greenWidget->seenTouchBegin); + QVERIFY(testWidget.greenWidget->seenTouchUpdate); + QVERIFY(testWidget.greenWidget->seenTouchEnd); + QVERIFY(!testWidget.greenWidget->seenMousePress); + QVERIFY(!testWidget.greenWidget->seenMouseMove); + QVERIFY(!testWidget.greenWidget->seenMouseRelease); +} + +QTEST_MAIN(tst_ManualMultitouch) + +#include "main.moc" |