author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Wed, 21 Apr 2010 09:15:16 +0300 | |
branch | RCL_3 |
changeset 10 | 68d3b337861b |
parent 7 | 3f74d0d4af4c |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 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 |
||
43 |
#include <QtTest/QtTest> |
|
44 |
||
45 |
#include <qcoreapplication.h> |
|
46 |
#include <qdebug.h> |
|
47 |
#include <qfiledialog.h> |
|
48 |
#include <qabstractitemdelegate.h> |
|
49 |
#include <qdirmodel.h> |
|
50 |
#include <qitemdelegate.h> |
|
51 |
#include <qlistview.h> |
|
52 |
#include <qcombobox.h> |
|
53 |
#include <qpushbutton.h> |
|
54 |
#include <qtoolbutton.h> |
|
55 |
#include <qtreeview.h> |
|
56 |
#include <qheaderview.h> |
|
57 |
#include <qcompleter.h> |
|
58 |
#include <qaction.h> |
|
59 |
#include <qdialogbuttonbox.h> |
|
60 |
#include <qsortfilterproxymodel.h> |
|
61 |
#include <qlineedit.h> |
|
62 |
#include <qlayout.h> |
|
63 |
#include "../../shared/util.h" |
|
64 |
#include "../../../src/gui/dialogs/qsidebar_p.h" |
|
65 |
#include "../../../src/gui/dialogs/qfilesystemmodel_p.h" |
|
66 |
#include "../../../src/gui/dialogs/qfiledialog_p.h" |
|
67 |
||
68 |
#include "../network-settings.h" |
|
69 |
||
70 |
//TESTED_CLASS= |
|
71 |
//TESTED_FILES= |
|
72 |
||
73 |
#if defined(Q_OS_SYMBIAN) |
|
74 |
# define STRINGIFY(x) #x |
|
75 |
# define TOSTRING(x) STRINGIFY(x) |
|
76 |
# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/" |
|
77 |
#endif |
|
78 |
||
79 |
class QNonNativeFileDialog : public QFileDialog |
|
80 |
{ |
|
81 |
Q_OBJECT |
|
82 |
public: |
|
83 |
QNonNativeFileDialog(QWidget *parent = 0, const QString &caption = QString(), const QString &directory = QString(), const QString &filter = QString()) |
|
84 |
: QFileDialog(parent, caption, directory, filter) |
|
85 |
{ |
|
86 |
setOption(QFileDialog::DontUseNativeDialog, true); |
|
87 |
} |
|
88 |
}; |
|
89 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
90 |
class tst_QFileDialog2 : public QObject |
0 | 91 |
{ |
92 |
Q_OBJECT |
|
93 |
||
94 |
public: |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
95 |
tst_QFileDialog2(); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
96 |
virtual ~tst_QFileDialog2(); |
0 | 97 |
|
98 |
public slots: |
|
99 |
void init(); |
|
100 |
void cleanup(); |
|
101 |
||
102 |
private slots: |
|
103 |
void listRoot(); |
|
104 |
void heapCorruption(); |
|
105 |
void deleteDirAndFiles(); |
|
106 |
void filter(); |
|
107 |
void showNameFilterDetails(); |
|
108 |
void unc(); |
|
109 |
void emptyUncPath(); |
|
110 |
||
111 |
void task178897_minimumSize(); |
|
112 |
void task180459_lastDirectory_data(); |
|
113 |
void task180459_lastDirectory(); |
|
114 |
void task227304_proxyOnFileDialog(); |
|
115 |
void task227930_correctNavigationKeyboardBehavior(); |
|
116 |
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) |
|
117 |
void task226366_lowerCaseHardDriveWindows(); |
|
118 |
#endif |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
119 |
void completionOnLevelAfterRoot(); |
0 | 120 |
void task233037_selectingDirectory(); |
121 |
void task235069_hideOnEscape(); |
|
122 |
void task236402_dontWatchDeletedDir(); |
|
123 |
void task203703_returnProperSeparator(); |
|
124 |
void task228844_ensurePreviousSorting(); |
|
125 |
void task239706_editableFilterCombo(); |
|
126 |
void task218353_relativePaths(); |
|
127 |
void task251321_sideBarHiddenEntries(); |
|
128 |
void task251341_sideBarRemoveEntries(); |
|
129 |
void task254490_selectFileMultipleTimes(); |
|
130 |
void task257579_sideBarWithNonCleanUrls(); |
|
131 |
void task259105_filtersCornerCases(); |
|
132 |
||
133 |
void QTBUG4419_lineEditSelectAll(); |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
134 |
void QTBUG6558_showDirsOnly(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
135 |
void QTBUG4842_selectFilterWithHideNameFilterDetails(); |
0 | 136 |
|
137 |
private: |
|
138 |
QByteArray userSettings; |
|
139 |
}; |
|
140 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
141 |
tst_QFileDialog2::tst_QFileDialog2() |
0 | 142 |
{ |
143 |
#if defined(Q_OS_WINCE) |
|
144 |
qApp->setAutoMaximizeThreshold(-1); |
|
145 |
#endif |
|
146 |
} |
|
147 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
148 |
tst_QFileDialog2::~tst_QFileDialog2() |
0 | 149 |
{ |
150 |
} |
|
151 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
152 |
void tst_QFileDialog2::init() |
0 | 153 |
{ |
154 |
// Save the developers settings so they don't get mad when their sidebar folders are gone. |
|
155 |
QSettings settings(QSettings::UserScope, QLatin1String("Trolltech")); |
|
156 |
settings.beginGroup(QLatin1String("Qt")); |
|
157 |
userSettings = settings.value(QLatin1String("filedialog")).toByteArray(); |
|
158 |
settings.remove(QLatin1String("filedialog")); |
|
159 |
||
160 |
// populate it with some default settings |
|
161 |
QNonNativeFileDialog fd; |
|
162 |
#if defined(Q_OS_WINCE) |
|
163 |
QTest::qWait(1000); |
|
164 |
#endif |
|
165 |
} |
|
166 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
167 |
void tst_QFileDialog2::cleanup() |
0 | 168 |
{ |
169 |
QSettings settings(QSettings::UserScope, QLatin1String("Trolltech")); |
|
170 |
settings.beginGroup(QLatin1String("Qt")); |
|
171 |
settings.setValue(QLatin1String("filedialog"), userSettings); |
|
172 |
} |
|
173 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
174 |
void tst_QFileDialog2::listRoot() |
0 | 175 |
{ |
176 |
#if defined QT_BUILD_INTERNAL |
|
177 |
QFileInfoGatherer fileInfoGatherer; |
|
178 |
fileInfoGatherer.start(); |
|
179 |
QTest::qWait(1500); |
|
180 |
||
181 |
QFileInfoGatherer::fetchedRoot = false; |
|
182 |
QString dir(QDir::currentPath()); |
|
183 |
QNonNativeFileDialog fd(0, QString(), dir); |
|
184 |
fd.show(); |
|
185 |
QCOMPARE(QFileInfoGatherer::fetchedRoot,false); |
|
186 |
fd.setDirectory(""); |
|
187 |
#ifdef Q_OS_WINCE |
|
188 |
QTest::qWait(1500); |
|
189 |
#else |
|
190 |
QTest::qWait(500); |
|
191 |
#endif |
|
192 |
QCOMPARE(QFileInfoGatherer::fetchedRoot,true); |
|
193 |
#endif |
|
194 |
} |
|
195 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
196 |
void tst_QFileDialog2::heapCorruption() |
0 | 197 |
{ |
198 |
QVector<QNonNativeFileDialog*> dialogs; |
|
199 |
for (int i=0; i < 10; i++) { |
|
200 |
QNonNativeFileDialog *f = new QNonNativeFileDialog(NULL); |
|
201 |
dialogs << f; |
|
202 |
} |
|
203 |
qDeleteAll(dialogs); |
|
204 |
} |
|
205 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
206 |
struct FriendlyQFileDialog : public QNonNativeFileDialog |
0 | 207 |
{ |
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
208 |
friend class tst_QFileDialog2; |
0 | 209 |
Q_DECLARE_PRIVATE(QFileDialog) |
210 |
}; |
|
211 |
||
212 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
213 |
void tst_QFileDialog2::deleteDirAndFiles() |
0 | 214 |
{ |
215 |
#if defined QT_BUILD_INTERNAL |
|
216 |
QString tempPath = QDir::tempPath() + '/' + "QFileDialogTestDir4FullDelete"; |
|
217 |
QDir dir; |
|
218 |
QVERIFY(dir.mkpath(tempPath + "/foo")); |
|
219 |
QVERIFY(dir.mkpath(tempPath + "/foo/B")); |
|
220 |
QVERIFY(dir.mkpath(tempPath + "/foo/B")); |
|
221 |
QVERIFY(dir.mkpath(tempPath + "/foo/c")); |
|
222 |
QVERIFY(dir.mkpath(tempPath + "/bar")); |
|
223 |
QFile(tempPath + "/foo/a"); |
|
224 |
QTemporaryFile *t; |
|
225 |
t = new QTemporaryFile(tempPath + "/foo/aXXXXXX"); |
|
226 |
t->setAutoRemove(false); |
|
227 |
t->open(); |
|
228 |
t->close(); |
|
229 |
delete t; |
|
230 |
||
231 |
t = new QTemporaryFile(tempPath + "/foo/B/yXXXXXX"); |
|
232 |
t->setAutoRemove(false); |
|
233 |
t->open(); |
|
234 |
t->close(); |
|
235 |
delete t; |
|
236 |
FriendlyQFileDialog fd; |
|
237 |
fd.setOption(QFileDialog::DontUseNativeDialog); |
|
238 |
fd.d_func()->removeDirectory(tempPath); |
|
239 |
QFileInfo info(tempPath); |
|
240 |
QTest::qWait(2000); |
|
241 |
QVERIFY(!info.exists()); |
|
242 |
#endif |
|
243 |
} |
|
244 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
245 |
void tst_QFileDialog2::filter() |
0 | 246 |
{ |
247 |
QNonNativeFileDialog fd; |
|
248 |
QAction *hiddenAction = qFindChild<QAction*>(&fd, "qt_show_hidden_action"); |
|
249 |
QVERIFY(hiddenAction); |
|
250 |
QVERIFY(hiddenAction->isEnabled()); |
|
251 |
QVERIFY(!hiddenAction->isChecked()); |
|
252 |
QDir::Filters filter = fd.filter(); |
|
253 |
filter |= QDir::Hidden; |
|
254 |
fd.setFilter(filter); |
|
255 |
QVERIFY(hiddenAction->isChecked()); |
|
256 |
} |
|
257 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
258 |
void tst_QFileDialog2::showNameFilterDetails() |
0 | 259 |
{ |
260 |
QNonNativeFileDialog fd; |
|
261 |
QComboBox *filters = qFindChild<QComboBox*>(&fd, "fileTypeCombo"); |
|
262 |
QVERIFY(filters); |
|
263 |
QVERIFY(fd.isNameFilterDetailsVisible()); |
|
264 |
||
265 |
||
266 |
QStringList filterChoices; |
|
267 |
filterChoices << "Image files (*.png *.xpm *.jpg)" |
|
268 |
<< "Text files (*.txt)" |
|
269 |
<< "Any files (*.*)"; |
|
270 |
fd.setFilters(filterChoices); |
|
271 |
||
272 |
fd.setNameFilterDetailsVisible(false); |
|
273 |
QCOMPARE(filters->itemText(0), QString("Image files")); |
|
274 |
QCOMPARE(filters->itemText(1), QString("Text files")); |
|
275 |
QCOMPARE(filters->itemText(2), QString("Any files")); |
|
276 |
||
277 |
fd.setNameFilterDetailsVisible(true); |
|
278 |
QCOMPARE(filters->itemText(0), filterChoices.at(0)); |
|
279 |
QCOMPARE(filters->itemText(1), filterChoices.at(1)); |
|
280 |
QCOMPARE(filters->itemText(2), filterChoices.at(2)); |
|
281 |
} |
|
282 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
283 |
void tst_QFileDialog2::unc() |
0 | 284 |
{ |
285 |
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) |
|
286 |
// Only test UNC on Windows./ |
|
287 |
QString dir("\\\\" + QtNetworkSettings::winServerName() + "\\testsharewritable"); |
|
288 |
#else |
|
289 |
QString dir(QDir::currentPath()); |
|
290 |
#endif |
|
291 |
QVERIFY(QFile::exists(dir)); |
|
292 |
QNonNativeFileDialog fd(0, QString(), dir); |
|
293 |
QFileSystemModel *model = qFindChild<QFileSystemModel*>(&fd, "qt_filesystem_model"); |
|
294 |
QVERIFY(model); |
|
295 |
QCOMPARE(model->index(fd.directory().absolutePath()), model->index(dir)); |
|
296 |
} |
|
297 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
298 |
void tst_QFileDialog2::emptyUncPath() |
0 | 299 |
{ |
300 |
QNonNativeFileDialog fd; |
|
301 |
fd.show(); |
|
302 |
QLineEdit *lineEdit = qFindChild<QLineEdit*>(&fd, "fileNameEdit"); |
|
303 |
QVERIFY(lineEdit); |
|
304 |
// press 'keys' for the input |
|
305 |
for (int i = 0; i < 3 ; ++i) |
|
306 |
QTest::keyPress(lineEdit, Qt::Key_Backslash); |
|
307 |
QFileSystemModel *model = qFindChild<QFileSystemModel*>(&fd, "qt_filesystem_model"); |
|
308 |
QVERIFY(model); |
|
309 |
} |
|
310 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
311 |
void tst_QFileDialog2::task178897_minimumSize() |
0 | 312 |
{ |
313 |
QNonNativeFileDialog fd; |
|
314 |
QSize oldMs = fd.layout()->minimumSize(); |
|
315 |
QStringList history = fd.history(); |
|
316 |
history << QDir::toNativeSeparators("/verylongdirectory/" |
|
317 |
"aaaaaaaaaabbbbbbbbcccccccccccddddddddddddddeeeeeeeeeeeeffffffffffgggtggggggggghhhhhhhhiiiiiijjjk"); |
|
318 |
fd.setHistory(history); |
|
319 |
fd.show(); |
|
320 |
||
321 |
QSize ms = fd.layout()->minimumSize(); |
|
322 |
QVERIFY(ms.width() <= oldMs.width()); |
|
323 |
} |
|
324 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
325 |
void tst_QFileDialog2::task180459_lastDirectory_data() |
0 | 326 |
{ |
327 |
QTest::addColumn<QString>("path"); |
|
328 |
QTest::addColumn<QString>("directory"); |
|
329 |
QTest::addColumn<bool>("isEnabled"); |
|
330 |
QTest::addColumn<QString>("result"); |
|
331 |
||
332 |
QTest::newRow("path+file") << QDir::homePath() + QDir::separator() + "foo" |
|
333 |
<< QDir::homePath() << true |
|
334 |
<< QDir::homePath() + QDir::separator() + "foo" ; |
|
335 |
QTest::newRow("no path") << "" |
|
336 |
<< QDir::tempPath() << false << QString(); |
|
337 |
QTest::newRow("file") << "foo" |
|
338 |
<< QDir::currentPath() << true |
|
339 |
<< QDir::currentPath() + QDir::separator() + "foo" ; |
|
340 |
QTest::newRow("path") << QDir::homePath() |
|
341 |
<< QDir::homePath() << false << QString(); |
|
342 |
QTest::newRow("path not existing") << "/usr/bin/foo/bar/foo/foo.txt" |
|
343 |
<< QDir::tempPath() << true |
|
344 |
<< QDir::tempPath() + QDir::separator() + "foo.txt"; |
|
345 |
||
346 |
} |
|
347 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
348 |
void tst_QFileDialog2::task180459_lastDirectory() |
0 | 349 |
{ |
350 |
//first visit the temp directory and close the dialog |
|
351 |
QNonNativeFileDialog *dlg = new QNonNativeFileDialog(0, "", QDir::tempPath()); |
|
352 |
QFileSystemModel *model = qFindChild<QFileSystemModel*>(dlg, "qt_filesystem_model"); |
|
353 |
QVERIFY(model); |
|
354 |
QCOMPARE(model->index(QDir::tempPath()), model->index(dlg->directory().absolutePath())); |
|
355 |
delete dlg; |
|
356 |
||
357 |
QFETCH(QString, path); |
|
358 |
QFETCH(QString, directory); |
|
359 |
QFETCH(bool, isEnabled); |
|
360 |
QFETCH(QString, result); |
|
361 |
||
362 |
dlg = new QNonNativeFileDialog(0, "", path); |
|
363 |
model = qFindChild<QFileSystemModel*>(dlg, "qt_filesystem_model"); |
|
364 |
QVERIFY(model); |
|
365 |
dlg->setAcceptMode(QFileDialog::AcceptSave); |
|
366 |
QCOMPARE(model->index(dlg->directory().absolutePath()), model->index(directory)); |
|
367 |
||
368 |
QDialogButtonBox *buttonBox = qFindChild<QDialogButtonBox*>(dlg, "buttonBox"); |
|
369 |
QPushButton *button = buttonBox->button(QDialogButtonBox::Save); |
|
370 |
QVERIFY(button); |
|
371 |
QCOMPARE(button->isEnabled(), isEnabled); |
|
372 |
if (isEnabled) |
|
373 |
QCOMPARE(model->index(result), model->index(dlg->selectedFiles().first())); |
|
374 |
||
375 |
delete dlg; |
|
376 |
} |
|
377 |
||
378 |
||
379 |
||
380 |
class FilterDirModel : public QSortFilterProxyModel |
|
381 |
{ |
|
382 |
||
383 |
public: |
|
384 |
FilterDirModel(QString root, QObject* parent=0):QSortFilterProxyModel(parent), m_root(root) |
|
385 |
{} |
|
386 |
~FilterDirModel() |
|
387 |
{}; |
|
388 |
||
389 |
protected: |
|
390 |
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const |
|
391 |
{ |
|
392 |
QModelIndex parentIndex; |
|
393 |
parentIndex = source_parent; |
|
394 |
||
395 |
QString path; |
|
396 |
path = parentIndex.child(source_row,0).data(Qt::DisplayRole).toString(); |
|
397 |
||
398 |
do { |
|
399 |
path = parentIndex.data(Qt::DisplayRole).toString() + "/" + path; |
|
400 |
parentIndex = parentIndex.parent(); |
|
401 |
} while(parentIndex.isValid()); |
|
402 |
||
403 |
QFileInfo info(path); |
|
404 |
if (info.isDir() && (QDir(path) != m_root)) |
|
405 |
return false; |
|
406 |
return true; |
|
407 |
} |
|
408 |
||
409 |
||
410 |
private: |
|
411 |
QDir m_root; |
|
412 |
||
413 |
||
414 |
}; |
|
415 |
||
416 |
class sortProxy : public QSortFilterProxyModel |
|
417 |
{ |
|
418 |
public: |
|
419 |
sortProxy(QObject *parent) : QSortFilterProxyModel(parent) |
|
420 |
{ |
|
421 |
} |
|
422 |
protected: |
|
423 |
virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const |
|
424 |
{ |
|
425 |
QFileSystemModel * const model = qobject_cast<QFileSystemModel *>(sourceModel()); |
|
426 |
const QFileInfo leftInfo(model->fileInfo(left)); |
|
427 |
const QFileInfo rightInfo(model->fileInfo(right)); |
|
428 |
||
429 |
if (leftInfo.isDir() == rightInfo.isDir()) |
|
430 |
return(leftInfo.filePath().compare(rightInfo.filePath(),Qt::CaseInsensitive) < 0); |
|
431 |
else if (leftInfo.isDir()) |
|
432 |
return(false); |
|
433 |
else |
|
434 |
return(true); |
|
435 |
} |
|
436 |
}; |
|
437 |
||
438 |
class CrashDialog : public QNonNativeFileDialog |
|
439 |
{ |
|
440 |
Q_OBJECT |
|
441 |
||
442 |
public: |
|
443 |
CrashDialog(QWidget *parent, const QString &caption, const |
|
444 |
QString &dir, const QString &filter) |
|
445 |
: QNonNativeFileDialog(parent, caption, dir, filter) |
|
446 |
{ |
|
447 |
sortProxy *proxyModel = new sortProxy(this); |
|
448 |
setProxyModel(proxyModel); |
|
449 |
} |
|
450 |
}; |
|
451 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
452 |
void tst_QFileDialog2::task227304_proxyOnFileDialog() |
0 | 453 |
{ |
454 |
#if defined QT_BUILD_INTERNAL |
|
455 |
QNonNativeFileDialog fd(0, "", QDir::currentPath(), 0); |
|
456 |
fd.setProxyModel(new FilterDirModel(QDir::currentPath())); |
|
457 |
fd.show(); |
|
458 |
QLineEdit *edit = qFindChild<QLineEdit*>(&fd, "fileNameEdit"); |
|
459 |
QTest::qWait(200); |
|
460 |
QTest::keyClick(edit, Qt::Key_T); |
|
461 |
QTest::keyClick(edit, Qt::Key_S); |
|
462 |
QTest::qWait(200); |
|
463 |
QTest::keyClick(edit->completer()->popup(), Qt::Key_Down); |
|
464 |
||
465 |
CrashDialog *dialog = new CrashDialog(0, QString("crash dialog test"), QDir::homePath(), QString("*") ); |
|
466 |
dialog->setFileMode(QFileDialog::ExistingFile); |
|
467 |
dialog->show(); |
|
468 |
||
469 |
QListView *list = qFindChild<QListView*>(dialog, "listView"); |
|
470 |
QTest::qWait(200); |
|
471 |
QTest::keyClick(list, Qt::Key_Down); |
|
472 |
QTest::keyClick(list, Qt::Key_Return); |
|
473 |
QTest::qWait(200); |
|
474 |
||
475 |
dialog->close(); |
|
476 |
fd.close(); |
|
477 |
||
478 |
QNonNativeFileDialog fd2(0, "I should not crash with a proxy", QDir::tempPath(), 0); |
|
479 |
QSortFilterProxyModel *pm = new QSortFilterProxyModel; |
|
480 |
fd2.setProxyModel(pm); |
|
481 |
fd2.show(); |
|
482 |
QSidebar *sidebar = qFindChild<QSidebar*>(&fd2, "sidebar"); |
|
483 |
sidebar->setFocus(); |
|
484 |
sidebar->selectUrl(QUrl::fromLocalFile(QDir::homePath())); |
|
485 |
QTest::mouseClick(sidebar->viewport(), Qt::LeftButton, 0, sidebar->visualRect(sidebar->model()->index(1, 0)).center()); |
|
486 |
QTest::qWait(250); |
|
487 |
//We shouldn't crash |
|
488 |
#endif |
|
489 |
} |
|
490 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
491 |
void tst_QFileDialog2::task227930_correctNavigationKeyboardBehavior() |
0 | 492 |
{ |
493 |
QDir current = QDir::currentPath(); |
|
494 |
current.mkdir("test"); |
|
495 |
current.cd("test"); |
|
496 |
QFile file("test/out.txt"); |
|
497 |
QFile file2("test/out2.txt"); |
|
498 |
QVERIFY(file.open(QIODevice::WriteOnly | QIODevice::Text)); |
|
499 |
QVERIFY(file2.open(QIODevice::WriteOnly | QIODevice::Text)); |
|
500 |
current.cdUp(); |
|
501 |
current.mkdir("test2"); |
|
502 |
QNonNativeFileDialog fd; |
|
503 |
fd.setViewMode(QFileDialog::List); |
|
504 |
fd.setDirectory(current.absolutePath()); |
|
505 |
fd.show(); |
|
506 |
QListView *list = qFindChild<QListView*>(&fd, "listView"); |
|
507 |
QTest::qWait(200); |
|
508 |
QTest::keyClick(list, Qt::Key_Down); |
|
509 |
QTest::keyClick(list, Qt::Key_Return); |
|
510 |
QTest::qWait(200); |
|
511 |
QTest::mouseClick(list->viewport(), Qt::LeftButton,0); |
|
512 |
QTest::keyClick(list, Qt::Key_Down); |
|
513 |
QTest::keyClick(list, Qt::Key_Backspace); |
|
514 |
QTest::qWait(200); |
|
515 |
QTest::keyClick(list, Qt::Key_Down); |
|
516 |
QTest::keyClick(list, Qt::Key_Down); |
|
517 |
QTest::keyClick(list, Qt::Key_Return); |
|
518 |
QTest::qWait(200); |
|
519 |
QCOMPARE(fd.isVisible(), true); |
|
520 |
QTest::qWait(200); |
|
521 |
file.close(); |
|
522 |
file2.close(); |
|
523 |
file.remove(); |
|
524 |
file2.remove(); |
|
525 |
current.rmdir("test"); |
|
526 |
current.rmdir("test2"); |
|
527 |
} |
|
528 |
||
529 |
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
530 |
void tst_QFileDialog2::task226366_lowerCaseHardDriveWindows() |
0 | 531 |
{ |
532 |
QNonNativeFileDialog fd; |
|
533 |
fd.setDirectory(QDir::root().path()); |
|
534 |
fd.show(); |
|
535 |
QLineEdit *edit = qFindChild<QLineEdit*>(&fd, "fileNameEdit"); |
|
536 |
QToolButton *buttonParent = qFindChild<QToolButton*>(&fd, "toParentButton"); |
|
537 |
QTest::qWait(200); |
|
538 |
QTest::mouseClick(buttonParent, Qt::LeftButton,0,QPoint(0,0)); |
|
539 |
QTest::qWait(2000); |
|
540 |
QTest::keyClick(edit, Qt::Key_C); |
|
541 |
QTest::qWait(200); |
|
542 |
QTest::keyClick(edit->completer()->popup(), Qt::Key_Down); |
|
543 |
QTest::qWait(200); |
|
544 |
QCOMPARE(edit->text(), QString("C:")); |
|
545 |
QTest::qWait(2000); |
|
546 |
//i clear my previous selection in the completer |
|
547 |
QTest::keyClick(edit->completer()->popup(), Qt::Key_Down); |
|
548 |
edit->clear(); |
|
549 |
QTest::keyClick(edit, (char)(Qt::Key_C | Qt::SHIFT)); |
|
550 |
QTest::qWait(200); |
|
551 |
QTest::keyClick(edit->completer()->popup(), Qt::Key_Down); |
|
552 |
QCOMPARE(edit->text(), QString("C:")); |
|
553 |
} |
|
554 |
#endif |
|
555 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
556 |
void tst_QFileDialog2::completionOnLevelAfterRoot() |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
557 |
{ |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
558 |
QNonNativeFileDialog fd; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
559 |
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
560 |
fd.setDirectory("C:"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
561 |
QDir current = fd.directory(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
562 |
current.mkdir("completionOnLevelAfterRootTest"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
563 |
#else |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
564 |
fd.setFilter(QDir::Hidden | QDir::AllDirs | QDir::Files | QDir::System); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
565 |
fd.setDirectory("/"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
566 |
QDir etc("/etc"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
567 |
if (!etc.exists()) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
568 |
QSKIP("This test requires to have an etc directory under /", SkipAll); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
569 |
#endif |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
570 |
fd.show(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
571 |
QLineEdit *edit = qFindChild<QLineEdit*>(&fd, "fileNameEdit"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
572 |
QTest::qWait(2000); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
573 |
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
574 |
//I love testlib :D |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
575 |
QTest::keyClick(edit, Qt::Key_C); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
576 |
QTest::keyClick(edit, Qt::Key_O); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
577 |
QTest::keyClick(edit, Qt::Key_M); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
578 |
QTest::keyClick(edit, Qt::Key_P); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
579 |
QTest::keyClick(edit, Qt::Key_L); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
580 |
#else |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
581 |
QTest::keyClick(edit, Qt::Key_E); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
582 |
QTest::keyClick(edit, Qt::Key_T); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
583 |
#endif |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
584 |
QTest::qWait(200); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
585 |
QTest::keyClick(edit->completer()->popup(), Qt::Key_Down); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
586 |
QTest::qWait(200); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
587 |
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
588 |
QCOMPARE(edit->text(), QString("completionOnLevelAfterRootTest")); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
589 |
current.rmdir("completionOnLevelAfterRootTest"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
590 |
#else |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
591 |
QCOMPARE(edit->text(), QString("etc")); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
592 |
#endif |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
593 |
} |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
594 |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
595 |
void tst_QFileDialog2::task233037_selectingDirectory() |
0 | 596 |
{ |
597 |
QDir current = QDir::currentPath(); |
|
598 |
current.mkdir("test"); |
|
599 |
QNonNativeFileDialog fd; |
|
600 |
fd.setViewMode(QFileDialog::List); |
|
601 |
fd.setDirectory(current.absolutePath()); |
|
602 |
fd.setAcceptMode( QFileDialog::AcceptSave); |
|
603 |
fd.show(); |
|
604 |
QListView *list = qFindChild<QListView*>(&fd, "listView"); |
|
605 |
QTest::qWait(3000); // Wait for sort to settle (I need a signal). |
|
606 |
#ifdef QT_KEYPAD_NAVIGATION |
|
607 |
list->setEditFocus(true); |
|
608 |
#endif |
|
609 |
QTest::keyClick(list, Qt::Key_Down); |
|
610 |
QTest::qWait(100); |
|
611 |
QDialogButtonBox *buttonBox = qFindChild<QDialogButtonBox*>(&fd, "buttonBox"); |
|
612 |
QPushButton *button = buttonBox->button(QDialogButtonBox::Save); |
|
613 |
QVERIFY(button); |
|
614 |
QCOMPARE(button->isEnabled(), true); |
|
615 |
current.rmdir("test"); |
|
616 |
} |
|
617 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
618 |
void tst_QFileDialog2::task235069_hideOnEscape() |
0 | 619 |
{ |
620 |
QDir current = QDir::currentPath(); |
|
621 |
QNonNativeFileDialog fd; |
|
622 |
fd.setViewMode(QFileDialog::List); |
|
623 |
fd.setDirectory(current.absolutePath()); |
|
624 |
fd.setAcceptMode( QFileDialog::AcceptSave); |
|
625 |
fd.show(); |
|
626 |
QListView *list = qFindChild<QListView*>(&fd, "listView"); |
|
627 |
list->setFocus(); |
|
628 |
QTest::qWait(200); |
|
629 |
QTest::keyClick(list, Qt::Key_Escape); |
|
630 |
QCOMPARE(fd.isVisible(), false); |
|
631 |
QNonNativeFileDialog fd2; |
|
632 |
fd2.setDirectory(current.absolutePath()); |
|
633 |
fd2.setAcceptMode( QFileDialog::AcceptSave); |
|
634 |
fd2.show(); |
|
635 |
QLineEdit *edit = qFindChild<QLineEdit*>(&fd2, "fileNameEdit"); |
|
636 |
QTest::keyClick(edit, Qt::Key_Escape); |
|
637 |
QCOMPARE(fd2.isVisible(), false); |
|
638 |
} |
|
639 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
640 |
void tst_QFileDialog2::task236402_dontWatchDeletedDir() |
0 | 641 |
{ |
642 |
#if defined QT_BUILD_INTERNAL |
|
643 |
//THIS TEST SHOULD NOT DISPLAY WARNINGS |
|
644 |
QDir current = QDir::currentPath(); |
|
645 |
//make sure it is the first on the list |
|
646 |
current.mkdir("aaaaaaaaaa"); |
|
647 |
FriendlyQFileDialog fd; |
|
648 |
fd.setViewMode(QFileDialog::List); |
|
649 |
fd.setDirectory(current.absolutePath()); |
|
650 |
fd.setAcceptMode( QFileDialog::AcceptSave); |
|
651 |
fd.show(); |
|
652 |
QListView *list = qFindChild<QListView*>(&fd, "listView"); |
|
653 |
list->setFocus(); |
|
654 |
QTest::qWait(200); |
|
655 |
QTest::keyClick(list, Qt::Key_Return); |
|
656 |
QTest::qWait(200); |
|
657 |
QTest::keyClick(list, Qt::Key_Backspace); |
|
658 |
QTest::keyClick(list, Qt::Key_Down); |
|
659 |
QTest::qWait(200); |
|
660 |
fd.d_func()->removeDirectory(current.absolutePath() + "/aaaaaaaaaa/"); |
|
661 |
QTest::qWait(1000); |
|
662 |
#endif |
|
663 |
} |
|
664 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
665 |
void tst_QFileDialog2::task203703_returnProperSeparator() |
0 | 666 |
{ |
667 |
QDir current = QDir::currentPath(); |
|
668 |
current.mkdir("aaaaaaaaaaaaaaaaaa"); |
|
669 |
QNonNativeFileDialog fd; |
|
670 |
fd.setDirectory(current.absolutePath()); |
|
671 |
fd.setViewMode(QFileDialog::List); |
|
672 |
fd.setFileMode(QFileDialog::Directory); |
|
673 |
fd.show(); |
|
674 |
QTest::qWait(500); |
|
675 |
QListView *list = qFindChild<QListView*>(&fd, "listView"); |
|
676 |
list->setFocus(); |
|
677 |
QTest::qWait(200); |
|
678 |
QTest::keyClick(list, Qt::Key_Return); |
|
679 |
QTest::qWait(1000); |
|
680 |
QDialogButtonBox *buttonBox = qFindChild<QDialogButtonBox*>(&fd, "buttonBox"); |
|
681 |
QPushButton *button = buttonBox->button(QDialogButtonBox::Cancel); |
|
682 |
QTest::keyClick(button, Qt::Key_Return); |
|
683 |
QTest::qWait(500); |
|
684 |
QString result = fd.selectedFiles().first(); |
|
685 |
QVERIFY(result.at(result.count() - 1) != '/'); |
|
686 |
QVERIFY(!result.contains('\\')); |
|
687 |
current.rmdir("aaaaaaaaaaaaaaaaaa"); |
|
688 |
} |
|
689 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
690 |
void tst_QFileDialog2::task228844_ensurePreviousSorting() |
0 | 691 |
{ |
692 |
QDir current = QDir::currentPath(); |
|
693 |
current.mkdir("aaaaaaaaaaaaaaaaaa"); |
|
694 |
current.cd("aaaaaaaaaaaaaaaaaa"); |
|
695 |
current.mkdir("a"); |
|
696 |
current.mkdir("b"); |
|
697 |
current.mkdir("c"); |
|
698 |
current.mkdir("d"); |
|
699 |
current.mkdir("e"); |
|
700 |
current.mkdir("f"); |
|
701 |
current.mkdir("g"); |
|
702 |
QTemporaryFile *tempFile = new QTemporaryFile(current.absolutePath() + "/rXXXXXX"); |
|
703 |
tempFile->open(); |
|
704 |
current.cdUp(); |
|
705 |
||
706 |
QNonNativeFileDialog fd; |
|
707 |
fd.setDirectory(current.absolutePath()); |
|
708 |
fd.setViewMode(QFileDialog::Detail); |
|
709 |
fd.show(); |
|
710 |
#if defined(Q_OS_WINCE) |
|
711 |
QTest::qWait(1500); |
|
712 |
#else |
|
713 |
QTest::qWait(500); |
|
714 |
#endif |
|
715 |
QTreeView *tree = qFindChild<QTreeView*>(&fd, "treeView"); |
|
716 |
tree->header()->setSortIndicator(3,Qt::DescendingOrder); |
|
717 |
QTest::qWait(200); |
|
718 |
QDialogButtonBox *buttonBox = qFindChild<QDialogButtonBox*>(&fd, "buttonBox"); |
|
719 |
QPushButton *button = buttonBox->button(QDialogButtonBox::Open); |
|
720 |
QTest::mouseClick(button, Qt::LeftButton); |
|
721 |
#if defined(Q_OS_WINCE) |
|
722 |
QTest::qWait(1500); |
|
723 |
#else |
|
724 |
QTest::qWait(500); |
|
725 |
#endif |
|
726 |
QNonNativeFileDialog fd2; |
|
727 |
fd2.setFileMode(QFileDialog::Directory); |
|
728 |
fd2.restoreState(fd.saveState()); |
|
729 |
current.cd("aaaaaaaaaaaaaaaaaa"); |
|
730 |
fd2.setDirectory(current.absolutePath()); |
|
731 |
fd2.show(); |
|
732 |
#if defined(Q_OS_WINCE) |
|
733 |
QTest::qWait(1500); |
|
734 |
#else |
|
735 |
QTest::qWait(500); |
|
736 |
#endif |
|
737 |
QTreeView *tree2 = qFindChild<QTreeView*>(&fd2, "treeView"); |
|
738 |
tree2->setFocus(); |
|
739 |
||
740 |
QCOMPARE(tree2->rootIndex().data(QFileSystemModel::FilePathRole).toString(),current.absolutePath()); |
|
741 |
||
742 |
QDialogButtonBox *buttonBox2 = qFindChild<QDialogButtonBox*>(&fd2, "buttonBox"); |
|
743 |
QPushButton *button2 = buttonBox2->button(QDialogButtonBox::Open); |
|
744 |
fd2.selectFile("g"); |
|
745 |
QTest::mouseClick(button2, Qt::LeftButton); |
|
746 |
#if defined(Q_OS_WINCE) |
|
747 |
QTest::qWait(1500); |
|
748 |
#else |
|
749 |
QTest::qWait(500); |
|
750 |
#endif |
|
751 |
QCOMPARE(fd2.selectedFiles().first(), current.absolutePath() + QChar('/') + QLatin1String("g")); |
|
752 |
||
753 |
QNonNativeFileDialog fd3(0, "This is a third file dialog", tempFile->fileName()); |
|
754 |
fd3.restoreState(fd.saveState()); |
|
755 |
fd3.setFileMode(QFileDialog::Directory); |
|
756 |
fd3.show(); |
|
757 |
#if defined(Q_OS_WINCE) |
|
758 |
QTest::qWait(1500); |
|
759 |
#else |
|
760 |
QTest::qWait(500); |
|
761 |
#endif |
|
762 |
QTreeView *tree3 = qFindChild<QTreeView*>(&fd3, "treeView"); |
|
763 |
tree3->setFocus(); |
|
764 |
||
765 |
QCOMPARE(tree3->rootIndex().data(QFileSystemModel::FilePathRole).toString(), current.absolutePath()); |
|
766 |
||
767 |
QDialogButtonBox *buttonBox3 = qFindChild<QDialogButtonBox*>(&fd3, "buttonBox"); |
|
768 |
QPushButton *button3 = buttonBox3->button(QDialogButtonBox::Open); |
|
769 |
QTest::mouseClick(button3, Qt::LeftButton); |
|
770 |
#if defined(Q_OS_WINCE) |
|
771 |
QTest::qWait(1500); |
|
772 |
#else |
|
773 |
QTest::qWait(500); |
|
774 |
#endif |
|
775 |
QCOMPARE(fd3.selectedFiles().first(), tempFile->fileName()); |
|
776 |
||
777 |
current.cd("aaaaaaaaaaaaaaaaaa"); |
|
778 |
current.rmdir("a"); |
|
779 |
current.rmdir("b"); |
|
780 |
current.rmdir("c"); |
|
781 |
current.rmdir("d"); |
|
782 |
current.rmdir("e"); |
|
783 |
current.rmdir("f"); |
|
784 |
current.rmdir("g"); |
|
785 |
tempFile->close(); |
|
786 |
delete tempFile; |
|
787 |
current.cdUp(); |
|
788 |
current.rmdir("aaaaaaaaaaaaaaaaaa"); |
|
789 |
} |
|
790 |
||
791 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
792 |
void tst_QFileDialog2::task239706_editableFilterCombo() |
0 | 793 |
{ |
794 |
QNonNativeFileDialog d; |
|
795 |
d.setNameFilter("*.cpp *.h"); |
|
796 |
||
797 |
d.show(); |
|
798 |
QTest::qWait(500); |
|
799 |
||
800 |
QList<QComboBox *> comboList = d.findChildren<QComboBox *>(); |
|
801 |
QComboBox *filterCombo = 0; |
|
802 |
foreach (QComboBox *combo, comboList) { |
|
803 |
if (combo->objectName() == QString("fileTypeCombo")) { |
|
804 |
filterCombo = combo; |
|
805 |
break; |
|
806 |
} |
|
807 |
} |
|
808 |
Q_ASSERT(filterCombo); |
|
809 |
filterCombo->setEditable(true); |
|
810 |
QTest::mouseClick(filterCombo, Qt::LeftButton); |
|
811 |
QTest::keyPress(filterCombo, Qt::Key_X); |
|
812 |
QTest::keyPress(filterCombo, Qt::Key_Enter); // should not trigger assertion failure |
|
813 |
} |
|
814 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
815 |
void tst_QFileDialog2::task218353_relativePaths() |
0 | 816 |
{ |
817 |
QDir appDir = QDir::current(); |
|
818 |
QVERIFY(appDir.cdUp() != false); |
|
819 |
QNonNativeFileDialog d(0, "TestDialog", ".."); |
|
820 |
QCOMPARE(d.directory().absolutePath(), appDir.absolutePath()); |
|
821 |
||
822 |
d.setDirectory(appDir.absolutePath() + QLatin1String("/non-existing-directory/../another-non-existing-dir/../")); |
|
823 |
QCOMPARE(d.directory().absolutePath(), appDir.absolutePath()); |
|
824 |
||
825 |
QDir::current().mkdir("test"); |
|
826 |
appDir = QDir::current(); |
|
827 |
d.setDirectory(appDir.absolutePath() + QLatin1String("/test/../test/../")); |
|
828 |
QCOMPARE(d.directory().absolutePath(), appDir.absolutePath()); |
|
829 |
appDir.rmdir("test"); |
|
830 |
} |
|
831 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
832 |
void tst_QFileDialog2::task251321_sideBarHiddenEntries() |
0 | 833 |
{ |
834 |
#if defined QT_BUILD_INTERNAL |
|
835 |
QNonNativeFileDialog fd; |
|
836 |
||
837 |
QDir current = QDir::currentPath(); |
|
838 |
current.mkdir(".hidden"); |
|
839 |
QDir hiddenDir = QDir(".hidden"); |
|
840 |
hiddenDir.mkdir("subdir"); |
|
841 |
QDir hiddenSubDir = QDir(".hidden/subdir"); |
|
842 |
hiddenSubDir.mkdir("happy"); |
|
843 |
hiddenSubDir.mkdir("happy2"); |
|
844 |
||
845 |
QList<QUrl> urls; |
|
846 |
urls << QUrl::fromLocalFile(hiddenSubDir.absolutePath()); |
|
847 |
fd.setSidebarUrls(urls); |
|
848 |
fd.show(); |
|
849 |
QTest::qWait(250); |
|
850 |
||
851 |
QSidebar *sidebar = qFindChild<QSidebar*>(&fd, "sidebar"); |
|
852 |
sidebar->setFocus(); |
|
853 |
sidebar->selectUrl(QUrl::fromLocalFile(hiddenSubDir.absolutePath())); |
|
854 |
QTest::mouseClick(sidebar->viewport(), Qt::LeftButton, 0, sidebar->visualRect(sidebar->model()->index(0, 0)).center()); |
|
855 |
// give the background processes more time on windows mobile |
|
856 |
#ifdef Q_OS_WINCE |
|
857 |
QTest::qWait(1000); |
|
858 |
#else |
|
859 |
QTest::qWait(250); |
|
860 |
#endif |
|
861 |
||
862 |
QFileSystemModel *model = qFindChild<QFileSystemModel*>(&fd, "qt_filesystem_model"); |
|
863 |
QCOMPARE(model->rowCount(model->index(hiddenSubDir.absolutePath())), 2); |
|
864 |
||
865 |
hiddenSubDir.rmdir("happy2"); |
|
866 |
hiddenSubDir.rmdir("happy"); |
|
867 |
hiddenDir.rmdir("subdir"); |
|
868 |
current.rmdir(".hidden"); |
|
869 |
#endif |
|
870 |
} |
|
871 |
||
872 |
#if defined QT_BUILD_INTERNAL |
|
873 |
class MyQSideBar : public QSidebar |
|
874 |
{ |
|
875 |
public : |
|
876 |
MyQSideBar(QWidget *parent = 0) : QSidebar(parent) |
|
877 |
{} |
|
878 |
||
879 |
void removeSelection() { |
|
880 |
QList<QModelIndex> idxs = selectionModel()->selectedIndexes(); |
|
881 |
QList<QPersistentModelIndex> indexes; |
|
882 |
for (int i = 0; i < idxs.count(); i++) |
|
883 |
indexes.append(idxs.at(i)); |
|
884 |
||
885 |
for (int i = 0; i < indexes.count(); ++i) |
|
886 |
if (!indexes.at(i).data(Qt::UserRole + 1).toUrl().path().isEmpty()) |
|
887 |
model()->removeRow(indexes.at(i).row()); |
|
888 |
} |
|
889 |
}; |
|
890 |
#endif |
|
891 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
892 |
void tst_QFileDialog2::task251341_sideBarRemoveEntries() |
0 | 893 |
{ |
894 |
#if defined QT_BUILD_INTERNAL |
|
895 |
QNonNativeFileDialog fd; |
|
896 |
||
897 |
QDir current = QDir::currentPath(); |
|
898 |
current.mkdir("testDir"); |
|
899 |
QDir testSubDir = QDir("testDir"); |
|
900 |
||
901 |
QList<QUrl> urls; |
|
902 |
urls << QUrl::fromLocalFile(testSubDir.absolutePath()); |
|
903 |
urls << QUrl::fromLocalFile("NotFound"); |
|
904 |
fd.setSidebarUrls(urls); |
|
905 |
fd.show(); |
|
906 |
QTest::qWait(250); |
|
907 |
||
908 |
QSidebar *sidebar = qFindChild<QSidebar*>(&fd, "sidebar"); |
|
909 |
sidebar->setFocus(); |
|
910 |
//We enter in the first bookmark |
|
911 |
sidebar->selectUrl(QUrl::fromLocalFile(testSubDir.absolutePath())); |
|
912 |
QTest::mouseClick(sidebar->viewport(), Qt::LeftButton, 0, sidebar->visualRect(sidebar->model()->index(0, 0)).center()); |
|
913 |
QTest::qWait(250); |
|
914 |
||
915 |
QFileSystemModel *model = qFindChild<QFileSystemModel*>(&fd, "qt_filesystem_model"); |
|
916 |
//There is no file |
|
917 |
QCOMPARE(model->rowCount(model->index(testSubDir.absolutePath())), 0); |
|
918 |
//Icon is not enabled QUrlModel::EnabledRole |
|
919 |
QVariant value = sidebar->model()->index(0, 0).data(Qt::UserRole + 2); |
|
920 |
QCOMPARE(qvariant_cast<bool>(value), true); |
|
921 |
||
922 |
sidebar->setFocus(); |
|
923 |
//We enter in the second bookmark which is invalid |
|
924 |
sidebar->selectUrl(QUrl::fromLocalFile("NotFound")); |
|
925 |
QTest::mouseClick(sidebar->viewport(), Qt::LeftButton, 0, sidebar->visualRect(sidebar->model()->index(1, 0)).center()); |
|
926 |
QTest::qWait(250); |
|
927 |
||
928 |
//We fallback to root because the entry in the bookmark is invalid |
|
929 |
QCOMPARE(model->rowCount(model->index("NotFound")), model->rowCount(model->index(model->rootPath()))); |
|
930 |
//Icon is not enabled QUrlModel::EnabledRole |
|
931 |
value = sidebar->model()->index(1, 0).data(Qt::UserRole + 2); |
|
932 |
QCOMPARE(qvariant_cast<bool>(value), false); |
|
933 |
||
934 |
MyQSideBar mySideBar; |
|
935 |
mySideBar.init(model, urls); |
|
936 |
mySideBar.show(); |
|
937 |
mySideBar.selectUrl(QUrl::fromLocalFile(testSubDir.absolutePath())); |
|
938 |
QTest::qWait(1000); |
|
939 |
mySideBar.removeSelection(); |
|
940 |
||
941 |
//We remove the first entry |
|
942 |
QList<QUrl> expected; |
|
943 |
expected << QUrl::fromLocalFile("NotFound"); |
|
944 |
QCOMPARE(mySideBar.urls(), expected); |
|
945 |
||
946 |
mySideBar.selectUrl(QUrl::fromLocalFile("NotFound")); |
|
947 |
mySideBar.removeSelection(); |
|
948 |
||
949 |
//We remove the second entry |
|
950 |
expected.clear(); |
|
951 |
QCOMPARE(mySideBar.urls(), expected); |
|
952 |
||
953 |
current.rmdir("testDir"); |
|
954 |
#endif |
|
955 |
} |
|
956 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
957 |
void tst_QFileDialog2::task254490_selectFileMultipleTimes() |
0 | 958 |
{ |
959 |
QString tempPath = QDir::tempPath(); |
|
960 |
QTemporaryFile *t; |
|
961 |
t = new QTemporaryFile; |
|
962 |
t->open(); |
|
963 |
QNonNativeFileDialog fd(0, "TestFileDialog"); |
|
964 |
||
965 |
fd.setDirectory(tempPath); |
|
966 |
fd.setViewMode(QFileDialog::List); |
|
967 |
fd.setAcceptMode(QFileDialog::AcceptSave); |
|
968 |
fd.setFileMode(QFileDialog::AnyFile); |
|
969 |
||
970 |
//This should select the file in the QFileDialog |
|
971 |
fd.selectFile(t->fileName()); |
|
972 |
||
973 |
//This should clear the selection and write it into the filename line edit |
|
974 |
fd.selectFile("new_file.txt"); |
|
975 |
||
976 |
fd.show(); |
|
977 |
QTest::qWait(250); |
|
978 |
||
979 |
QLineEdit *lineEdit = qFindChild<QLineEdit*>(&fd, "fileNameEdit"); |
|
980 |
QVERIFY(lineEdit); |
|
981 |
QCOMPARE(lineEdit->text(),QLatin1String("new_file.txt")); |
|
982 |
QListView *list = qFindChild<QListView*>(&fd, "listView"); |
|
983 |
QVERIFY(list); |
|
984 |
QCOMPARE(list->selectionModel()->selectedRows(0).count(), 0); |
|
985 |
||
986 |
t->deleteLater(); |
|
987 |
} |
|
988 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
989 |
void tst_QFileDialog2::task257579_sideBarWithNonCleanUrls() |
0 | 990 |
{ |
991 |
#if defined QT_BUILD_INTERNAL |
|
992 |
QDir tempDir = QDir::temp(); |
|
993 |
QLatin1String dirname("autotest_task257579"); |
|
994 |
tempDir.rmdir(dirname); //makes sure it doesn't exist any more |
|
995 |
QVERIFY(tempDir.mkdir(dirname)); |
|
996 |
QString url = QString::fromLatin1("%1/%2/..").arg(tempDir.absolutePath()).arg(dirname); |
|
997 |
QNonNativeFileDialog fd; |
|
998 |
fd.setSidebarUrls(QList<QUrl>() << QUrl::fromLocalFile(url)); |
|
999 |
QSidebar *sidebar = qFindChild<QSidebar*>(&fd, "sidebar"); |
|
1000 |
QCOMPARE(sidebar->urls().count(), 1); |
|
1001 |
QVERIFY(sidebar->urls().first().toLocalFile() != url); |
|
1002 |
QCOMPARE(sidebar->urls().first().toLocalFile(), QDir::cleanPath(url)); |
|
1003 |
||
1004 |
#ifdef Q_OS_WIN |
|
1005 |
QCOMPARE(sidebar->model()->index(0,0).data().toString().toLower(), tempDir.dirName().toLower()); |
|
1006 |
#else |
|
1007 |
QCOMPARE(sidebar->model()->index(0,0).data().toString(), tempDir.dirName()); |
|
1008 |
#endif |
|
1009 |
||
1010 |
//all tests are finished, we can remove the temporary dir |
|
1011 |
QVERIFY(tempDir.rmdir(dirname)); |
|
1012 |
#endif |
|
1013 |
} |
|
1014 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1015 |
void tst_QFileDialog2::task259105_filtersCornerCases() |
0 | 1016 |
{ |
1017 |
QNonNativeFileDialog fd(0, "TestFileDialog"); |
|
1018 |
fd.setNameFilter(QLatin1String("All Files! (*);;Text Files (*.txt)")); |
|
1019 |
fd.setOption(QFileDialog::HideNameFilterDetails, true); |
|
1020 |
fd.show(); |
|
1021 |
QTest::qWait(250); |
|
1022 |
||
1023 |
//Extensions are hidden |
|
1024 |
QComboBox *filters = qFindChild<QComboBox*>(&fd, "fileTypeCombo"); |
|
1025 |
QVERIFY(filters); |
|
1026 |
QCOMPARE(filters->currentText(), QLatin1String("All Files!")); |
|
1027 |
filters->setCurrentIndex(1); |
|
1028 |
QCOMPARE(filters->currentText(), QLatin1String("Text Files")); |
|
1029 |
||
1030 |
//We should have the full names |
|
1031 |
fd.setOption(QFileDialog::HideNameFilterDetails, false); |
|
1032 |
QTest::qWait(250); |
|
1033 |
filters->setCurrentIndex(0); |
|
1034 |
QCOMPARE(filters->currentText(), QLatin1String("All Files! (*)")); |
|
1035 |
filters->setCurrentIndex(1); |
|
1036 |
QCOMPARE(filters->currentText(), QLatin1String("Text Files (*.txt)")); |
|
1037 |
||
1038 |
//Corner case undocumented of the task |
|
1039 |
fd.setNameFilter(QLatin1String("\352 (I like cheese) All Files! (*);;Text Files (*.txt)")); |
|
1040 |
QCOMPARE(filters->currentText(), QLatin1String("\352 (I like cheese) All Files! (*)")); |
|
1041 |
filters->setCurrentIndex(1); |
|
1042 |
QCOMPARE(filters->currentText(), QLatin1String("Text Files (*.txt)")); |
|
1043 |
||
1044 |
fd.setOption(QFileDialog::HideNameFilterDetails, true); |
|
1045 |
filters->setCurrentIndex(0); |
|
1046 |
QTest::qWait(500); |
|
1047 |
QCOMPARE(filters->currentText(), QLatin1String("\352 (I like cheese) All Files!")); |
|
1048 |
filters->setCurrentIndex(1); |
|
1049 |
QCOMPARE(filters->currentText(), QLatin1String("Text Files")); |
|
1050 |
||
1051 |
fd.setOption(QFileDialog::HideNameFilterDetails, true); |
|
1052 |
filters->setCurrentIndex(0); |
|
1053 |
QTest::qWait(500); |
|
1054 |
QCOMPARE(filters->currentText(), QLatin1String("\352 (I like cheese) All Files!")); |
|
1055 |
filters->setCurrentIndex(1); |
|
1056 |
QCOMPARE(filters->currentText(), QLatin1String("Text Files")); |
|
1057 |
} |
|
1058 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1059 |
void tst_QFileDialog2::QTBUG4419_lineEditSelectAll() |
0 | 1060 |
{ |
1061 |
QString tempPath = QDir::tempPath(); |
|
1062 |
QTemporaryFile *t; |
|
1063 |
t = new QTemporaryFile; |
|
1064 |
t->open(); |
|
1065 |
QNonNativeFileDialog fd(0, "TestFileDialog", t->fileName()); |
|
1066 |
||
1067 |
fd.setDirectory(tempPath); |
|
1068 |
fd.setViewMode(QFileDialog::List); |
|
1069 |
fd.setAcceptMode(QFileDialog::AcceptSave); |
|
1070 |
fd.setFileMode(QFileDialog::AnyFile); |
|
1071 |
||
1072 |
fd.show(); |
|
1073 |
QApplication::setActiveWindow(&fd); |
|
1074 |
QTest::qWaitForWindowShown(&fd); |
|
1075 |
QTRY_COMPARE(fd.isVisible(), true); |
|
1076 |
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd)); |
|
1077 |
||
1078 |
QTest::qWait(250); |
|
1079 |
QLineEdit *lineEdit = qFindChild<QLineEdit*>(&fd, "fileNameEdit"); |
|
1080 |
||
1081 |
QCOMPARE(tempPath + QChar('/') + lineEdit->text(), t->fileName()); |
|
1082 |
QCOMPARE(tempPath + QChar('/') + lineEdit->selectedText(), t->fileName()); |
|
1083 |
} |
|
1084 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1085 |
void tst_QFileDialog2::QTBUG6558_showDirsOnly() |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1086 |
{ |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1087 |
const QString tempPath = QDir::tempPath(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1088 |
QDir dirTemp(tempPath); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1089 |
const QString tempName = QLatin1String("showDirsOnly.") + QString::number(qrand()); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1090 |
dirTemp.mkdir(tempName); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1091 |
dirTemp.cd(tempName); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1092 |
QTRY_VERIFY(dirTemp.exists()); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1093 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1094 |
const QString dirPath = dirTemp.absolutePath(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1095 |
QDir dir(dirPath); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1096 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1097 |
//We create two dirs |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1098 |
dir.mkdir("a"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1099 |
dir.mkdir("b"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1100 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1101 |
//Create a file |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1102 |
QFile tempFile(dirPath + "/plop.txt"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1103 |
tempFile.open(QIODevice::WriteOnly | QIODevice::Text); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1104 |
QTextStream out(&tempFile); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1105 |
out << "The magic number is: " << 49 << "\n"; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1106 |
tempFile.close(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1107 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1108 |
QNonNativeFileDialog fd(0, "TestFileDialog"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1109 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1110 |
fd.setDirectory(dir.absolutePath()); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1111 |
fd.setViewMode(QFileDialog::List); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1112 |
fd.setAcceptMode(QFileDialog::AcceptSave); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1113 |
fd.setOption(QFileDialog::ShowDirsOnly, true); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1114 |
fd.show(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1115 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1116 |
QApplication::setActiveWindow(&fd); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1117 |
QTest::qWaitForWindowShown(&fd); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1118 |
QTRY_COMPARE(fd.isVisible(), true); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1119 |
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd)); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1120 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1121 |
QFileSystemModel *model = qFindChild<QFileSystemModel*>(&fd, "qt_filesystem_model"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1122 |
QTRY_COMPARE(model->rowCount(model->index(dir.absolutePath())), 2); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1123 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1124 |
fd.setOption(QFileDialog::ShowDirsOnly, false); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1125 |
QTRY_COMPARE(model->rowCount(model->index(dir.absolutePath())), 3); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1126 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1127 |
fd.setOption(QFileDialog::ShowDirsOnly, true); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1128 |
QTRY_COMPARE(model->rowCount(model->index(dir.absolutePath())), 2); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1129 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1130 |
fd.setFileMode(QFileDialog::DirectoryOnly); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1131 |
QTRY_COMPARE(model->rowCount(model->index(dir.absolutePath())), 2); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1132 |
QTRY_COMPARE(bool(fd.options() & QFileDialog::ShowDirsOnly), true); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1133 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1134 |
fd.setFileMode(QFileDialog::AnyFile); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1135 |
QTRY_COMPARE(model->rowCount(model->index(dir.absolutePath())), 3); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1136 |
QTRY_COMPARE(bool(fd.options() & QFileDialog::ShowDirsOnly), false); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1137 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1138 |
fd.setDirectory(QDir::homePath()); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1139 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1140 |
//We remove the dirs |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1141 |
dir.rmdir("a"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1142 |
dir.rmdir("b"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1143 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1144 |
//we delete the file |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1145 |
tempFile.remove(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1146 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1147 |
dirTemp.cdUp(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1148 |
dirTemp.rmdir(tempName); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1149 |
} |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1150 |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1151 |
void tst_QFileDialog2::QTBUG4842_selectFilterWithHideNameFilterDetails() |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1152 |
{ |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1153 |
QStringList filtersStr; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1154 |
filtersStr << "Images (*.png *.xpm *.jpg)" << "Text files (*.txt)" << "XML files (*.xml)"; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1155 |
QString chosenFilterString("Text files (*.txt)"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1156 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1157 |
QNonNativeFileDialog fd(0, "TestFileDialog"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1158 |
fd.setAcceptMode(QFileDialog::AcceptSave); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1159 |
fd.setOption(QFileDialog::HideNameFilterDetails, true); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1160 |
fd.setNameFilters(filtersStr); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1161 |
fd.selectNameFilter(chosenFilterString); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1162 |
fd.show(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1163 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1164 |
QApplication::setActiveWindow(&fd); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1165 |
QTest::qWaitForWindowShown(&fd); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1166 |
QTRY_COMPARE(fd.isVisible(), true); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1167 |
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd)); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1168 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1169 |
QComboBox *filters = qFindChild<QComboBox*>(&fd, "fileTypeCombo"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1170 |
//We compare the current combobox text with the stripped version |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1171 |
QCOMPARE(filters->currentText(), QString("Text files")); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1172 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1173 |
QNonNativeFileDialog fd2(0, "TestFileDialog"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1174 |
fd2.setAcceptMode(QFileDialog::AcceptSave); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1175 |
fd2.setOption(QFileDialog::HideNameFilterDetails, false); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1176 |
fd2.setNameFilters(filtersStr); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1177 |
fd2.selectNameFilter(chosenFilterString); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1178 |
fd2.show(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1179 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1180 |
QApplication::setActiveWindow(&fd2); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1181 |
QTest::qWaitForWindowShown(&fd2); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1182 |
QTRY_COMPARE(fd2.isVisible(), true); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1183 |
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd2)); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1184 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1185 |
QComboBox *filters2 = qFindChild<QComboBox*>(&fd2, "fileTypeCombo"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1186 |
//We compare the current combobox text with the non stripped version |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1187 |
QCOMPARE(filters2->currentText(), chosenFilterString); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1188 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1189 |
} |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1190 |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1191 |
QTEST_MAIN(tst_QFileDialog2) |
0 | 1192 |
#include "tst_qfiledialog2.moc" |