styles/qstylefactory.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6static QFactoryLoader *loader() { static QGlobalStatic<QFactoryLoader > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QFactoryLoader *x = new QFactoryLoader ("org.qt-project.Qt.QStyleFactoryInterface", QLatin1String("/styles"), Qt::CaseInsensitive); if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<QFactoryLoader > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); }
never executed: delete x;
executed: return thisGlobalStatic.pointer.load();
Execution Count:220
partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
evaluated: !thisGlobalStatic.pointer.load()
TRUEFALSE
yes
Evaluation Count:136
yes
Evaluation Count:84
partially evaluated: !thisGlobalStatic.destroyed
TRUEFALSE
yes
Evaluation Count:136
no
Evaluation Count:0
0-220
7QStyle *QStyleFactory::create(const QString& key) -
8{ -
9 QStyle *ret = 0; -
10 QString style = key.toLower(); -
11 -
12 if (style == QLatin1String("windows"))
evaluated: style == QLatin1String("windows")
TRUEFALSE
yes
Evaluation Count:495
yes
Evaluation Count:199
199-495
13 ret = new QWindowsStyle;
executed: ret = new QWindowsStyle;
Execution Count:495
495
14 else -
15 if (style == QLatin1String("fusion"))
evaluated: style == QLatin1String("fusion")
TRUEFALSE
yes
Evaluation Count:198
yes
Evaluation Count:1
1-198
16 ret = new QFusionStyle;
executed: ret = new QFusionStyle;
Execution Count:198
198
17 else -
18 { }
executed: }
Execution Count:1
1
19 -
20 if (!ret)
evaluated: !ret
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:693
1-693
21 ret = qLoadPlugin<QStyle, QStylePlugin>(loader(), style);
executed: ret = qLoadPlugin<QStyle, QStylePlugin>(loader(), style);
Execution Count:1
1
22 -
23 if(ret)
evaluated: ret
TRUEFALSE
yes
Evaluation Count:693
yes
Evaluation Count:1
1-693
24 ret->setObjectName(style);
executed: ret->setObjectName(style);
Execution Count:693
693
25 return ret;
executed: return ret;
Execution Count:694
694
26} -
27 -
28 -
29 -
30 -
31 -
32 -
33 -
34QStringList QStyleFactory::keys() -
35{ -
36 QStringList list; -
37 -
38 typedef QMultiMap<int, QString> PluginKeyMap; -
39 -
40 const PluginKeyMap keyMap = loader()->keyMap(); -
41 const PluginKeyMap::const_iterator cend = keyMap.constEnd(); -
42 for (PluginKeyMap::const_iterator it = keyMap.constBegin(); it != cend; ++it)
partially evaluated: it != cend
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:219
0-219
43 list.append(it.value());
never executed: list.append(it.value());
0
44 -
45 -
46 if (!list.contains(QLatin1String("Windows")))
partially evaluated: !list.contains(QLatin1String("Windows"))
TRUEFALSE
yes
Evaluation Count:219
no
Evaluation Count:0
0-219
47 list << QLatin1String("Windows");
executed: list << QLatin1String("Windows");
Execution Count:219
219
48 if (!list.contains(QLatin1String("Fusion")))
partially evaluated: !list.contains(QLatin1String("Fusion"))
TRUEFALSE
yes
Evaluation Count:219
no
Evaluation Count:0
0-219
49 list << QLatin1String("Fusion");
executed: list << QLatin1String("Fusion");
Execution Count:219
219
50 return list;
executed: return list;
Execution Count:219
219
51} -
52 -
53 -
54 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial