styles/qstyleoption.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6QStyleOption::QStyleOption(int version, int type) -
7 : version(version), type(type), state(QStyle::State_None), -
8 direction(QApplication::layoutDirection()), fontMetrics(QFont()), styleObject(0) -
9{ -
10}
executed: }
Execution Count:541566
541566
11 -
12 -
13 -
14 -
15 -
16QStyleOption::~QStyleOption() -
17{ -
18} -
19void QStyleOption::init(const QWidget *widget) -
20{ -
21 QWidget *window = widget->window(); -
22 state = QStyle::State_None; -
23 if (widget->isEnabled())
evaluated: widget->isEnabled()
TRUEFALSE
yes
Evaluation Count:321589
yes
Evaluation Count:797
797-321589
24 state |= QStyle::State_Enabled;
executed: state |= QStyle::State_Enabled;
Execution Count:321589
321589
25 if (widget->hasFocus())
evaluated: widget->hasFocus()
TRUEFALSE
yes
Evaluation Count:35600
yes
Evaluation Count:286786
35600-286786
26 state |= QStyle::State_HasFocus;
executed: state |= QStyle::State_HasFocus;
Execution Count:35600
35600
27 if (window->testAttribute(Qt::WA_KeyboardFocusChange))
evaluated: window->testAttribute(Qt::WA_KeyboardFocusChange)
TRUEFALSE
yes
Evaluation Count:424
yes
Evaluation Count:321962
424-321962
28 state |= QStyle::State_KeyboardFocusChange;
executed: state |= QStyle::State_KeyboardFocusChange;
Execution Count:424
424
29 if (widget->underMouse())
evaluated: widget->underMouse()
TRUEFALSE
yes
Evaluation Count:25251
yes
Evaluation Count:297135
25251-297135
30 state |= QStyle::State_MouseOver;
executed: state |= QStyle::State_MouseOver;
Execution Count:25251
25251
31 if (window->isActiveWindow())
evaluated: window->isActiveWindow()
TRUEFALSE
yes
Evaluation Count:66514
yes
Evaluation Count:255872
66514-255872
32 state |= QStyle::State_Active;
executed: state |= QStyle::State_Active;
Execution Count:66514
66514
33 if (widget->isWindow())
evaluated: widget->isWindow()
TRUEFALSE
yes
Evaluation Count:85555
yes
Evaluation Count:236831
85555-236831
34 state |= QStyle::State_Window;
executed: state |= QStyle::State_Window;
Execution Count:85555
85555
35 direction = widget->layoutDirection(); -
36 rect = widget->rect(); -
37 palette = widget->palette(); -
38 fontMetrics = widget->fontMetrics(); -
39 styleObject = const_cast<QWidget*>(widget); -
40}
executed: }
Execution Count:322386
322386
41 -
42 -
43 -
44 -
45QStyleOption::QStyleOption(const QStyleOption &other) -
46 : version(Version), type(Type), state(other.state), -
47 direction(other.direction), rect(other.rect), fontMetrics(other.fontMetrics), -
48 palette(other.palette), styleObject(other.styleObject) -
49{ -
50}
executed: }
Execution Count:11779
11779
51 -
52 -
53 -
54 -
55QStyleOption &QStyleOption::operator=(const QStyleOption &other) -
56{ -
57 state = other.state; -
58 direction = other.direction; -
59 rect = other.rect; -
60 fontMetrics = other.fontMetrics; -
61 palette = other.palette; -
62 styleObject = other.styleObject; -
63 return *this;
executed: return *this;
Execution Count:214207
214207
64} -
65QStyleOptionFocusRect::QStyleOptionFocusRect() -
66 : QStyleOption(Version, SO_FocusRect) -
67{ -
68 state |= QStyle::State_KeyboardFocusChange; -
69}
executed: }
Execution Count:1395
1395
70 -
71 -
72 -
73 -
74QStyleOptionFocusRect::QStyleOptionFocusRect(int version) -
75 : QStyleOption(version, SO_FocusRect) -
76{ -
77 state |= QStyle::State_KeyboardFocusChange; -
78}
never executed: }
0
79QStyleOptionFrame::QStyleOptionFrame() -
80 : QStyleOption(Version, SO_Frame), lineWidth(0), midLineWidth(0), -
81 features(None), frameShape(QFrame::NoFrame) -
82{ -
83}
executed: }
Execution Count:43847
43847
84 -
85 -
86 -
87 -
88QStyleOptionFrame::QStyleOptionFrame(int version) -
89 : QStyleOption(version, SO_Frame), lineWidth(0), midLineWidth(0), -
90 features(None), frameShape(QFrame::NoFrame) -
91{ -
92}
never executed: }
0
93QStyleOptionGroupBox::QStyleOptionGroupBox() -
94 : QStyleOptionComplex(Version, Type), features(QStyleOptionFrame::None), -
95 textAlignment(Qt::AlignLeft), lineWidth(0), midLineWidth(0) -
96{ -
97}
executed: }
Execution Count:1030
1030
98QStyleOptionGroupBox::QStyleOptionGroupBox(int version) -
99 : QStyleOptionComplex(version, Type), features(QStyleOptionFrame::None), -
100 textAlignment(Qt::AlignLeft), lineWidth(0), midLineWidth(0) -
101{ -
102}
never executed: }
0
103QStyleOptionHeader::QStyleOptionHeader() -
104 : QStyleOption(QStyleOptionHeader::Version, SO_Header), -
105 section(0), textAlignment(Qt::AlignLeft), iconAlignment(Qt::AlignLeft), -
106 position(QStyleOptionHeader::Beginning), -
107 selectedPosition(QStyleOptionHeader::NotAdjacent), sortIndicator(None), -
108 orientation(Qt::Horizontal) -
109{ -
110}
executed: }
Execution Count:26952
26952
111 -
112 -
113 -
114 -
115QStyleOptionHeader::QStyleOptionHeader(int version) -
116 : QStyleOption(version, SO_Header), -
117 section(0), textAlignment(Qt::AlignLeft), iconAlignment(Qt::AlignLeft), -
118 position(QStyleOptionHeader::Beginning), -
119 selectedPosition(QStyleOptionHeader::NotAdjacent), sortIndicator(None), -
120 orientation(Qt::Horizontal) -
121{ -
122}
never executed: }
0
123QStyleOptionButton::QStyleOptionButton() -
124 : QStyleOption(QStyleOptionButton::Version, SO_Button), features(None) -
125{ -
126}
executed: }
Execution Count:8798
8798
127 -
128 -
129 -
130 -
131QStyleOptionButton::QStyleOptionButton(int version) -
132 : QStyleOption(version, SO_Button), features(None) -
133{ -
134}
never executed: }
0
135QStyleOptionToolBar::QStyleOptionToolBar() -
136 : QStyleOption(Version, SO_ToolBar), positionOfLine(OnlyOne), positionWithinLine(OnlyOne), -
137 toolBarArea(Qt::TopToolBarArea), features(None), lineWidth(0), midLineWidth(0) -
138{ -
139}
executed: }
Execution Count:158
158
140QStyleOptionToolBar::QStyleOptionToolBar(int version) -
141: QStyleOption(version, SO_ToolBar), positionOfLine(OnlyOne), positionWithinLine(OnlyOne), -
142 toolBarArea(Qt::TopToolBarArea), features(None), lineWidth(0), midLineWidth(0) -
143{ -
144 -
145}
never executed: }
0
146QStyleOptionTab::QStyleOptionTab() -
147 : QStyleOption(QStyleOptionTab::Version, SO_Tab), -
148 shape(QTabBar::RoundedNorth), -
149 row(0), -
150 position(Beginning), -
151 selectedPosition(NotAdjacent), cornerWidgets(QStyleOptionTab::NoCornerWidgets), -
152 documentMode(false), -
153 features(QStyleOptionTab::None) -
154{ -
155}
executed: }
Execution Count:963
963
156 -
157 -
158 -
159 -
160QStyleOptionTab::QStyleOptionTab(int version) -
161 : QStyleOption(version, SO_Tab), -
162 shape(QTabBar::RoundedNorth), -
163 row(0), -
164 position(Beginning), -
165 selectedPosition(NotAdjacent), cornerWidgets(QStyleOptionTab::NoCornerWidgets), -
166 documentMode(false), -
167 features(QStyleOptionTab::None) -
168{ -
169}
never executed: }
0
170QStyleOptionProgressBar::QStyleOptionProgressBar() -
171 : QStyleOption(QStyleOptionProgressBar::Version, SO_ProgressBar), -
172 minimum(0), maximum(0), progress(0), textAlignment(Qt::AlignLeft), textVisible(false), -
173 orientation(Qt::Horizontal), invertedAppearance(false), bottomToTop(false) -
174{ -
175}
executed: }
Execution Count:140
140
176 -
177 -
178 -
179 -
180QStyleOptionProgressBar::QStyleOptionProgressBar(int version) -
181 : QStyleOption(version, SO_ProgressBar), -
182 minimum(0), maximum(0), progress(0), textAlignment(Qt::AlignLeft), textVisible(false), -
183 orientation(Qt::Horizontal), invertedAppearance(false), bottomToTop(false) -
184{ -
185}
never executed: }
0
186QStyleOptionMenuItem::QStyleOptionMenuItem() -
187 : QStyleOption(QStyleOptionMenuItem::Version, SO_MenuItem), menuItemType(Normal), -
188 checkType(NotCheckable), checked(false), menuHasCheckableItems(true), maxIconWidth(0), tabWidth(0) -
189{ -
190}
executed: }
Execution Count:2632
2632
191 -
192 -
193 -
194 -
195QStyleOptionMenuItem::QStyleOptionMenuItem(int version) -
196 : QStyleOption(version, SO_MenuItem), menuItemType(Normal), -
197 checkType(NotCheckable), checked(false), menuHasCheckableItems(true), maxIconWidth(0), tabWidth(0) -
198{ -
199}
never executed: }
0
200QStyleOptionComplex::QStyleOptionComplex(int version, int type) -
201 : QStyleOption(version, type), subControls(QStyle::SC_All), activeSubControls(QStyle::SC_None) -
202{ -
203}
executed: }
Execution Count:129535
129535
204QStyleOptionSlider::QStyleOptionSlider() -
205 : QStyleOptionComplex(Version, SO_Slider), orientation(Qt::Horizontal), minimum(0), maximum(0), -
206 tickPosition(QSlider::NoTicks), tickInterval(0), upsideDown(false), -
207 sliderPosition(0), sliderValue(0), singleStep(0), pageStep(0), notchTarget(0.0), -
208 dialWrapping(false) -
209{ -
210}
executed: }
Execution Count:99105
99105
211 -
212 -
213 -
214 -
215QStyleOptionSlider::QStyleOptionSlider(int version) -
216 : QStyleOptionComplex(version, SO_Slider), orientation(Qt::Horizontal), minimum(0), maximum(0), -
217 tickPosition(QSlider::NoTicks), tickInterval(0), upsideDown(false), -
218 sliderPosition(0), sliderValue(0), singleStep(0), pageStep(0), notchTarget(0.0), -
219 dialWrapping(false) -
220{ -
221}
never executed: }
0
222QStyleOptionSpinBox::QStyleOptionSpinBox() -
223 : QStyleOptionComplex(Version, SO_SpinBox), buttonSymbols(QAbstractSpinBox::UpDownArrows), -
224 stepEnabled(QAbstractSpinBox::StepNone), frame(false) -
225{ -
226}
executed: }
Execution Count:1657
1657
227 -
228 -
229 -
230 -
231QStyleOptionSpinBox::QStyleOptionSpinBox(int version) -
232 : QStyleOptionComplex(version, SO_SpinBox), buttonSymbols(QAbstractSpinBox::UpDownArrows), -
233 stepEnabled(QAbstractSpinBox::StepNone), frame(false) -
234{ -
235}
never executed: }
0
236QStyleOptionDockWidget::QStyleOptionDockWidget() -
237 : QStyleOption(Version, SO_DockWidget), closable(false), -
238 movable(false), floatable(false), verticalTitleBar(false) -
239{ -
240}
executed: }
Execution Count:184
184
241 -
242 -
243 -
244 -
245QStyleOptionDockWidget::QStyleOptionDockWidget(int version) -
246 : QStyleOption(version, SO_DockWidget), closable(false), -
247 movable(false), floatable(false), verticalTitleBar(false) -
248{ -
249}
never executed: }
0
250QStyleOptionToolButton::QStyleOptionToolButton() -
251 : QStyleOptionComplex(Version, SO_ToolButton), features(None), arrowType(Qt::DownArrow) -
252 , toolButtonStyle(Qt::ToolButtonIconOnly) -
253{ -
254}
executed: }
Execution Count:1826
1826
255 -
256 -
257 -
258 -
259QStyleOptionToolButton::QStyleOptionToolButton(int version) -
260 : QStyleOptionComplex(version, SO_ToolButton), features(None), arrowType(Qt::DownArrow) -
261 , toolButtonStyle(Qt::ToolButtonIconOnly) -
262 -
263{ -
264}
never executed: }
0
265QStyleOptionComboBox::QStyleOptionComboBox() -
266 : QStyleOptionComplex(Version, SO_ComboBox), editable(false), frame(true) -
267{ -
268}
executed: }
Execution Count:4341
4341
269 -
270 -
271 -
272 -
273QStyleOptionComboBox::QStyleOptionComboBox(int version) -
274 : QStyleOptionComplex(version, SO_ComboBox), editable(false), frame(true) -
275{ -
276}
never executed: }
0
277QStyleOptionToolBox::QStyleOptionToolBox() -
278 : QStyleOption(Version, SO_ToolBox), position(Beginning), selectedPosition(NotAdjacent) -
279{ -
280}
executed: }
Execution Count:1
1
281 -
282 -
283 -
284 -
285QStyleOptionToolBox::QStyleOptionToolBox(int version) -
286 : QStyleOption(version, SO_ToolBox), position(Beginning), selectedPosition(NotAdjacent) -
287{ -
288}
never executed: }
0
289QStyleOptionRubberBand::QStyleOptionRubberBand() -
290 : QStyleOption(Version, SO_RubberBand), shape(QRubberBand::Line), opaque(false) -
291{ -
292}
executed: }
Execution Count:60
60
293 -
294 -
295 -
296 -
297QStyleOptionRubberBand::QStyleOptionRubberBand(int version) -
298 : QStyleOption(version, SO_RubberBand), shape(QRubberBand::Line), opaque(false) -
299{ -
300}
never executed: }
0
301QStyleOptionTitleBar::QStyleOptionTitleBar() -
302 : QStyleOptionComplex(Version, SO_TitleBar), titleBarState(0), titleBarFlags(0) -
303{ -
304}
executed: }
Execution Count:14247
14247
305QStyleOptionTitleBar::QStyleOptionTitleBar(int version) -
306 : QStyleOptionComplex(version, SO_TitleBar), titleBarState(0), titleBarFlags(0) -
307{ -
308}
never executed: }
0
309QStyleOptionViewItem::QStyleOptionViewItem() -
310 : QStyleOption(Version, SO_ViewItem), -
311 displayAlignment(Qt::AlignLeft), decorationAlignment(Qt::AlignLeft), -
312 textElideMode(Qt::ElideMiddle), decorationPosition(Left), -
313 showDecorationSelected(false), features(None), widget(0), -
314 checkState(Qt::Unchecked), viewItemPosition(QStyleOptionViewItem::Invalid) -
315{ -
316}
executed: }
Execution Count:42350
42350
317 -
318 -
319 -
320 -
321QStyleOptionViewItem::QStyleOptionViewItem(int version) -
322 : QStyleOption(version, SO_ViewItem), -
323 displayAlignment(Qt::AlignLeft), decorationAlignment(Qt::AlignLeft), -
324 textElideMode(Qt::ElideMiddle), decorationPosition(Left), -
325 showDecorationSelected(false), features(None), widget(0), -
326 checkState(Qt::Unchecked), viewItemPosition(QStyleOptionViewItem::Invalid) -
327{ -
328}
never executed: }
0
329QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame() -
330 : QStyleOption(Version, SO_TabWidgetFrame), lineWidth(0), midLineWidth(0), -
331 shape(QTabBar::RoundedNorth) -
332{ -
333}
executed: }
Execution Count:338
338
334QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(int version) -
335 : QStyleOption(version, SO_TabWidgetFrame), lineWidth(0), midLineWidth(0), -
336 shape(QTabBar::RoundedNorth) -
337{ -
338}
never executed: }
0
339QStyleOptionTabBarBase::QStyleOptionTabBarBase() -
340 : QStyleOption(Version, SO_TabBarBase), shape(QTabBar::RoundedNorth), -
341 documentMode(false) -
342{ -
343}
executed: }
Execution Count:32
32
344 -
345 -
346QStyleOptionTabBarBase::QStyleOptionTabBarBase(int version) -
347 : QStyleOption(version, SO_TabBarBase), shape(QTabBar::RoundedNorth), -
348 documentMode(false) -
349{ -
350}
never executed: }
0
351QStyleOptionSizeGrip::QStyleOptionSizeGrip() -
352 : QStyleOptionComplex(Version, Type), corner(Qt::BottomRightCorner) -
353{ -
354}
executed: }
Execution Count:49
49
355QStyleOptionSizeGrip::QStyleOptionSizeGrip(int version) -
356 : QStyleOptionComplex(version, Type), corner(Qt::BottomRightCorner) -
357{ -
358}
never executed: }
0
359QStyleOptionGraphicsItem::QStyleOptionGraphicsItem() -
360 : QStyleOption(Version, Type), levelOfDetail(1) -
361{ -
362}
executed: }
Execution Count:831
831
363 -
364 -
365 -
366 -
367QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(int version) -
368 : QStyleOption(version, Type), levelOfDetail(1) -
369{ -
370}
never executed: }
0
371qreal QStyleOptionGraphicsItem::levelOfDetailFromTransform(const QTransform &worldTransform) -
372{ -
373 if (worldTransform.type() <= QTransform::TxTranslate)
evaluated: worldTransform.type() <= QTransform::TxTranslate
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:12
12-13
374 return 1;
executed: return 1;
Execution Count:13
13
375 -
376 -
377 QLineF v1(0, 0, 1, 0); -
378 QLineF v2(0, 0, 0, 1); -
379 -
380 return qSqrt(worldTransform.map(v1).length() * worldTransform.map(v2).length());
executed: return qSqrt(worldTransform.map(v1).length() * worldTransform.map(v2).length());
Execution Count:12
12
381} -
382QStyleHintReturn::QStyleHintReturn(int version, int type) -
383 : version(version), type(type) -
384{ -
385}
executed: }
Execution Count:922
922
386 -
387 -
388 -
389 -
390 -
391QStyleHintReturn::~QStyleHintReturn() -
392{ -
393 -
394} -
395QStyleHintReturnMask::QStyleHintReturnMask() : QStyleHintReturn(Version, Type) -
396{ -
397}
executed: }
Execution Count:922
922
398 -
399 -
400 -
401 -
402QStyleHintReturnMask::~QStyleHintReturnMask() -
403{ -
404} -
405QStyleHintReturnVariant::QStyleHintReturnVariant() : QStyleHintReturn(Version, Type) -
406{ -
407}
never executed: }
0
408 -
409 -
410 -
411 -
412QStyleHintReturnVariant::~QStyleHintReturnVariant() -
413{ -
414} -
415QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType) -
416{ -
417 (void)optionType;; -
418 -
419 return debug;
never executed: return debug;
0
420} -
421 -
422QDebug operator<<(QDebug debug, const QStyleOption &option) -
423{ -
424 (void)option;; -
425 -
426 return debug;
never executed: return debug;
0
427} -
428 -
429 -
430 -
431 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial