kernel/qplatformdialoghelper.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtGui module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
9** Commercial License Usage -
10** Licensees holding valid commercial Qt licenses may use this file in -
11** accordance with the commercial license agreement provided with the -
12** Software or, alternatively, in accordance with the terms contained in -
13** a written agreement between you and Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42#include "qplatformdialoghelper.h" -
43 -
44#include <QtCore/QVariant> -
45#include <QtCore/QSharedData> -
46#include <QtCore/QSettings> -
47#include <QtCore/QHash> -
48#include <QtCore/QUrl> -
49#include <QtGui/QColor> -
50 -
51QT_BEGIN_NAMESPACE -
52 -
53/*! -
54 \class QPlatformDialogHelper -
55 \since 5.0 -
56 \internal -
57 \ingroup qpa -
58 -
59 \brief The QPlatformDialogHelper class allows for platform-specific customization of dialogs. -
60 -
61*/ -
62 -
63/*! -
64 \enum QPlatformDialogHelper::StyleHint -
65 -
66 This enum type specifies platform-specific style hints. -
67 -
68 \value SnapToDefaultButton Snap the mouse to the center of the default -
69 button. There is corresponding system -
70 setting on Windows. -
71 -
72 \sa styleHint() -
73*/ -
74 -
75QPlatformDialogHelper::QPlatformDialogHelper() -
76{ -
77} -
78 -
79QPlatformDialogHelper::~QPlatformDialogHelper() -
80{ -
81} -
82 -
83QVariant QPlatformDialogHelper::styleHint(StyleHint hint) const -
84{ -
85 return QPlatformDialogHelper::defaultStyleHint(hint);
never executed: return QPlatformDialogHelper::defaultStyleHint(hint);
0
86} -
87 -
88QVariant QPlatformDialogHelper::defaultStyleHint(QPlatformDialogHelper::StyleHint hint) -
89{ -
90 switch (hint) { -
91 case QPlatformDialogHelper::SnapToDefaultButton: -
92 return QVariant(false);
never executed: return QVariant(false);
0
93 } -
94 return QVariant();
never executed: return QVariant();
0
95} -
96 -
97// Font dialog -
98 -
99class QFontDialogOptionsPrivate : public QSharedData -
100{ -
101public: -
102 QFontDialogOptionsPrivate() : options(0) {}
executed: }
Execution Count:3
3
103 -
104 QFontDialogOptions::FontDialogOptions options; -
105 QString windowTitle; -
106}; -
107 -
108QFontDialogOptions::QFontDialogOptions() : d(new QFontDialogOptionsPrivate) -
109{ -
110}
executed: }
Execution Count:3
3
111 -
112QFontDialogOptions::QFontDialogOptions(const QFontDialogOptions &rhs) : d(rhs.d) -
113{ -
114}
never executed: }
0
115 -
116QFontDialogOptions &QFontDialogOptions::operator=(const QFontDialogOptions &rhs) -
117{ -
118 if (this != &rhs)
never evaluated: this != &rhs
0
119 d = rhs.d;
never executed: d = rhs.d;
0
120 return *this;
never executed: return *this;
0
121} -
122 -
123QFontDialogOptions::~QFontDialogOptions() -
124{ -
125} -
126 -
127QString QFontDialogOptions::windowTitle() const -
128{ -
129 return d->windowTitle;
never executed: return d->windowTitle;
0
130} -
131 -
132void QFontDialogOptions::setWindowTitle(const QString &title) -
133{ -
134 d->windowTitle = title;
never executed (the execution status of this line is deduced): d->windowTitle = title;
-
135}
never executed: }
0
136 -
137void QFontDialogOptions::setOption(QFontDialogOptions::FontDialogOption option, bool on) -
138{ -
139 if (!(d->options & option) != !on)
never evaluated: !(d->options & option) != !on
0
140 setOptions(d->options ^ option);
never executed: setOptions(d->options ^ option);
0
141}
never executed: }
0
142 -
143bool QFontDialogOptions::testOption(QFontDialogOptions::FontDialogOption option) const -
144{ -
145 return d->options & option;
never executed: return d->options & option;
0
146} -
147 -
148void QFontDialogOptions::setOptions(FontDialogOptions options) -
149{ -
150 if (options != d->options)
partially evaluated: options != d->options
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
151 d->options = options;
executed: d->options = options;
Execution Count:1
1
152}
executed: }
Execution Count:1
1
153 -
154QFontDialogOptions::FontDialogOptions QFontDialogOptions::options() const -
155{ -
156 return d->options;
executed: return d->options;
Execution Count:103
103
157} -
158 -
159/*! -
160 \class QPlatformFontDialogHelper -
161 \since 5.0 -
162 \internal -
163 \ingroup qpa -
164 -
165 \brief The QPlatformFontDialogHelper class allows for platform-specific customization of font dialogs. -
166 -
167*/ -
168const QSharedPointer<QFontDialogOptions> &QPlatformFontDialogHelper::options() const -
169{ -
170 return m_options;
never executed: return m_options;
0
171} -
172 -
173void QPlatformFontDialogHelper::setOptions(const QSharedPointer<QFontDialogOptions> &options) -
174{ -
175 m_options = options;
never executed (the execution status of this line is deduced): m_options = options;
-
176}
never executed: }
0
177 -
178// Color dialog -
179 -
180class QColorDialogStaticData -
181{ -
182public: -
183 enum { CustomColorCount = 16, StandardColorCount = 6 * 8 }; -
184 -
185 QColorDialogStaticData(); -
186 inline void readSettings(); -
187 inline void writeSettings() const; -
188 -
189 QRgb customRgb[CustomColorCount]; -
190 QRgb standardRgb[StandardColorCount]; -
191 bool customSet; -
192}; -
193 -
194QColorDialogStaticData::QColorDialogStaticData() : customSet(false) -
195{ -
196 int i = 0;
executed (the execution status of this line is deduced): int i = 0;
-
197 for (int g = 0; g < 4; ++g)
evaluated: g < 4
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:1
1-4
198 for (int r = 0; r < 4; ++r)
evaluated: r < 4
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:4
4-16
199 for (int b = 0; b < 3; ++b)
evaluated: b < 3
TRUEFALSE
yes
Evaluation Count:48
yes
Evaluation Count:16
16-48
200 standardRgb[i++] = qRgb(r * 255 / 3, g * 255 / 3, b * 255 / 2);
executed: standardRgb[i++] = qRgb(r * 255 / 3, g * 255 / 3, b * 255 / 2);
Execution Count:48
48
201 qFill(customRgb, customRgb + CustomColorCount, 0xffffffff);
executed (the execution status of this line is deduced): qFill(customRgb, customRgb + CustomColorCount, 0xffffffff);
-
202 readSettings();
executed (the execution status of this line is deduced): readSettings();
-
203}
executed: }
Execution Count:1
1
204 -
205void QColorDialogStaticData::readSettings() -
206{ -
207#ifndef QT_NO_SETTINGS -
208 const QSettings settings(QSettings::UserScope, QStringLiteral("QtProject"));
executed (the execution status of this line is deduced): const QSettings settings(QSettings::UserScope, QString::fromUtf8("" "QtProject" "", sizeof("QtProject") - 1));
-
209 for (int i = 0; i < int(CustomColorCount); ++i) {
evaluated: i < int(CustomColorCount)
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:1
1-16
210 const QVariant v = settings.value(QStringLiteral("Qt/customColors/") + QString::number(i));
executed (the execution status of this line is deduced): const QVariant v = settings.value(QString::fromUtf8("" "Qt/customColors/" "", sizeof("Qt/customColors/") - 1) + QString::number(i));
-
211 if (v.isValid())
partially evaluated: v.isValid()
TRUEFALSE
yes
Evaluation Count:16
no
Evaluation Count:0
0-16
212 customRgb[i] = v.toUInt();
executed: customRgb[i] = v.toUInt();
Execution Count:16
16
213 }
executed: }
Execution Count:16
16
214#endif -
215}
executed: }
Execution Count:1
1
216 -
217void QColorDialogStaticData::writeSettings() const -
218{ -
219#ifndef QT_NO_SETTINGS -
220 if (!customSet) {
partially evaluated: !customSet
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
221 QSettings settings(QSettings::UserScope, QStringLiteral("QtProject"));
executed (the execution status of this line is deduced): QSettings settings(QSettings::UserScope, QString::fromUtf8("" "QtProject" "", sizeof("QtProject") - 1));
-
222 for (int i = 0; i < int(CustomColorCount); ++i)
evaluated: i < int(CustomColorCount)
TRUEFALSE
yes
Evaluation Count:48
yes
Evaluation Count:3
3-48
223 settings.setValue(QStringLiteral("Qt/customColors/") + QString::number(i), customRgb[i]);
executed: settings.setValue(QString::fromUtf8("" "Qt/customColors/" "", sizeof("Qt/customColors/") - 1) + QString::number(i), customRgb[i]);
Execution Count:48
48
224 }
executed: }
Execution Count:3
3
225#endif -
226}
executed: }
Execution Count:3
3
227 -
228Q_GLOBAL_STATIC(QColorDialogStaticData, qColorDialogStaticData)
never executed: delete x;
executed: return thisGlobalStatic.pointer.load();
Execution Count:23
partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
evaluated: !thisGlobalStatic.pointer.load()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:22
partially evaluated: !thisGlobalStatic.destroyed
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-23
229 -
230class QColorDialogOptionsPrivate : public QSharedData -
231{ -
232public: -
233 QColorDialogOptionsPrivate() : options(0) {}
executed: }
Execution Count:3
3
234 // Write out settings around destruction of dialogs -
235 ~QColorDialogOptionsPrivate() { qColorDialogStaticData()->writeSettings(); }
executed: }
Execution Count:3
3
236 -
237 QColorDialogOptions::ColorDialogOptions options; -
238 QString windowTitle; -
239}; -
240 -
241QColorDialogOptions::QColorDialogOptions() : d(new QColorDialogOptionsPrivate) -
242{ -
243}
executed: }
Execution Count:3
3
244 -
245QColorDialogOptions::QColorDialogOptions(const QColorDialogOptions &rhs) : d(rhs.d) -
246{ -
247}
never executed: }
0
248 -
249QColorDialogOptions &QColorDialogOptions::operator=(const QColorDialogOptions &rhs) -
250{ -
251 if (this != &rhs)
never evaluated: this != &rhs
0
252 d = rhs.d;
never executed: d = rhs.d;
0
253 return *this;
never executed: return *this;
0
254} -
255 -
256QColorDialogOptions::~QColorDialogOptions() -
257{ -
258} -
259 -
260QString QColorDialogOptions::windowTitle() const -
261{ -
262 return d->windowTitle;
never executed: return d->windowTitle;
0
263} -
264 -
265void QColorDialogOptions::setWindowTitle(const QString &title) -
266{ -
267 d->windowTitle = title;
never executed (the execution status of this line is deduced): d->windowTitle = title;
-
268}
never executed: }
0
269 -
270void QColorDialogOptions::setOption(QColorDialogOptions::ColorDialogOption option, bool on) -
271{ -
272 if (!(d->options & option) != !on)
never evaluated: !(d->options & option) != !on
0
273 setOptions(d->options ^ option);
never executed: setOptions(d->options ^ option);
0
274}
never executed: }
0
275 -
276bool QColorDialogOptions::testOption(QColorDialogOptions::ColorDialogOption option) const -
277{ -
278 return d->options & option;
executed: return d->options & option;
Execution Count:8
8
279} -
280 -
281void QColorDialogOptions::setOptions(ColorDialogOptions options) -
282{ -
283 if (options != d->options)
partially evaluated: options != d->options
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
284 d->options = options;
executed: d->options = options;
Execution Count:2
2
285}
executed: }
Execution Count:2
2
286 -
287QColorDialogOptions::ColorDialogOptions QColorDialogOptions::options() const -
288{ -
289 return d->options;
executed: return d->options;
Execution Count:30
30
290} -
291 -
292int QColorDialogOptions::customColorCount() -
293{ -
294 return QColorDialogStaticData::CustomColorCount;
never executed: return QColorDialogStaticData::CustomColorCount;
0
295} -
296 -
297QRgb QColorDialogOptions::customColor(int index) -
298{ -
299 if (uint(index) >= uint(QColorDialogStaticData::CustomColorCount))
never evaluated: uint(index) >= uint(QColorDialogStaticData::CustomColorCount)
0
300 return qRgb(255, 255, 255);
never executed: return qRgb(255, 255, 255);
0
301 return qColorDialogStaticData()->customRgb[index];
never executed: return qColorDialogStaticData()->customRgb[index];
0
302} -
303 -
304QRgb *QColorDialogOptions::customColors() -
305{ -
306 return qColorDialogStaticData()->customRgb;
executed: return qColorDialogStaticData()->customRgb;
Execution Count:4
4
307} -
308 -
309void QColorDialogOptions::setCustomColor(int index, QRgb color) -
310{ -
311 if (uint(index) >= uint(QColorDialogStaticData::CustomColorCount))
never evaluated: uint(index) >= uint(QColorDialogStaticData::CustomColorCount)
0
312 return;
never executed: return;
0
313 qColorDialogStaticData()->customSet = true;
never executed (the execution status of this line is deduced): qColorDialogStaticData()->customSet = true;
-
314 qColorDialogStaticData()->customRgb[index] = color;
never executed (the execution status of this line is deduced): qColorDialogStaticData()->customRgb[index] = color;
-
315}
never executed: }
0
316 -
317QRgb *QColorDialogOptions::standardColors() -
318{ -
319 return qColorDialogStaticData()->standardRgb;
executed: return qColorDialogStaticData()->standardRgb;
Execution Count:8
8
320} -
321 -
322QRgb QColorDialogOptions::standardColor(int index) -
323{ -
324 if (uint(index) >= uint(QColorDialogStaticData::StandardColorCount))
partially evaluated: uint(index) >= uint(QColorDialogStaticData::StandardColorCount)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
325 return qRgb(255, 255, 255);
never executed: return qRgb(255, 255, 255);
0
326 return qColorDialogStaticData()->standardRgb[index];
executed: return qColorDialogStaticData()->standardRgb[index];
Execution Count:8
8
327} -
328 -
329void QColorDialogOptions::setStandardColor(int index, QRgb color) -
330{ -
331 if (uint(index) >= uint(QColorDialogStaticData::StandardColorCount))
never evaluated: uint(index) >= uint(QColorDialogStaticData::StandardColorCount)
0
332 return;
never executed: return;
0
333 qColorDialogStaticData()->standardRgb[index] = color;
never executed (the execution status of this line is deduced): qColorDialogStaticData()->standardRgb[index] = color;
-
334}
never executed: }
0
335 -
336/*! -
337 \class QPlatformColorDialogHelper -
338 \since 5.0 -
339 \internal -
340 \ingroup qpa -
341 -
342 \brief The QPlatformColorDialogHelper class allows for platform-specific customization of color dialogs. -
343 -
344*/ -
345const QSharedPointer<QColorDialogOptions> &QPlatformColorDialogHelper::options() const -
346{ -
347 return m_options;
never executed: return m_options;
0
348} -
349 -
350void QPlatformColorDialogHelper::setOptions(const QSharedPointer<QColorDialogOptions> &options) -
351{ -
352 m_options = options;
never executed (the execution status of this line is deduced): m_options = options;
-
353}
never executed: }
0
354 -
355// File dialog -
356 -
357class QFileDialogOptionsPrivate : public QSharedData -
358{ -
359public: -
360 QFileDialogOptionsPrivate() : options(0), -
361 viewMode(QFileDialogOptions::Detail), -
362 fileMode(QFileDialogOptions::AnyFile), -
363 acceptMode(QFileDialogOptions::AcceptOpen), -
364 filters(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs) -
365 {}
executed: }
Execution Count:189
189
366 -
367 QFileDialogOptions::FileDialogOptions options; -
368 QString windowTitle; -
369 -
370 QFileDialogOptions::ViewMode viewMode; -
371 QFileDialogOptions::FileMode fileMode; -
372 QFileDialogOptions::AcceptMode acceptMode; -
373 QString labels[QFileDialogOptions::DialogLabelCount]; -
374 QDir::Filters filters; -
375 QList<QUrl> sidebarUrls; -
376 QStringList nameFilters; -
377 QString defaultSuffix; -
378 QStringList history; -
379 QString initialDirectory; -
380 QString initiallySelectedNameFilter; -
381 QStringList initiallySelectedFiles; -
382}; -
383 -
384QFileDialogOptions::QFileDialogOptions() : d(new QFileDialogOptionsPrivate) -
385{ -
386}
executed: }
Execution Count:189
189
387 -
388QFileDialogOptions::QFileDialogOptions(const QFileDialogOptions &rhs) : d(rhs.d) -
389{ -
390}
never executed: }
0
391 -
392QFileDialogOptions &QFileDialogOptions::operator=(const QFileDialogOptions &rhs) -
393{ -
394 if (this != &rhs)
never evaluated: this != &rhs
0
395 d = rhs.d;
never executed: d = rhs.d;
0
396 return *this;
never executed: return *this;
0
397} -
398 -
399QFileDialogOptions::~QFileDialogOptions() -
400{ -
401} -
402 -
403QString QFileDialogOptions::windowTitle() const -
404{ -
405 return d->windowTitle;
never executed: return d->windowTitle;
0
406} -
407 -
408void QFileDialogOptions::setWindowTitle(const QString &title) -
409{ -
410 d->windowTitle = title;
never executed (the execution status of this line is deduced): d->windowTitle = title;
-
411}
never executed: }
0
412 -
413void QFileDialogOptions::setOption(QFileDialogOptions::FileDialogOption option, bool on) -
414{ -
415 if (!(d->options & option) != !on)
never evaluated: !(d->options & option) != !on
0
416 setOptions(d->options ^ option);
never executed: setOptions(d->options ^ option);
0
417}
never executed: }
0
418 -
419bool QFileDialogOptions::testOption(QFileDialogOptions::FileDialogOption option) const -
420{ -
421 return d->options & option;
executed: return d->options & option;
Execution Count:459
459
422} -
423 -
424void QFileDialogOptions::setOptions(FileDialogOptions options) -
425{ -
426 if (options != d->options)
partially evaluated: options != d->options
TRUEFALSE
yes
Evaluation Count:212
no
Evaluation Count:0
0-212
427 d->options = options;
executed: d->options = options;
Execution Count:212
212
428}
executed: }
Execution Count:212
212
429 -
430QFileDialogOptions::FileDialogOptions QFileDialogOptions::options() const -
431{ -
432 return d->options;
executed: return d->options;
Execution Count:709
709
433} -
434 -
435QDir::Filters QFileDialogOptions::filter() const -
436{ -
437 return d->filters;
never executed: return d->filters;
0
438} -
439 -
440void QFileDialogOptions::setFilter(QDir::Filters filters) -
441{ -
442 d->filters = filters;
executed (the execution status of this line is deduced): d->filters = filters;
-
443}
executed: }
Execution Count:198
198
444 -
445void QFileDialogOptions::setViewMode(QFileDialogOptions::ViewMode mode) -
446{ -
447 d->viewMode = mode;
never executed (the execution status of this line is deduced): d->viewMode = mode;
-
448}
never executed: }
0
449 -
450QFileDialogOptions::ViewMode QFileDialogOptions::viewMode() const -
451{ -
452 return d->viewMode;
never executed: return d->viewMode;
0
453} -
454 -
455void QFileDialogOptions::setFileMode(QFileDialogOptions::FileMode mode) -
456{ -
457 d->fileMode = mode;
executed (the execution status of this line is deduced): d->fileMode = mode;
-
458}
executed: }
Execution Count:211
211
459 -
460QFileDialogOptions::FileMode QFileDialogOptions::fileMode() const -
461{ -
462 return d->fileMode;
executed: return d->fileMode;
Execution Count:2778
2778
463} -
464 -
465void QFileDialogOptions::setAcceptMode(QFileDialogOptions::AcceptMode mode) -
466{ -
467 d->acceptMode = mode;
executed (the execution status of this line is deduced): d->acceptMode = mode;
-
468}
executed: }
Execution Count:217
217
469 -
470QFileDialogOptions::AcceptMode QFileDialogOptions::acceptMode() const -
471{ -
472 return d->acceptMode;
executed: return d->acceptMode;
Execution Count:2858
2858
473} -
474 -
475void QFileDialogOptions::setSidebarUrls(const QList<QUrl> &urls) -
476{ -
477 d->sidebarUrls = urls;
never executed (the execution status of this line is deduced): d->sidebarUrls = urls;
-
478}
never executed: }
0
479 -
480QList<QUrl> QFileDialogOptions::sidebarUrls() const -
481{ -
482 return d->sidebarUrls;
never executed: return d->sidebarUrls;
0
483} -
484 -
485void QFileDialogOptions::setNameFilters(const QStringList &filters) -
486{ -
487 d->nameFilters = filters;
executed (the execution status of this line is deduced): d->nameFilters = filters;
-
488}
executed: }
Execution Count:223
223
489 -
490QStringList QFileDialogOptions::nameFilters() const -
491{ -
492 return d->nameFilters;
executed: return d->nameFilters;
Execution Count:244
244
493} -
494 -
495void QFileDialogOptions::setDefaultSuffix(const QString &suffix) -
496{ -
497 d->defaultSuffix = suffix;
executed (the execution status of this line is deduced): d->defaultSuffix = suffix;
-
498}
executed: }
Execution Count:2
2
499 -
500QString QFileDialogOptions::defaultSuffix() const -
501{ -
502 return d->defaultSuffix;
executed: return d->defaultSuffix;
Execution Count:196
196
503} -
504 -
505void QFileDialogOptions::setHistory(const QStringList &paths) -
506{ -
507 d->history = paths;
never executed (the execution status of this line is deduced): d->history = paths;
-
508}
never executed: }
0
509 -
510QStringList QFileDialogOptions::history() const -
511{ -
512 return d->history;
never executed: return d->history;
0
513} -
514 -
515void QFileDialogOptions::setLabelText(QFileDialogOptions::DialogLabel label, const QString &text) -
516{ -
517 if (label >= 0 && label < DialogLabelCount)
partially evaluated: label >= 0
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
partially evaluated: label < DialogLabelCount
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
518 d->labels[label] = text;
executed: d->labels[label] = text;
Execution Count:7
7
519}
executed: }
Execution Count:7
7
520 -
521QString QFileDialogOptions::labelText(QFileDialogOptions::DialogLabel label) const -
522{ -
523 return (label >= 0 && label < DialogLabelCount) ? d->labels[label] : QString();
executed: return (label >= 0 && label < DialogLabelCount) ? d->labels[label] : QString();
Execution Count:1
1
524} -
525 -
526bool QFileDialogOptions::isLabelExplicitlySet(DialogLabel label) -
527{ -
528 return label >= 0 && label < DialogLabelCount && !d->labels[label].isEmpty();
executed: return label >= 0 && label < DialogLabelCount && !d->labels[label].isEmpty();
Execution Count:1162
1162
529} -
530 -
531QString QFileDialogOptions::initialDirectory() const -
532{ -
533 return d->initialDirectory;
never executed: return d->initialDirectory;
0
534} -
535 -
536void QFileDialogOptions::setInitialDirectory(const QString &directory) -
537{ -
538 d->initialDirectory = directory;
never executed (the execution status of this line is deduced): d->initialDirectory = directory;
-
539}
never executed: }
0
540 -
541QString QFileDialogOptions::initiallySelectedNameFilter() const -
542{ -
543 return d->initiallySelectedNameFilter;
never executed: return d->initiallySelectedNameFilter;
0
544} -
545 -
546void QFileDialogOptions::setInitiallySelectedNameFilter(const QString &filter) -
547{ -
548 d->initiallySelectedNameFilter = filter;
never executed (the execution status of this line is deduced): d->initiallySelectedNameFilter = filter;
-
549}
never executed: }
0
550 -
551QStringList QFileDialogOptions::initiallySelectedFiles() const -
552{ -
553 return d->initiallySelectedFiles;
never executed: return d->initiallySelectedFiles;
0
554} -
555 -
556void QFileDialogOptions::setInitiallySelectedFiles(const QStringList &files) -
557{ -
558 d->initiallySelectedFiles = files;
never executed (the execution status of this line is deduced): d->initiallySelectedFiles = files;
-
559}
never executed: }
0
560 -
561/*! -
562 \class QPlatformFileDialogHelper -
563 \since 5.0 -
564 \internal -
565 \ingroup qpa -
566 -
567 \brief The QPlatformFileDialogHelper class allows for platform-specific customization of file dialogs. -
568 -
569*/ -
570const QSharedPointer<QFileDialogOptions> &QPlatformFileDialogHelper::options() const -
571{ -
572 return m_options;
never executed: return m_options;
0
573} -
574 -
575void QPlatformFileDialogHelper::setOptions(const QSharedPointer<QFileDialogOptions> &options) -
576{ -
577 m_options = options;
never executed (the execution status of this line is deduced): m_options = options;
-
578}
never executed: }
0
579 -
580const char *QPlatformFileDialogHelper::filterRegExp = -
581"^(.*)\\(([a-zA-Z0-9_.*? +;#\\-\\[\\]@\\{\\}/!<>\\$%&=^~:\\|]*)\\)$"; -
582 -
583// Makes a list of filters from a normal filter string "Image Files (*.png *.jpg)" -
584QStringList QPlatformFileDialogHelper::cleanFilterList(const QString &filter) -
585{ -
586 QRegExp regexp(QString::fromLatin1(filterRegExp));
executed (the execution status of this line is deduced): QRegExp regexp(QString::fromLatin1(filterRegExp));
-
587 QString f = filter;
executed (the execution status of this line is deduced): QString f = filter;
-
588 int i = regexp.indexIn(f);
executed (the execution status of this line is deduced): int i = regexp.indexIn(f);
-
589 if (i >= 0)
evaluated: i >= 0
TRUEFALSE
yes
Evaluation Count:222
yes
Evaluation Count:3
3-222
590 f = regexp.cap(2);
executed: f = regexp.cap(2);
Execution Count:222
222
591 return f.split(QLatin1Char(' '), QString::SkipEmptyParts);
executed: return f.split(QLatin1Char(' '), QString::SkipEmptyParts);
Execution Count:225
225
592} -
593 -
594QT_END_NAMESPACE -
595 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial