qplatformdialoghelper.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qplatformdialoghelper.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6static const int buttonRoleLayouts[2][5][14] =-
7{-
8-
9 {-
10-
11 { QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::Stretch, QPlatformDialogHelper::YesRole, QPlatformDialogHelper::AcceptRole,-
12 QPlatformDialogHelper::AlternateRole, QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::NoRole,-
13 QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::RejectRole, QPlatformDialogHelper::ApplyRole,-
14 QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL },-
15-
16-
17 { QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ActionRole,-
18 QPlatformDialogHelper::Stretch, QPlatformDialogHelper::DestructiveRole | QPlatformDialogHelper::Reverse,-
19 QPlatformDialogHelper::AlternateRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::RejectRole | QPlatformDialogHelper::Reverse,-
20 QPlatformDialogHelper::AcceptRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::NoRole | QPlatformDialogHelper::Reverse,-
21 QPlatformDialogHelper::YesRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL },-
22-
23-
24 { QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::Stretch, QPlatformDialogHelper::YesRole,-
25 QPlatformDialogHelper::NoRole, QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::AcceptRole, QPlatformDialogHelper::AlternateRole,-
26 QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::RejectRole, QPlatformDialogHelper::EOL },-
27-
28-
29 { QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::Stretch, QPlatformDialogHelper::ActionRole,-
30 QPlatformDialogHelper::ApplyRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::DestructiveRole | QPlatformDialogHelper::Reverse,-
31 QPlatformDialogHelper::AlternateRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::RejectRole | QPlatformDialogHelper::Reverse,-
32 QPlatformDialogHelper::AcceptRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::NoRole | QPlatformDialogHelper::Reverse,-
33 QPlatformDialogHelper::YesRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::EOL },-
34-
35-
36 { QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::Stretch,-
37 QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL,-
38 QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL }-
39 },-
40-
41-
42 {-
43-
44 { QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::YesRole, QPlatformDialogHelper::AcceptRole, QPlatformDialogHelper::AlternateRole,-
45 QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::NoRole, QPlatformDialogHelper::RejectRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ResetRole,-
46 QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::Stretch, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL },-
47-
48-
49 { QPlatformDialogHelper::YesRole, QPlatformDialogHelper::NoRole, QPlatformDialogHelper::AcceptRole, QPlatformDialogHelper::RejectRole,-
50 QPlatformDialogHelper::AlternateRole, QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::Stretch, QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::ApplyRole,-
51 QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL },-
52-
53-
54 { QPlatformDialogHelper::AcceptRole, QPlatformDialogHelper::AlternateRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ActionRole,-
55 QPlatformDialogHelper::YesRole, QPlatformDialogHelper::NoRole, QPlatformDialogHelper::Stretch, QPlatformDialogHelper::ResetRole,-
56 QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::RejectRole, QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL },-
57-
58-
59 { QPlatformDialogHelper::YesRole, QPlatformDialogHelper::NoRole, QPlatformDialogHelper::AcceptRole, QPlatformDialogHelper::RejectRole,-
60 QPlatformDialogHelper::AlternateRole, QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::Stretch,-
61 QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL },-
62-
63-
64 { QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::Stretch,-
65 QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL,-
66 QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL }-
67 }-
68};-
69-
70QPlatformDialogHelper::QPlatformDialogHelper()-
71{-
72 qRegisterMetaType<StandardButton>();-
73 qRegisterMetaType<ButtonRole>();-
74}
never executed: end of block
0
75-
76QPlatformDialogHelper::~QPlatformDialogHelper()-
77{-
78}-
79-
80QVariant QPlatformDialogHelper::styleHint(StyleHint hint) const-
81{-
82 return
never executed: return QPlatformDialogHelper::defaultStyleHint(hint);
QPlatformDialogHelper::defaultStyleHint(hint);
never executed: return QPlatformDialogHelper::defaultStyleHint(hint);
0
83}-
84-
85QVariant QPlatformDialogHelper::defaultStyleHint(QPlatformDialogHelper::StyleHint hint)-
86{-
87 (void)hint;;-
88 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
89}-
90-
91-
92-
93class QFontDialogOptionsPrivate : public QSharedData-
94{-
95public:-
96 QFontDialogOptionsPrivate() : options(0) {}
never executed: end of block
0
97-
98 QFontDialogOptions::FontDialogOptions options;-
99 QString windowTitle;-
100};-
101-
102QFontDialogOptions::QFontDialogOptions() : d(new QFontDialogOptionsPrivate)-
103{-
104}
never executed: end of block
0
105-
106QFontDialogOptions::QFontDialogOptions(const QFontDialogOptions &rhs) : d(rhs.d)-
107{-
108}
never executed: end of block
0
109-
110QFontDialogOptions &QFontDialogOptions::operator=(const QFontDialogOptions &rhs)-
111{-
112 if (this != &rhs
this != &rhsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
113 d = rhs.d;
never executed: d = rhs.d;
0
114 return
never executed: return *this;
*this;
never executed: return *this;
0
115}-
116-
117QFontDialogOptions::~QFontDialogOptions()-
118{-
119}-
120-
121QString QFontDialogOptions::windowTitle() const-
122{-
123 return
never executed: return d->windowTitle;
d->windowTitle;
never executed: return d->windowTitle;
0
124}-
125-
126void QFontDialogOptions::setWindowTitle(const QString &title)-
127{-
128 d->windowTitle = title;-
129}
never executed: end of block
0
130-
131void QFontDialogOptions::setOption(QFontDialogOptions::FontDialogOption option, bool on)-
132{-
133 if (!(d->options & option) != !on
!(d->options & option) != !onDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
134 setOptions(d->options ^ option);
never executed: setOptions(d->options ^ option);
0
135}
never executed: end of block
0
136-
137bool QFontDialogOptions::testOption(QFontDialogOptions::FontDialogOption option) const-
138{-
139 return
never executed: return d->options & option;
d->options & option;
never executed: return d->options & option;
0
140}-
141-
142void QFontDialogOptions::setOptions(FontDialogOptions options)-
143{-
144 if (options != d->options
options != d->optionsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
145 d->options = options;
never executed: d->options = options;
0
146}
never executed: end of block
0
147-
148QFontDialogOptions::FontDialogOptions QFontDialogOptions::options() const-
149{-
150 return
never executed: return d->options;
d->options;
never executed: return d->options;
0
151}-
152const QSharedPointer<QFontDialogOptions> &QPlatformFontDialogHelper::options() const-
153{-
154 return
never executed: return m_options;
m_options;
never executed: return m_options;
0
155}-
156-
157void QPlatformFontDialogHelper::setOptions(const QSharedPointer<QFontDialogOptions> &options)-
158{-
159 m_options = options;-
160}
never executed: end of block
0
161-
162-
163-
164class QColorDialogStaticData-
165{-
166public:-
167 enum { CustomColorCount = 16, StandardColorCount = 6 * 8 };-
168-
169 QColorDialogStaticData();-
170 inline void readSettings();-
171 inline void writeSettings() const;-
172-
173 QRgb customRgb[CustomColorCount];-
174 QRgb standardRgb[StandardColorCount];-
175 bool customSet;-
176};-
177-
178QColorDialogStaticData::QColorDialogStaticData() : customSet(false)-
179{-
180 int i = 0;-
181 for (int g = 0; g < 4
g < 4Description
TRUEnever evaluated
FALSEnever evaluated
; ++g)
0
182 for (int r = 0; r < 4
r < 4Description
TRUEnever evaluated
FALSEnever evaluated
; ++r)
0
183 for (int b = 0; b < 3
b < 3Description
TRUEnever evaluated
FALSEnever evaluated
; ++b)
0
184 standardRgb[i++] = qRgb(r * 255 / 3, g * 255 / 3, b * 255 / 2);
never executed: standardRgb[i++] = qRgb(r * 255 / 3, g * 255 / 3, b * 255 / 2);
0
185 std::fill(customRgb, customRgb + CustomColorCount, 0xffffffff);-
186 readSettings();-
187}
never executed: end of block
0
188-
189void QColorDialogStaticData::readSettings()-
190{-
191-
192 const QSettings settings(QSettings::UserScope, ([]() -> QString { enum { Size = sizeof(u"" "QtProject")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "QtProject" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}()));
0
193 for (int i = 0; i < int(CustomColorCount)
i < int(CustomColorCount)Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
194 const QVariant v = settings.value(QLatin1String("Qt/customColors/") + QString::number(i));-
195 if (v.isValid()
v.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
196 customRgb[i] = v.toUInt();
never executed: customRgb[i] = v.toUInt();
0
197 }
never executed: end of block
0
198-
199}
never executed: end of block
0
200-
201void QColorDialogStaticData::writeSettings() const-
202{-
203-
204 if (!customSet
!customSetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
205 QSettings settings(QSettings::UserScope, ([]() -> QString { enum { Size = sizeof(u"" "QtProject")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "QtProject" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}()));
0
206 for (int i = 0; i < int(CustomColorCount)
i < int(CustomColorCount)Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
207 settings.setValue(QLatin1String("Qt/customColors/") + QString::number(i), customRgb[i]);
never executed: settings.setValue(QLatin1String("Qt/customColors/") + QString::number(i), customRgb[i]);
0
208 }
never executed: end of block
0
209-
210}
never executed: end of block
0
211-
212namespace { namespace Q_QGS_qColorDialogStaticData { typedef QColorDialogStaticData Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
never executed: guard.store(QtGlobalStatic::Destroyed);
}
never executed: end of block
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
never executed: return &holder.value;
&holder.value;
never executed: return &holder.value;
} } } static QGlobalStatic<QColorDialogStaticData, Q_QGS_qColorDialogStaticData::innerFunction, Q_QGS_qColorDialogStaticData::guard> qColorDialogStaticData;
0
213-
214class QColorDialogOptionsPrivate : public QSharedData-
215{-
216public:-
217 QColorDialogOptionsPrivate() : options(0) {}
never executed: end of block
0
218-
219 ~QColorDialogOptionsPrivate() { qColorDialogStaticData()->writeSettings(); }
never executed: end of block
0
220-
221 QColorDialogOptions::ColorDialogOptions options;-
222 QString windowTitle;-
223};-
224-
225QColorDialogOptions::QColorDialogOptions() : d(new QColorDialogOptionsPrivate)-
226{-
227}
never executed: end of block
0
228-
229QColorDialogOptions::QColorDialogOptions(const QColorDialogOptions &rhs) : d(rhs.d)-
230{-
231}
never executed: end of block
0
232-
233QColorDialogOptions &QColorDialogOptions::operator=(const QColorDialogOptions &rhs)-
234{-
235 if (this != &rhs
this != &rhsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
236 d = rhs.d;
never executed: d = rhs.d;
0
237 return
never executed: return *this;
*this;
never executed: return *this;
0
238}-
239-
240QColorDialogOptions::~QColorDialogOptions()-
241{-
242}-
243-
244QString QColorDialogOptions::windowTitle() const-
245{-
246 return
never executed: return d->windowTitle;
d->windowTitle;
never executed: return d->windowTitle;
0
247}-
248-
249void QColorDialogOptions::setWindowTitle(const QString &title)-
250{-
251 d->windowTitle = title;-
252}
never executed: end of block
0
253-
254void QColorDialogOptions::setOption(QColorDialogOptions::ColorDialogOption option, bool on)-
255{-
256 if (!(d->options & option) != !on
!(d->options & option) != !onDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
257 setOptions(d->options ^ option);
never executed: setOptions(d->options ^ option);
0
258}
never executed: end of block
0
259-
260bool QColorDialogOptions::testOption(QColorDialogOptions::ColorDialogOption option) const-
261{-
262 return
never executed: return d->options & option;
d->options & option;
never executed: return d->options & option;
0
263}-
264-
265void QColorDialogOptions::setOptions(ColorDialogOptions options)-
266{-
267 if (options != d->options
options != d->optionsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
268 d->options = options;
never executed: d->options = options;
0
269}
never executed: end of block
0
270-
271QColorDialogOptions::ColorDialogOptions QColorDialogOptions::options() const-
272{-
273 return
never executed: return d->options;
d->options;
never executed: return d->options;
0
274}-
275-
276int QColorDialogOptions::customColorCount()-
277{-
278 return
never executed: return QColorDialogStaticData::CustomColorCount;
QColorDialogStaticData::CustomColorCount;
never executed: return QColorDialogStaticData::CustomColorCount;
0
279}-
280-
281QRgb QColorDialogOptions::customColor(int index)-
282{-
283 if (uint(index) >= uint(QColorDialogStaticData::CustomColorCount)
uint(index) >=...tomColorCount)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
284 return
never executed: return qRgb(255, 255, 255);
qRgb(255, 255, 255);
never executed: return qRgb(255, 255, 255);
0
285 return
never executed: return qColorDialogStaticData()->customRgb[index];
qColorDialogStaticData()->customRgb[index];
never executed: return qColorDialogStaticData()->customRgb[index];
0
286}-
287-
288QRgb *QColorDialogOptions::customColors()-
289{-
290 return
never executed: return qColorDialogStaticData()->customRgb;
qColorDialogStaticData()->customRgb;
never executed: return qColorDialogStaticData()->customRgb;
0
291}-
292-
293void QColorDialogOptions::setCustomColor(int index, QRgb color)-
294{-
295 if (uint(index) >= uint(QColorDialogStaticData::CustomColorCount)
uint(index) >=...tomColorCount)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
296 return;
never executed: return;
0
297 qColorDialogStaticData()->customSet = true;-
298 qColorDialogStaticData()->customRgb[index] = color;-
299}
never executed: end of block
0
300-
301QRgb *QColorDialogOptions::standardColors()-
302{-
303 return
never executed: return qColorDialogStaticData()->standardRgb;
qColorDialogStaticData()->standardRgb;
never executed: return qColorDialogStaticData()->standardRgb;
0
304}-
305-
306QRgb QColorDialogOptions::standardColor(int index)-
307{-
308 if (uint(index) >= uint(QColorDialogStaticData::StandardColorCount)
uint(index) >=...ardColorCount)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
309 return
never executed: return qRgb(255, 255, 255);
qRgb(255, 255, 255);
never executed: return qRgb(255, 255, 255);
0
310 return
never executed: return qColorDialogStaticData()->standardRgb[index];
qColorDialogStaticData()->standardRgb[index];
never executed: return qColorDialogStaticData()->standardRgb[index];
0
311}-
312-
313void QColorDialogOptions::setStandardColor(int index, QRgb color)-
314{-
315 if (uint(index) >= uint(QColorDialogStaticData::StandardColorCount)
uint(index) >=...ardColorCount)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
316 return;
never executed: return;
0
317 qColorDialogStaticData()->standardRgb[index] = color;-
318}
never executed: end of block
0
319const QSharedPointer<QColorDialogOptions> &QPlatformColorDialogHelper::options() const-
320{-
321 return
never executed: return m_options;
m_options;
never executed: return m_options;
0
322}-
323-
324void QPlatformColorDialogHelper::setOptions(const QSharedPointer<QColorDialogOptions> &options)-
325{-
326 m_options = options;-
327}
never executed: end of block
0
328-
329-
330-
331class QFileDialogOptionsPrivate : public QSharedData-
332{-
333public:-
334 QFileDialogOptionsPrivate() : options(0),-
335 viewMode(QFileDialogOptions::Detail),-
336 fileMode(QFileDialogOptions::AnyFile),-
337 acceptMode(QFileDialogOptions::AcceptOpen),-
338 filters(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs),-
339 useDefaultNameFilters(true)-
340 {}
never executed: end of block
0
341-
342 QFileDialogOptions::FileDialogOptions options;-
343 QString windowTitle;-
344-
345 QFileDialogOptions::ViewMode viewMode;-
346 QFileDialogOptions::FileMode fileMode;-
347 QFileDialogOptions::AcceptMode acceptMode;-
348 QString labels[QFileDialogOptions::DialogLabelCount];-
349 QDir::Filters filters;-
350 QList<QUrl> sidebarUrls;-
351 bool useDefaultNameFilters;-
352 QStringList nameFilters;-
353 QStringList mimeTypeFilters;-
354 QString defaultSuffix;-
355 QStringList history;-
356 QUrl initialDirectory;-
357 QString initiallySelectedNameFilter;-
358 QList<QUrl> initiallySelectedFiles;-
359 QStringList supportedSchemes;-
360};-
361-
362QFileDialogOptions::QFileDialogOptions() : d(new QFileDialogOptionsPrivate)-
363{-
364}
never executed: end of block
0
365-
366QFileDialogOptions::QFileDialogOptions(const QFileDialogOptions &rhs) : d(rhs.d)-
367{-
368}
never executed: end of block
0
369-
370QFileDialogOptions &QFileDialogOptions::operator=(const QFileDialogOptions &rhs)-
371{-
372 if (this != &rhs
this != &rhsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
373 d = rhs.d;
never executed: d = rhs.d;
0
374 return
never executed: return *this;
*this;
never executed: return *this;
0
375}-
376-
377QFileDialogOptions::~QFileDialogOptions()-
378{-
379}-
380-
381QString QFileDialogOptions::windowTitle() const-
382{-
383 return
never executed: return d->windowTitle;
d->windowTitle;
never executed: return d->windowTitle;
0
384}-
385-
386void QFileDialogOptions::setWindowTitle(const QString &title)-
387{-
388 d->windowTitle = title;-
389}
never executed: end of block
0
390-
391void QFileDialogOptions::setOption(QFileDialogOptions::FileDialogOption option, bool on)-
392{-
393 if (!(d->options & option) != !on
!(d->options & option) != !onDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
394 setOptions(d->options ^ option);
never executed: setOptions(d->options ^ option);
0
395}
never executed: end of block
0
396-
397bool QFileDialogOptions::testOption(QFileDialogOptions::FileDialogOption option) const-
398{-
399 return
never executed: return d->options & option;
d->options & option;
never executed: return d->options & option;
0
400}-
401-
402void QFileDialogOptions::setOptions(FileDialogOptions options)-
403{-
404 if (options != d->options
options != d->optionsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
405 d->options = options;
never executed: d->options = options;
0
406}
never executed: end of block
0
407-
408QFileDialogOptions::FileDialogOptions QFileDialogOptions::options() const-
409{-
410 return
never executed: return d->options;
d->options;
never executed: return d->options;
0
411}-
412-
413QDir::Filters QFileDialogOptions::filter() const-
414{-
415 return
never executed: return d->filters;
d->filters;
never executed: return d->filters;
0
416}-
417-
418void QFileDialogOptions::setFilter(QDir::Filters filters)-
419{-
420 d->filters = filters;-
421}
never executed: end of block
0
422-
423void QFileDialogOptions::setViewMode(QFileDialogOptions::ViewMode mode)-
424{-
425 d->viewMode = mode;-
426}
never executed: end of block
0
427-
428QFileDialogOptions::ViewMode QFileDialogOptions::viewMode() const-
429{-
430 return
never executed: return d->viewMode;
d->viewMode;
never executed: return d->viewMode;
0
431}-
432-
433void QFileDialogOptions::setFileMode(QFileDialogOptions::FileMode mode)-
434{-
435 d->fileMode = mode;-
436}
never executed: end of block
0
437-
438QFileDialogOptions::FileMode QFileDialogOptions::fileMode() const-
439{-
440 return
never executed: return d->fileMode;
d->fileMode;
never executed: return d->fileMode;
0
441}-
442-
443void QFileDialogOptions::setAcceptMode(QFileDialogOptions::AcceptMode mode)-
444{-
445 d->acceptMode = mode;-
446}
never executed: end of block
0
447-
448QFileDialogOptions::AcceptMode QFileDialogOptions::acceptMode() const-
449{-
450 return
never executed: return d->acceptMode;
d->acceptMode;
never executed: return d->acceptMode;
0
451}-
452-
453void QFileDialogOptions::setSidebarUrls(const QList<QUrl> &urls)-
454{-
455 d->sidebarUrls = urls;-
456}
never executed: end of block
0
457-
458QList<QUrl> QFileDialogOptions::sidebarUrls() const-
459{-
460 return
never executed: return d->sidebarUrls;
d->sidebarUrls;
never executed: return d->sidebarUrls;
0
461}-
462bool QFileDialogOptions::useDefaultNameFilters() const-
463{-
464 return
never executed: return d->useDefaultNameFilters;
d->useDefaultNameFilters;
never executed: return d->useDefaultNameFilters;
0
465}-
466-
467void QFileDialogOptions::setUseDefaultNameFilters(bool dnf)-
468{-
469 d->useDefaultNameFilters = dnf;-
470}
never executed: end of block
0
471-
472void QFileDialogOptions::setNameFilters(const QStringList &filters)-
473{-
474 d->useDefaultNameFilters = filters.size() == 1
filters.size() == 1Description
TRUEnever evaluated
FALSEnever evaluated
0
475 && filters.first() == QFileDialogOptions::defaultNameFilterString()
filters.first(...FilterString()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
476 d->nameFilters = filters;-
477}
never executed: end of block
0
478-
479QStringList QFileDialogOptions::nameFilters() const-
480{-
481 return
never executed: return d->useDefaultNameFilters ? QStringList(QFileDialogOptions::defaultNameFilterString()) : d->nameFilters;
d->useDefaultNameFilters ?
never executed: return d->useDefaultNameFilters ? QStringList(QFileDialogOptions::defaultNameFilterString()) : d->nameFilters;
0
482 QStringList(QFileDialogOptions::defaultNameFilterString()) : d->nameFilters;
never executed: return d->useDefaultNameFilters ? QStringList(QFileDialogOptions::defaultNameFilterString()) : d->nameFilters;
0
483}-
484QString QFileDialogOptions::defaultNameFilterString()-
485{-
486 return
never executed: return QCoreApplication::translate("QFileDialog", "All Files (*)");
QCoreApplication::translate("QFileDialog", "All Files (*)");
never executed: return QCoreApplication::translate("QFileDialog", "All Files (*)");
0
487}-
488-
489void QFileDialogOptions::setMimeTypeFilters(const QStringList &filters)-
490{-
491 d->mimeTypeFilters = filters;-
492}
never executed: end of block
0
493-
494QStringList QFileDialogOptions::mimeTypeFilters() const-
495{-
496 return
never executed: return d->mimeTypeFilters;
d->mimeTypeFilters;
never executed: return d->mimeTypeFilters;
0
497}-
498-
499void QFileDialogOptions::setDefaultSuffix(const QString &suffix)-
500{-
501 d->defaultSuffix = suffix;-
502 if (d->defaultSuffix.size() > 1
d->defaultSuffix.size() > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& d->defaultSuffix.startsWith(QLatin1Char('.'))
d->defaultSuff...tin1Char('.'))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
503 d->defaultSuffix.remove(0, 1);
never executed: d->defaultSuffix.remove(0, 1);
0
504}
never executed: end of block
0
505-
506QString QFileDialogOptions::defaultSuffix() const-
507{-
508 return
never executed: return d->defaultSuffix;
d->defaultSuffix;
never executed: return d->defaultSuffix;
0
509}-
510-
511void QFileDialogOptions::setHistory(const QStringList &paths)-
512{-
513 d->history = paths;-
514}
never executed: end of block
0
515-
516QStringList QFileDialogOptions::history() const-
517{-
518 return
never executed: return d->history;
d->history;
never executed: return d->history;
0
519}-
520-
521void QFileDialogOptions::setLabelText(QFileDialogOptions::DialogLabel label, const QString &text)-
522{-
523 if (label >= 0
label >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& label < DialogLabelCount
label < DialogLabelCountDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
524 d->labels[label] = text;
never executed: d->labels[label] = text;
0
525}
never executed: end of block
0
526-
527QString QFileDialogOptions::labelText(QFileDialogOptions::DialogLabel label) const-
528{-
529 return
never executed: return (label >= 0 && label < DialogLabelCount) ? d->labels[label] : QString();
(label >= 0 && label < DialogLabelCount) ? d->labels[label] : QString();
never executed: return (label >= 0 && label < DialogLabelCount) ? d->labels[label] : QString();
0
530}-
531-
532bool QFileDialogOptions::isLabelExplicitlySet(DialogLabel label)-
533{-
534 return
never executed: return label >= 0 && label < DialogLabelCount && !d->labels[label].isEmpty();
label >= 0 && label < DialogLabelCount && !d->labels[label].isEmpty();
never executed: return label >= 0 && label < DialogLabelCount && !d->labels[label].isEmpty();
0
535}-
536-
537QUrl QFileDialogOptions::initialDirectory() const-
538{-
539 return
never executed: return d->initialDirectory;
d->initialDirectory;
never executed: return d->initialDirectory;
0
540}-
541-
542void QFileDialogOptions::setInitialDirectory(const QUrl &directory)-
543{-
544 d->initialDirectory = directory;-
545}
never executed: end of block
0
546-
547QString QFileDialogOptions::initiallySelectedNameFilter() const-
548{-
549 return
never executed: return d->initiallySelectedNameFilter;
d->initiallySelectedNameFilter;
never executed: return d->initiallySelectedNameFilter;
0
550}-
551-
552void QFileDialogOptions::setInitiallySelectedNameFilter(const QString &filter)-
553{-
554 d->initiallySelectedNameFilter = filter;-
555}
never executed: end of block
0
556-
557QList<QUrl> QFileDialogOptions::initiallySelectedFiles() const-
558{-
559 return
never executed: return d->initiallySelectedFiles;
d->initiallySelectedFiles;
never executed: return d->initiallySelectedFiles;
0
560}-
561-
562void QFileDialogOptions::setInitiallySelectedFiles(const QList<QUrl> &files)-
563{-
564 d->initiallySelectedFiles = files;-
565}
never executed: end of block
0
566-
567-
568void QFileDialogOptions::setSupportedSchemes(const QStringList &schemes)-
569{-
570 d->supportedSchemes = schemes;-
571}
never executed: end of block
0
572-
573QStringList QFileDialogOptions::supportedSchemes() const-
574{-
575 return
never executed: return d->supportedSchemes;
d->supportedSchemes;
never executed: return d->supportedSchemes;
0
576}-
577-
578-
579bool QPlatformFileDialogHelper::isSupportedUrl(const QUrl &url) const-
580{-
581 return
never executed: return url.isLocalFile();
url.isLocalFile();
never executed: return url.isLocalFile();
0
582}-
583const QSharedPointer<QFileDialogOptions> &QPlatformFileDialogHelper::options() const-
584{-
585 return
never executed: return m_options;
m_options;
never executed: return m_options;
0
586}-
587-
588void QPlatformFileDialogHelper::setOptions(const QSharedPointer<QFileDialogOptions> &options)-
589{-
590 m_options = options;-
591}
never executed: end of block
0
592-
593const char *QPlatformFileDialogHelper::filterRegExp =-
594"^(.*)\\(([a-zA-Z0-9_.,*? +;#\\-\\[\\]@\\{\\}/!<>\\$%&=^~:\\|]*)\\)$";-
595-
596-
597QStringList QPlatformFileDialogHelper::cleanFilterList(const QString &filter)-
598{-
599 QRegExp regexp(QString::fromLatin1(filterRegExp));-
600 ((!(regexp.isValid())) ? qt_assert("regexp.isValid()",__FILE__,705) : qt_noop());-
601 QString f = filter;-
602 int i = regexp.indexIn(f);-
603 if (i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
604 f = regexp.cap(2);
never executed: f = regexp.cap(2);
0
605 return
never executed: return f.split(QLatin1Char(' '), QString::SkipEmptyParts);
f.split(QLatin1Char(' '), QString::SkipEmptyParts);
never executed: return f.split(QLatin1Char(' '), QString::SkipEmptyParts);
0
606}-
607-
608-
609-
610class QMessageDialogOptionsPrivate : public QSharedData-
611{-
612public:-
613 QMessageDialogOptionsPrivate() :-
614 icon(QMessageDialogOptions::NoIcon),-
615 buttons(QPlatformDialogHelper::Ok)-
616 {}
never executed: end of block
0
617-
618 QString windowTitle;-
619 QMessageDialogOptions::Icon icon;-
620 QString text;-
621 QString informativeText;-
622 QString detailedText;-
623 QPlatformDialogHelper::StandardButtons buttons;-
624};-
625-
626QMessageDialogOptions::QMessageDialogOptions() : d(new QMessageDialogOptionsPrivate)-
627{-
628}
never executed: end of block
0
629-
630QMessageDialogOptions::QMessageDialogOptions(const QMessageDialogOptions &rhs) : d(rhs.d)-
631{-
632}
never executed: end of block
0
633-
634QMessageDialogOptions &QMessageDialogOptions::operator=(const QMessageDialogOptions &rhs)-
635{-
636 if (this != &rhs
this != &rhsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
637 d = rhs.d;
never executed: d = rhs.d;
0
638 return
never executed: return *this;
*this;
never executed: return *this;
0
639}-
640-
641QMessageDialogOptions::~QMessageDialogOptions()-
642{-
643}-
644-
645QString QMessageDialogOptions::windowTitle() const-
646{-
647 return
never executed: return d->windowTitle;
d->windowTitle;
never executed: return d->windowTitle;
0
648}-
649-
650void QMessageDialogOptions::setWindowTitle(const QString &title)-
651{-
652 d->windowTitle = title;-
653}
never executed: end of block
0
654-
655QMessageDialogOptions::Icon QMessageDialogOptions::icon() const-
656{-
657 return
never executed: return d->icon;
d->icon;
never executed: return d->icon;
0
658}-
659-
660void QMessageDialogOptions::setIcon(Icon icon)-
661{-
662 d->icon = icon;-
663}
never executed: end of block
0
664-
665QString QMessageDialogOptions::text() const-
666{-
667 return
never executed: return d->text;
d->text;
never executed: return d->text;
0
668}-
669-
670void QMessageDialogOptions::setText(const QString &text)-
671{-
672 d->text = text;-
673}
never executed: end of block
0
674-
675QString QMessageDialogOptions::informativeText() const-
676{-
677 return
never executed: return d->informativeText;
d->informativeText;
never executed: return d->informativeText;
0
678}-
679-
680void QMessageDialogOptions::setInformativeText(const QString &informativeText)-
681{-
682 d->informativeText = informativeText;-
683}
never executed: end of block
0
684-
685QString QMessageDialogOptions::detailedText() const-
686{-
687 return
never executed: return d->detailedText;
d->detailedText;
never executed: return d->detailedText;
0
688}-
689-
690void QMessageDialogOptions::setDetailedText(const QString &detailedText)-
691{-
692 d->detailedText = detailedText;-
693}
never executed: end of block
0
694-
695void QMessageDialogOptions::setStandardButtons(QPlatformDialogHelper::StandardButtons buttons)-
696{-
697 d->buttons = buttons;-
698}
never executed: end of block
0
699-
700QPlatformDialogHelper::StandardButtons QMessageDialogOptions::standardButtons() const-
701{-
702 return
never executed: return d->buttons;
d->buttons;
never executed: return d->buttons;
0
703}-
704-
705QPlatformDialogHelper::ButtonRole QPlatformDialogHelper::buttonRole(QPlatformDialogHelper::StandardButton button)-
706{-
707 switch (button) {-
708 case
never executed: case Ok:
Ok:
never executed: case Ok:
0
709 case
never executed: case Save:
Save:
never executed: case Save:
0
710 case
never executed: case Open:
Open:
never executed: case Open:
0
711 case
never executed: case SaveAll:
SaveAll:
never executed: case SaveAll:
0
712 case
never executed: case Retry:
Retry:
never executed: case Retry:
0
713 case
never executed: case Ignore:
Ignore:
never executed: case Ignore:
0
714 return
never executed: return AcceptRole;
AcceptRole;
never executed: return AcceptRole;
0
715-
716 case
never executed: case Cancel:
Cancel:
never executed: case Cancel:
0
717 case
never executed: case Close:
Close:
never executed: case Close:
0
718 case
never executed: case Abort:
Abort:
never executed: case Abort:
0
719 return
never executed: return RejectRole;
RejectRole;
never executed: return RejectRole;
0
720-
721 case
never executed: case Discard:
Discard:
never executed: case Discard:
0
722 return
never executed: return DestructiveRole;
DestructiveRole;
never executed: return DestructiveRole;
0
723-
724 case
never executed: case Help:
Help:
never executed: case Help:
0
725 return
never executed: return HelpRole;
HelpRole;
never executed: return HelpRole;
0
726-
727 case
never executed: case Apply:
Apply:
never executed: case Apply:
0
728 return
never executed: return ApplyRole;
ApplyRole;
never executed: return ApplyRole;
0
729-
730 case
never executed: case Yes:
Yes:
never executed: case Yes:
0
731 case
never executed: case YesToAll:
YesToAll:
never executed: case YesToAll:
0
732 return
never executed: return YesRole;
YesRole;
never executed: return YesRole;
0
733-
734 case
never executed: case No:
No:
never executed: case No:
0
735 case
never executed: case NoToAll:
NoToAll:
never executed: case NoToAll:
0
736 return
never executed: return NoRole;
NoRole;
never executed: return NoRole;
0
737-
738 case
never executed: case RestoreDefaults:
RestoreDefaults:
never executed: case RestoreDefaults:
0
739 case
never executed: case Reset:
Reset:
never executed: case Reset:
0
740 return
never executed: return ResetRole;
ResetRole;
never executed: return ResetRole;
0
741-
742 default
never executed: default:
:
never executed: default:
0
743 break;
never executed: break;
0
744 }-
745 return
never executed: return InvalidRole;
InvalidRole;
never executed: return InvalidRole;
0
746}-
747-
748const int *QPlatformDialogHelper::buttonLayout(Qt::Orientation orientation, ButtonLayout policy)-
749{-
750 if (policy == UnknownLayout
policy == UnknownLayoutDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
751-
752-
753-
754 policy = KdeLayout;-
755-
756-
757-
758 }
never executed: end of block
0
759 return
never executed: return buttonRoleLayouts[orientation == Qt::Vertical][policy];
buttonRoleLayouts[orientation == Qt::Vertical][policy];
never executed: return buttonRoleLayouts[orientation == Qt::Vertical][policy];
0
760}-
761const QSharedPointer<QMessageDialogOptions> &QPlatformMessageDialogHelper::options() const-
762{-
763 return
never executed: return m_options;
m_options;
never executed: return m_options;
0
764}-
765-
766void QPlatformMessageDialogHelper::setOptions(const QSharedPointer<QMessageDialogOptions> &options)-
767{-
768 m_options = options;-
769}
never executed: end of block
0
770-
771-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9