Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/styles/qstylefactory.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | - | |||||||||||||
5 | - | |||||||||||||
6 | - | |||||||||||||
7 | - | |||||||||||||
8 | - | |||||||||||||
9 | - | |||||||||||||
10 | - | |||||||||||||
11 | namespace { namespace Q_QGS_loader { typedef QFactoryLoader Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
never executed: }guard.store(QtGlobalStatic::Destroyed); never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ("org.qt-project.Qt.QStyleFactoryInterface", QLatin1String("/styles"), Qt::CaseInsensitive))) : value ("org.qt-project.Qt.QStyleFactoryInterface", QLatin1String("/styles"), Qt::CaseInsensitive) { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of block never executed: &holder.value;return &holder.value; never executed: } } } static QGlobalStatic<QFactoryLoader, Q_QGS_loader::innerFunction, Q_QGS_loader::guard> loader;return &holder.value; | 0 | ||||||||||||
12 | QStyle *QStyleFactory::create(const QString& key) | - | ||||||||||||
13 | { | - | ||||||||||||
14 | QStyle *ret = 0; | - | ||||||||||||
15 | QString style = key.toLower(); | - | ||||||||||||
16 | - | |||||||||||||
17 | if (style == QLatin1String("windows")
| 0 | ||||||||||||
18 | ret = new QWindowsStyle; never executed: ret = new QWindowsStyle; | 0 | ||||||||||||
19 | else | - | ||||||||||||
20 | if (style == QLatin1String("fusion")
| 0 | ||||||||||||
21 | ret = new QFusionStyle; never executed: ret = new QFusionStyle; | 0 | ||||||||||||
22 | else | - | ||||||||||||
23 | - | |||||||||||||
24 | - | |||||||||||||
25 | - | |||||||||||||
26 | - | |||||||||||||
27 | - | |||||||||||||
28 | - | |||||||||||||
29 | - | |||||||||||||
30 | if (style == QLatin1String("gtk")
| 0 | ||||||||||||
31 | ret = new QGtkStyle; never executed: ret = new QGtkStyle; | 0 | ||||||||||||
32 | else | - | ||||||||||||
33 | { } never executed: end of block | 0 | ||||||||||||
34 | - | |||||||||||||
35 | if (!ret
| 0 | ||||||||||||
36 | ret = qLoadPlugin<QStyle, QStylePlugin>(loader(), style); never executed: ret = qLoadPlugin<QStyle, QStylePlugin>(loader(), style); | 0 | ||||||||||||
37 | - | |||||||||||||
38 | if(ret
| 0 | ||||||||||||
39 | ret->setObjectName(style); never executed: ret->setObjectName(style); | 0 | ||||||||||||
40 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||
41 | } | - | ||||||||||||
42 | - | |||||||||||||
43 | - | |||||||||||||
44 | - | |||||||||||||
45 | - | |||||||||||||
46 | - | |||||||||||||
47 | - | |||||||||||||
48 | - | |||||||||||||
49 | QStringList QStyleFactory::keys() | - | ||||||||||||
50 | { | - | ||||||||||||
51 | QStringList list; | - | ||||||||||||
52 | - | |||||||||||||
53 | typedef QMultiMap<int, QString> PluginKeyMap; | - | ||||||||||||
54 | - | |||||||||||||
55 | const PluginKeyMap keyMap = loader()->keyMap(); | - | ||||||||||||
56 | const PluginKeyMap::const_iterator cend = keyMap.constEnd(); | - | ||||||||||||
57 | for (PluginKeyMap::const_iterator it = keyMap.constBegin(); it != cend
| 0 | ||||||||||||
58 | list.append(it.value()); never executed: list.append(it.value()); | 0 | ||||||||||||
59 | - | |||||||||||||
60 | - | |||||||||||||
61 | if (!list.contains(QLatin1String("Windows"))
| 0 | ||||||||||||
62 | list << QLatin1String("Windows"); never executed: list << QLatin1String("Windows"); | 0 | ||||||||||||
63 | if (!list.contains(QLatin1String("GTK+"))
| 0 | ||||||||||||
64 | list << QLatin1String("GTK+"); never executed: list << QLatin1String("GTK+"); | 0 | ||||||||||||
65 | - | |||||||||||||
66 | - | |||||||||||||
67 | if (!list.contains(QLatin1String("Fusion"))
| 0 | ||||||||||||
68 | list << QLatin1String("Fusion"); never executed: list << QLatin1String("Fusion"); | 0 | ||||||||||||
69 | return never executed: list;return list; never executed: return list; | 0 | ||||||||||||
70 | } | - | ||||||||||||
71 | - | |||||||||||||
72 | - | |||||||||||||
Switch to Source code | Preprocessed file |