author | Brendan Donegan <brendand@symbian.org> |
Mon, 14 Jun 2010 12:26:38 +0100 | |
branch | Symbian3 |
changeset 43 | 14fcccfb4c0c |
parent 41 | qt/qapplication/smoketest_qapplication.cpp@72f7e4177ac7 |
permissions | -rw-r--r-- |
41
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
1 |
/**************************************************************************** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
2 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
4 |
** All rights reserved. |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
6 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
7 |
** This file is part of the test suite of the Qt Toolkit. |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
8 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
10 |
** No Commercial Usage |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
11 |
** This file contains pre-release code and may not be distributed. |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
12 |
** You may use this file in accordance with the terms and conditions |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
13 |
** contained in the Technology Preview License Agreement accompanying |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
14 |
** this package. |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
15 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
16 |
** GNU Lesser General Public License Usage |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
18 |
** General Public License version 2.1 as published by the Free Software |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
20 |
** packaging of this file. Please review the following information to |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
23 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
27 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
28 |
** If you have questions regarding the use of this file, please contact |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
29 |
** Nokia at qt-info@nokia.com. |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
30 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
31 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
32 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
33 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
34 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
35 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
36 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
37 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
38 |
** $QT_END_LICENSE$ |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
39 |
** |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
40 |
****************************************************************************/ |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
41 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
42 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
43 |
//#define QT_TST_QAPP_DEBUG |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
44 |
#include <qdebug.h> |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
45 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
46 |
#include <QtTest/QtTest> |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
47 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
48 |
#include "qabstracteventdispatcher.h" |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
49 |
#include <QtGui> |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
50 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
51 |
#include "private/qapplication_p.h" |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
52 |
#include "private/qstylesheetstyle_p.h" |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
53 |
#ifdef Q_OS_WINCE |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
54 |
#include <windows.h> |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
55 |
#endif |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
56 |
#ifdef Q_OS_SYMBIAN |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
57 |
#include <aknenv.h> |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
58 |
#endif |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
59 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
60 |
//TESTED_CLASS= |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
61 |
//TESTED_FILES= |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
62 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
63 |
#if defined(Q_OS_SYMBIAN) |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
64 |
// In Symbian, the PluginsPath doesn't specify the only absolute path; just the dir that can be found on any drive |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
65 |
/*static void addExpectedSymbianPluginsPath(QStringList& expected) |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
66 |
{ |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
67 |
QString installPathPlugins = QDir::fromNativeSeparators(QLibraryInfo::location(QLibraryInfo::PluginsPath)); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
68 |
QFileInfoList driveList = QDir::drives(); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
69 |
QListIterator<QFileInfo> iter(driveList); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
70 |
while (iter.hasNext()) { |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
71 |
QFileInfo testFi(iter.next().canonicalPath().append(installPathPlugins)); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
72 |
if (testFi.exists()) |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
73 |
expected << testFi.canonicalFilePath(); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
74 |
} |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
75 |
} |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
76 |
*/ |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
77 |
#endif |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
78 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
79 |
class tst_QApplication : public QObject |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
80 |
{ |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
81 |
Q_OBJECT |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
82 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
83 |
public: |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
84 |
tst_QApplication(); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
85 |
virtual ~tst_QApplication(); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
86 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
87 |
public slots: |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
88 |
void init(); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
89 |
void cleanup(); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
90 |
private slots: |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
91 |
void setActiveWindow(); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
92 |
}; |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
93 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
94 |
static char *argv0; |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
95 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
96 |
tst_QApplication::tst_QApplication() |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
97 |
{ |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
98 |
#ifdef Q_OS_WINCE |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
99 |
// Clean up environment previously to launching test |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
100 |
qputenv("QT_PLUGIN_PATH", QByteArray()); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
101 |
#endif |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
102 |
} |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
103 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
104 |
tst_QApplication::~tst_QApplication() |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
105 |
{ |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
106 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
107 |
} |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
108 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
109 |
void tst_QApplication::init() |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
110 |
{ |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
111 |
// TODO: Add initialization code here. |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
112 |
// This will be executed immediately before each test is run. |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
113 |
} |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
114 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
115 |
void tst_QApplication::cleanup() |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
116 |
{ |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
117 |
// TODO: Add cleanup code here. |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
118 |
// This will be executed immediately after each test is run. |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
119 |
} |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
120 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
121 |
void tst_QApplication::setActiveWindow() |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
122 |
{ |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
123 |
int argc = 0; |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
124 |
QApplication MyApp(argc, 0, QApplication::GuiServer); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
125 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
126 |
QWidget* w = new QWidget; |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
127 |
QVBoxLayout* layout = new QVBoxLayout(w); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
128 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
129 |
QLineEdit* pb1 = new QLineEdit("Testbutton1", w); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
130 |
QLineEdit* pb2 = new QLineEdit("Test Line Edit", w); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
131 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
132 |
layout->addWidget(pb1); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
133 |
layout->addWidget(pb2); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
134 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
135 |
pb2->setFocus(); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
136 |
pb2->setParent(0); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
137 |
delete pb2; |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
138 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
139 |
w->show(); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
140 |
QApplication::setActiveWindow(w); // needs this on twm (focus follows mouse) |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
141 |
QVERIFY(pb1->hasFocus()); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
142 |
delete w; |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
143 |
} |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
144 |
|
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
145 |
//QTEST_APPLESS_MAIN(tst_QApplication) |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
146 |
int main(int argc, char *argv[]) |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
147 |
{ |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
148 |
tst_QApplication tc; |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
149 |
argv0 = argv[0]; |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
150 |
return QTest::qExec(&tc, argc, argv); |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
151 |
} |
72f7e4177ac7
Smoketest for Qt: Gestures and QApplication
Brendan Donegan <brendand@symbian.org>
parents:
diff
changeset
|
152 |
|
43
14fcccfb4c0c
Cleaning up the new Qt tests, removing redundant code
Brendan Donegan <brendand@symbian.org>
parents:
41
diff
changeset
|
153 |
#include "smoke_qapplication.moc" |