author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 02 Feb 2010 00:43:10 +0200 | |
changeset 3 | 41300fa6a67c |
parent 0 | 1918ee327afb |
child 4 | 3b1da2848fc7 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
3 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 |
** All rights reserved. |
|
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the test suite of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#include <QtTest/QtTest> |
|
43 |
||
44 |
#include "qevent.h" |
|
45 |
#include "qdialog.h" |
|
46 |
#include "qpushbutton.h" |
|
47 |
#include "qdialogbuttonbox.h" |
|
48 |
#include "private/qsoftkeymanager_p.h" |
|
49 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
50 |
#ifdef Q_OS_SYMBIAN |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
51 |
#include "qsymbianevent.h" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
52 |
#endif |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
53 |
|
0 | 54 |
#ifdef Q_WS_S60 |
55 |
static const int s60CommandStart = 6000; |
|
56 |
#endif |
|
57 |
||
58 |
||
59 |
class tst_QSoftKeyManager : public QObject |
|
60 |
{ |
|
61 |
Q_OBJECT |
|
62 |
||
63 |
public: |
|
64 |
tst_QSoftKeyManager(); |
|
65 |
virtual ~tst_QSoftKeyManager(); |
|
66 |
||
67 |
public slots: |
|
68 |
void initTestCase(); |
|
69 |
void cleanupTestCase(); |
|
70 |
void init(); |
|
71 |
void cleanup(); |
|
72 |
private slots: |
|
73 |
void updateSoftKeysCompressed(); |
|
74 |
void handleCommand(); |
|
75 |
void checkSoftkeyEnableStates(); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
76 |
void noMergingOverWindowBoundary(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
77 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
78 |
private: // utils |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
79 |
inline void simulateSymbianCommand(int command) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
80 |
{ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
81 |
QSymbianEvent event1(QSymbianEvent::CommandEvent, command); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
82 |
qApp->symbianProcessEvent(&event1); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
83 |
}; |
0 | 84 |
}; |
85 |
||
86 |
class EventListener : public QObject |
|
87 |
{ |
|
88 |
public: |
|
89 |
EventListener(QObject *listenTo) |
|
90 |
{ |
|
91 |
resetCounts(); |
|
92 |
if (listenTo) |
|
93 |
listenTo->installEventFilter(this); |
|
94 |
} |
|
95 |
||
96 |
void resetCounts() |
|
97 |
{ |
|
98 |
numUpdateSoftKeys = 0; |
|
99 |
} |
|
100 |
||
101 |
int numUpdateSoftKeys; |
|
102 |
||
103 |
protected: |
|
104 |
bool eventFilter(QObject * /*object*/, QEvent *event) |
|
105 |
{ |
|
106 |
if (event->type() == QEvent::UpdateSoftKeys) |
|
107 |
numUpdateSoftKeys++; |
|
108 |
return false; |
|
109 |
} |
|
110 |
}; |
|
111 |
||
112 |
tst_QSoftKeyManager::tst_QSoftKeyManager() : QObject() |
|
113 |
{ |
|
114 |
} |
|
115 |
||
116 |
tst_QSoftKeyManager::~tst_QSoftKeyManager() |
|
117 |
{ |
|
118 |
} |
|
119 |
||
120 |
void tst_QSoftKeyManager::initTestCase() |
|
121 |
{ |
|
122 |
} |
|
123 |
||
124 |
void tst_QSoftKeyManager::cleanupTestCase() |
|
125 |
{ |
|
126 |
} |
|
127 |
||
128 |
void tst_QSoftKeyManager::init() |
|
129 |
{ |
|
130 |
} |
|
131 |
||
132 |
void tst_QSoftKeyManager::cleanup() |
|
133 |
{ |
|
134 |
} |
|
135 |
||
136 |
/* |
|
137 |
This tests that we only get one UpdateSoftKeys event even though |
|
138 |
multiple events that trigger soft keys occur. |
|
139 |
*/ |
|
140 |
void tst_QSoftKeyManager::updateSoftKeysCompressed() |
|
141 |
{ |
|
142 |
QWidget w; |
|
143 |
EventListener listener(qApp); |
|
144 |
||
145 |
QList<QAction *> softKeys; |
|
146 |
for (int i = 0; i < 10; ++i) { |
|
147 |
QAction *action = new QAction("foo", &w); |
|
148 |
action->setSoftKeyRole(QAction::PositiveSoftKey); |
|
149 |
softKeys << action; |
|
150 |
} |
|
151 |
w.addActions(softKeys); |
|
152 |
||
153 |
QApplication::processEvents(); |
|
154 |
||
155 |
QVERIFY(listener.numUpdateSoftKeys == 1); |
|
156 |
} |
|
157 |
||
158 |
/* |
|
159 |
This tests that when the S60 environment sends us a command |
|
160 |
that it actually gets mapped to the correct action. |
|
161 |
*/ |
|
162 |
void tst_QSoftKeyManager::handleCommand() |
|
163 |
{ |
|
164 |
QDialog w; |
|
165 |
QDialogButtonBox *buttons = new QDialogButtonBox( |
|
166 |
QDialogButtonBox::Ok | QDialogButtonBox::Cancel, |
|
167 |
Qt::Horizontal, |
|
168 |
&w); |
|
169 |
||
170 |
w.show(); |
|
171 |
QApplication::processEvents(); |
|
172 |
||
173 |
QCOMPARE(w.actions().count(), 2); |
|
174 |
||
175 |
QSignalSpy spy0(w.actions()[0], SIGNAL(triggered())); |
|
176 |
QSignalSpy spy1(w.actions()[1], SIGNAL(triggered())); |
|
177 |
||
178 |
// These should work eventually, but do not yet |
|
179 |
// QTest::keyPress(&w, Qt::Key_Context1); |
|
180 |
// QTest::keyPress(&w, Qt::Key_Context2); |
|
181 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
182 |
simulateSymbianCommand(6000); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
183 |
simulateSymbianCommand(6001); |
0 | 184 |
|
185 |
QApplication::processEvents(); |
|
186 |
||
187 |
QCOMPARE(spy0.count(), 1); |
|
188 |
QCOMPARE(spy1.count(), 1); |
|
189 |
} |
|
190 |
||
191 |
/* |
|
192 |
This tests that the state of a widget that owns softkey action is respected when handling the softkey |
|
193 |
command. |
|
194 |
*/ |
|
195 |
void tst_QSoftKeyManager::checkSoftkeyEnableStates() |
|
196 |
{ |
|
197 |
QDialog w; |
|
198 |
QDialogButtonBox *buttons = new QDialogButtonBox( |
|
199 |
QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Help, |
|
200 |
Qt::Horizontal, |
|
201 |
&w); |
|
202 |
QPushButton *pBDefaults = buttons->button(QDialogButtonBox::RestoreDefaults); |
|
203 |
QPushButton *pBHelp = buttons->button(QDialogButtonBox::Help); |
|
204 |
pBHelp->setEnabled(false); |
|
205 |
w.show(); |
|
206 |
QApplication::processEvents(); |
|
207 |
||
208 |
QSignalSpy spy0(w.actions()[0], SIGNAL(triggered())); //restore defaults action |
|
209 |
QSignalSpy spy1(w.actions()[1], SIGNAL(triggered())); //disabled help action |
|
210 |
||
211 |
//Verify that enabled button gets all the action trigger signals and |
|
212 |
//disabled button gets none. |
|
213 |
for (int i = 0; i < 10; i++) { |
|
214 |
//simulate "Restore Defaults" softkey press |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
215 |
simulateSymbianCommand(s60CommandStart); |
0 | 216 |
//simulate "help" softkey press |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
217 |
simulateSymbianCommand(s60CommandStart + 1); |
0 | 218 |
} |
219 |
QApplication::processEvents(); |
|
220 |
QCOMPARE(spy0.count(), 10); |
|
221 |
QCOMPARE(spy1.count(), 0); |
|
222 |
spy0.clear(); |
|
223 |
spy1.clear(); |
|
224 |
||
225 |
for (int i = 0; i < 10; i++) { |
|
226 |
//simulate "Restore Defaults" softkey press |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
227 |
simulateSymbianCommand(s60CommandStart); |
0 | 228 |
//simulate "help" softkey press |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
229 |
simulateSymbianCommand(s60CommandStart + 1); |
0 | 230 |
//switch enabled button to disabled and vice versa |
231 |
pBHelp->setEnabled(!pBHelp->isEnabled()); |
|
232 |
pBDefaults->setEnabled(!pBDefaults->isEnabled()); |
|
233 |
} |
|
234 |
QApplication::processEvents(); |
|
235 |
QCOMPARE(spy0.count(), 5); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
236 |
QCOMPARE(spy1.count(), 5); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
237 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
238 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
239 |
/* |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
240 |
This tests that the softkeys are not merged over window boundaries. I.e. dialogs |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
241 |
don't get softkeys of base widget by default - QTBUG-6163. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
242 |
*/ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
243 |
void tst_QSoftKeyManager::noMergingOverWindowBoundary() |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
244 |
{ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
245 |
// Create base window against which the dialog softkeys will ve verified |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
246 |
QWidget base; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
247 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
248 |
QAction* baseLeft = new QAction(tr("BaseLeft"), &base); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
249 |
baseLeft->setSoftKeyRole(QAction::PositiveSoftKey); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
250 |
base.addAction(baseLeft); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
251 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
252 |
QAction* baseRight = new QAction(tr("BaseRight"), &base); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
253 |
baseRight->setSoftKeyRole(QAction::NegativeSoftKey); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
254 |
base.addAction(baseRight); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
255 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
256 |
base.showMaximized(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
257 |
QApplication::processEvents(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
258 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
259 |
QSignalSpy baseLeftSpy(baseLeft, SIGNAL(triggered())); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
260 |
QSignalSpy baseRightSpy(baseRight, SIGNAL(triggered())); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
261 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
262 |
//Verify that both base softkeys emit triggered signals |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
263 |
simulateSymbianCommand(s60CommandStart); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
264 |
simulateSymbianCommand(s60CommandStart + 1); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
265 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
266 |
QCOMPARE(baseLeftSpy.count(), 1); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
267 |
QCOMPARE(baseRightSpy.count(), 1); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
268 |
baseLeftSpy.clear(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
269 |
baseRightSpy.clear(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
270 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
271 |
// Verify that no softkey merging when using dialog without parent |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
272 |
QDialog dlg; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
273 |
dlg.show(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
274 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
275 |
QApplication::processEvents(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
276 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
277 |
simulateSymbianCommand(s60CommandStart); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
278 |
simulateSymbianCommand(s60CommandStart + 1); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
279 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
280 |
QCOMPARE(baseLeftSpy.count(), 0); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
281 |
QCOMPARE(baseRightSpy.count(), 0); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
282 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
283 |
// Ensure base view has focus again |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
284 |
dlg.hide(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
285 |
base.showMaximized(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
286 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
287 |
// Verify that no softkey merging when using dialog with parent |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
288 |
QDialog dlg2(&base); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
289 |
dlg2.show(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
290 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
291 |
QApplication::processEvents(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
292 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
293 |
simulateSymbianCommand(s60CommandStart); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
294 |
simulateSymbianCommand(s60CommandStart + 1); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
295 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
296 |
QCOMPARE(baseLeftSpy.count(), 0); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
297 |
QCOMPARE(baseRightSpy.count(), 0); |
0 | 298 |
} |
299 |
||
300 |
QTEST_MAIN(tst_QSoftKeyManager) |
|
301 |
#include "tst_qsoftkeymanager.moc" |