qgroupbox.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/widgets/qgroupbox.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8class QGroupBoxPrivate : public QWidgetPrivate-
9{-
10 inline QGroupBox* q_func() { return static_cast<QGroupBox *>(q_ptr); } inline const QGroupBox* q_func() const { return static_cast<const QGroupBox *>(q_ptr); } friend class QGroupBox;-
11-
12public:-
13 void skip();-
14 void init();-
15 void calculateFrame();-
16 QString title;-
17 int align;-
18-
19 int shortcutId;-
20-
21-
22 void _q_fixFocus(Qt::FocusReason reason);-
23 void _q_setChildrenEnabled(bool b);-
24 void click();-
25 bool flat;-
26 bool checkable;-
27 bool checked;-
28 bool hover;-
29 bool overCheckBox;-
30 QStyle::SubControl pressedControl;-
31};-
32void QGroupBox::initStyleOption(QStyleOptionGroupBox *option) const-
33{-
34 if (!option
!optionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
35 return;
never executed: return;
0
36-
37 const QGroupBoxPrivate * const d = d_func();-
38 option->initFrom(this);-
39 option->text = d->title;-
40 option->lineWidth = 1;-
41 option->midLineWidth = 0;-
42 option->textAlignment = Qt::Alignment(d->align);-
43 option->activeSubControls |= d->pressedControl;-
44 option->subControls = QStyle::SC_GroupBoxFrame;-
45-
46 option->state.setFlag(QStyle::State_MouseOver, d->hover);-
47 if (d->flat
d->flatDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
48 option->features |= QStyleOptionFrame::Flat;
never executed: option->features |= QStyleOptionFrame::Flat;
0
49-
50 if (d->checkable
d->checkableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
51 option->subControls |= QStyle::SC_GroupBoxCheckBox;-
52 option->state |= (d->checked
d->checkedDescription
TRUEnever evaluated
FALSEnever evaluated
? QStyle::State_On : QStyle::State_Off);
0
53 if ((d->pressedControl == QStyle::SC_GroupBoxCheckBox
d->pressedCont...oupBoxCheckBoxDescription
TRUEnever evaluated
FALSEnever evaluated
0
54 || d->pressedControl == QStyle::SC_GroupBoxLabel
d->pressedCont..._GroupBoxLabelDescription
TRUEnever evaluated
FALSEnever evaluated
) && (d->hover
d->hoverDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->overCheckBox
d->overCheckBoxDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
55 option->state |= QStyle::State_Sunken;
never executed: option->state |= QStyle::State_Sunken;
0
56 }
never executed: end of block
0
57-
58 if (!option->palette.isBrushSet(isEnabled() ? QPalette::Active :
!option->palet...e::WindowText)Description
TRUEnever evaluated
FALSEnever evaluated
0
59 QPalette::Disabled, QPalette::WindowText)
!option->palet...e::WindowText)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
60 option->textColor = QColor(style()->styleHint(QStyle::SH_GroupBox_TextLabelColor,
never executed: option->textColor = QColor(style()->styleHint(QStyle::SH_GroupBox_TextLabelColor, option, this));
0
61 option, this));
never executed: option->textColor = QColor(style()->styleHint(QStyle::SH_GroupBox_TextLabelColor, option, this));
0
62-
63 if (!d->title.isEmpty()
!d->title.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
64 option->subControls |= QStyle::SC_GroupBoxLabel;
never executed: option->subControls |= QStyle::SC_GroupBoxLabel;
0
65}
never executed: end of block
0
66-
67void QGroupBoxPrivate::click()-
68{-
69 QGroupBox * const q = q_func();-
70-
71 QPointer<QGroupBox> guard(q);-
72 q->setChecked(!checked);-
73 if (!guard
!guardDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
74 return;
never executed: return;
0
75 q->clicked(checked);-
76}
never executed: end of block
0
77QGroupBox::QGroupBox(QWidget *parent)-
78 : QWidget(*new QGroupBoxPrivate, parent, 0)-
79{-
80 QGroupBoxPrivate * const d = d_func();-
81 d->init();-
82}
never executed: end of block
0
83-
84-
85-
86-
87-
88QGroupBox::QGroupBox(const QString &title, QWidget *parent)-
89 : QWidget(*new QGroupBoxPrivate, parent, 0)-
90{-
91 QGroupBoxPrivate * const d = d_func();-
92 d->init();-
93 setTitle(title);-
94}
never executed: end of block
0
95-
96-
97-
98-
99-
100QGroupBox::~QGroupBox()-
101{-
102}-
103-
104void QGroupBoxPrivate::init()-
105{-
106 QGroupBox * const q = q_func();-
107 align = Qt::AlignLeft;-
108-
109 shortcutId = 0;-
110-
111 flat = false;-
112 checkable = false;-
113 checked = true;-
114 hover = false;-
115 overCheckBox = false;-
116 pressedControl = QStyle::SC_None;-
117 calculateFrame();-
118 q->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred,-
119 QSizePolicy::GroupBox));-
120}
never executed: end of block
0
121-
122void QGroupBox::setTitle(const QString &title)-
123{-
124 QGroupBoxPrivate * const d = d_func();-
125 if (d->title == title
d->title == titleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
126 return;
never executed: return;
0
127 d->title = title;-
128-
129 releaseShortcut(d->shortcutId);-
130 d->shortcutId = grabShortcut(QKeySequence::mnemonic(title));-
131-
132 d->calculateFrame();-
133-
134 update();-
135 updateGeometry();-
136-
137 QAccessibleEvent event(this, QAccessible::NameChanged);-
138 QAccessible::updateAccessibility(&event);-
139-
140}
never executed: end of block
0
141QString QGroupBox::title() const-
142{-
143 const QGroupBoxPrivate * const d = d_func();-
144 return
never executed: return d->title;
d->title;
never executed: return d->title;
0
145}-
146Qt::Alignment QGroupBox::alignment() const-
147{-
148 const QGroupBoxPrivate * const d = d_func();-
149 return
never executed: return QFlag(d->align);
QFlag(d->align);
never executed: return QFlag(d->align);
0
150}-
151-
152void QGroupBox::setAlignment(int alignment)-
153{-
154 QGroupBoxPrivate * const d = d_func();-
155 d->align = alignment;-
156 updateGeometry();-
157 update();-
158}
never executed: end of block
0
159-
160-
161-
162void QGroupBox::resizeEvent(QResizeEvent *e)-
163{-
164 QWidget::resizeEvent(e);-
165}
never executed: end of block
0
166-
167-
168-
169-
170void QGroupBox::paintEvent(QPaintEvent *)-
171{-
172 QStylePainter paint(this);-
173 QStyleOptionGroupBox option;-
174 initStyleOption(&option);-
175 paint.drawComplexControl(QStyle::CC_GroupBox, option);-
176}
never executed: end of block
0
177-
178-
179bool QGroupBox::event(QEvent *e)-
180{-
181 QGroupBoxPrivate * const d = d_func();-
182-
183 if (e->type() == QEvent::Shortcut
e->type() == QEvent::ShortcutDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
184 QShortcutEvent *se = static_cast<QShortcutEvent *>(e);-
185 if (se->shortcutId() == d->shortcutId
se->shortcutId... d->shortcutIdDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
186 if (!isCheckable()
!isCheckable()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
187 d->_q_fixFocus(Qt::ShortcutFocusReason);-
188 }
never executed: end of block
else {
0
189 d->click();-
190 setFocus(Qt::ShortcutFocusReason);-
191 }
never executed: end of block
0
192 return
never executed: return true;
true;
never executed: return true;
0
193 }-
194 }
never executed: end of block
0
195-
196 QStyleOptionGroupBox box;-
197 initStyleOption(&box);-
198 switch (e->type()) {-
199 case
never executed: case QEvent::HoverEnter:
QEvent::HoverEnter:
never executed: case QEvent::HoverEnter:
0
200 case
never executed: case QEvent::HoverMove:
QEvent::HoverMove:
never executed: case QEvent::HoverMove:
{
0
201 QStyle::SubControl control = style()->hitTestComplexControl(QStyle::CC_GroupBox, &box,-
202 static_cast<QHoverEvent *>(e)->pos(),-
203 this);-
204 bool oldHover = d->hover;-
205 d->hover = d->checkable
d->checkableDescription
TRUEnever evaluated
FALSEnever evaluated
&& (control == QStyle::SC_GroupBoxLabel
control == QSt..._GroupBoxLabelDescription
TRUEnever evaluated
FALSEnever evaluated
|| control == QStyle::SC_GroupBoxCheckBox
control == QSt...oupBoxCheckBoxDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
206 if (oldHover != d->hover
oldHover != d->hoverDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
207 QRect rect = style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this)-
208 | style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxLabel, this);-
209 update(rect);-
210 }
never executed: end of block
0
211 return
never executed: return true;
true;
never executed: return true;
0
212 }-
213 case
never executed: case QEvent::HoverLeave:
QEvent::HoverLeave:
never executed: case QEvent::HoverLeave:
0
214 d->hover = false;-
215 if (d->checkable
d->checkableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
216 QRect rect = style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this)-
217 | style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxLabel, this);-
218 update(rect);-
219 }
never executed: end of block
0
220 return
never executed: return true;
true;
never executed: return true;
0
221 case
never executed: case QEvent::KeyPress:
QEvent::KeyPress:
never executed: case QEvent::KeyPress:
{
0
222 QKeyEvent *k = static_cast<QKeyEvent*>(e);-
223 if (!k->isAutoRepeat()
!k->isAutoRepeat()Description
TRUEnever evaluated
FALSEnever evaluated
&& (k->key() == Qt::Key_Select
k->key() == Qt::Key_SelectDescription
TRUEnever evaluated
FALSEnever evaluated
|| k->key() == Qt::Key_Space
k->key() == Qt::Key_SpaceDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
224 d->pressedControl = QStyle::SC_GroupBoxCheckBox;-
225 update(style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this));-
226 return
never executed: return true;
true;
never executed: return true;
0
227 }-
228 break;
never executed: break;
0
229 }-
230 case
never executed: case QEvent::KeyRelease:
QEvent::KeyRelease:
never executed: case QEvent::KeyRelease:
{
0
231 QKeyEvent *k = static_cast<QKeyEvent*>(e);-
232 if (!k->isAutoRepeat()
!k->isAutoRepeat()Description
TRUEnever evaluated
FALSEnever evaluated
&& (k->key() == Qt::Key_Select
k->key() == Qt::Key_SelectDescription
TRUEnever evaluated
FALSEnever evaluated
|| k->key() == Qt::Key_Space
k->key() == Qt::Key_SpaceDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
233 bool toggle = (d->pressedControl == QStyle::SC_GroupBoxLabel
d->pressedCont..._GroupBoxLabelDescription
TRUEnever evaluated
FALSEnever evaluated
0
234 || d->pressedControl == QStyle::SC_GroupBoxCheckBox
d->pressedCont...oupBoxCheckBoxDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
235 d->pressedControl = QStyle::SC_None;-
236 if (toggle
toggleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
237 d->click();
never executed: d->click();
0
238 return
never executed: return true;
true;
never executed: return true;
0
239 }-
240 break;
never executed: break;
0
241 }-
242 default
never executed: default:
:
never executed: default:
0
243 break;
never executed: break;
0
244 }-
245 return
never executed: return QWidget::event(e);
QWidget::event(e);
never executed: return QWidget::event(e);
0
246}-
247-
248-
249void QGroupBox::childEvent(QChildEvent *c)-
250{-
251 QGroupBoxPrivate * const d = d_func();-
252 if (c->type() != QEvent::ChildAdded
c->type() != Q...nt::ChildAddedDescription
TRUEnever evaluated
FALSEnever evaluated
|| !c->child()->isWidgetType()
!c->child()->isWidgetType()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
253 return;
never executed: return;
0
254 QWidget *w = (QWidget*)c->child();-
255 if (w->isWindow()
w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
256 return;
never executed: return;
0
257 if (d->checkable
d->checkableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
258 if (d->checked
d->checkedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
259 if (!w->testAttribute(Qt::WA_ForceDisabled)
!w->testAttrib...ForceDisabled)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
260 w->setEnabled(true);
never executed: w->setEnabled(true);
0
261 }
never executed: end of block
else {
0
262 if (w->isEnabled()
w->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
263 w->setEnabled(false);-
264 w->setAttribute(Qt::WA_ForceDisabled, false);-
265 }
never executed: end of block
0
266 }
never executed: end of block
0
267 }-
268}
never executed: end of block
0
269void QGroupBoxPrivate::_q_fixFocus(Qt::FocusReason reason)-
270{-
271 QGroupBox * const q = q_func();-
272 QWidget *fw = q->focusWidget();-
273 if (!fw
!fwDescription
TRUEnever evaluated
FALSEnever evaluated
|| fw == q
fw == qDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
274 QWidget * best = 0;-
275 QWidget * candidate = 0;-
276 QWidget * w = q;-
277 while ((
(w = w->nextIn...sChain()) != qDescription
TRUEnever evaluated
FALSEnever evaluated
w = w->nextInFocusChain()) != q
(w = w->nextIn...sChain()) != qDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
278 if (q->isAncestorOf(w)
q->isAncestorOf(w)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(w->focusPolic...= Qt::TabFocusDescription
TRUEnever evaluated
FALSEnever evaluated
w->focusPolicy() & Qt::TabFocus) == Qt::TabFocus
(w->focusPolic...= Qt::TabFocusDescription
TRUEnever evaluated
FALSEnever evaluated
&& w->isVisibleTo(q)
w->isVisibleTo(q)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
279 if (!best
!bestDescription
TRUEnever evaluated
FALSEnever evaluated
&& qobject_cast<QRadioButton*>(w)
qobject_cast<QRadioButton*>(w)Description
TRUEnever evaluated
FALSEnever evaluated
&& ((
((QRadioButton...)->isChecked()Description
TRUEnever evaluated
FALSEnever evaluated
QRadioButton*)w)->isChecked()
((QRadioButton...)->isChecked()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
280-
281-
282 best = w;
never executed: best = w;
0
283 else-
284 if (!candidate
!candidateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
285-
286 candidate = w;
never executed: candidate = w;
0
287 }
never executed: end of block
0
288 }
never executed: end of block
0
289 if (best
bestDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
290 fw = best;
never executed: fw = best;
0
291 else if (candidate
candidateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
292 fw = candidate;
never executed: fw = candidate;
0
293 }
never executed: end of block
0
294 if (fw
fwDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
295 fw->setFocus(reason);
never executed: fw->setFocus(reason);
0
296}
never executed: end of block
0
297-
298-
299-
300-
301void QGroupBoxPrivate::calculateFrame()-
302{-
303 QGroupBox * const q = q_func();-
304 QStyleOptionGroupBox box;-
305 q->initStyleOption(&box);-
306 QRect contentsRect = q->style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxContents, q);-
307 q->setContentsMargins(contentsRect.left() - box.rect.left(), contentsRect.top() - box.rect.top(),-
308 box.rect.right() - contentsRect.right(), box.rect.bottom() - contentsRect.bottom());-
309 setLayoutItemMargins(QStyle::SE_GroupBoxLayoutItem, &box);-
310}
never executed: end of block
0
311-
312-
313-
314void QGroupBox::focusInEvent(QFocusEvent *fe)-
315{-
316 QGroupBoxPrivate * const d = d_func();-
317 if (focusPolicy() == Qt::NoFocus
focusPolicy() == Qt::NoFocusDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
318 d->_q_fixFocus(fe->reason());-
319 }
never executed: end of block
else {
0
320 QWidget::focusInEvent(fe);-
321 }
never executed: end of block
0
322}-
323-
324-
325-
326-
327-
328QSize QGroupBox::minimumSizeHint() const-
329{-
330 const QGroupBoxPrivate * const d = d_func();-
331 QStyleOptionGroupBox option;-
332 initStyleOption(&option);-
333-
334 QFontMetrics metrics(fontMetrics());-
335-
336 int baseWidth = metrics.width(d->title) + metrics.width(QLatin1Char(' '));-
337 int baseHeight = metrics.height();-
338 if (d->checkable
d->checkableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
339 baseWidth += style()->pixelMetric(QStyle::PM_IndicatorWidth);-
340 baseWidth += style()->pixelMetric(QStyle::PM_CheckBoxLabelSpacing);-
341 baseHeight = qMax(baseHeight, style()->pixelMetric(QStyle::PM_IndicatorHeight));-
342 }
never executed: end of block
0
343-
344 QSize size = style()->sizeFromContents(QStyle::CT_GroupBox, &option, QSize(baseWidth, baseHeight), this);-
345 return
never executed: return size.expandedTo(QWidget::minimumSizeHint());
size.expandedTo(QWidget::minimumSizeHint());
never executed: return size.expandedTo(QWidget::minimumSizeHint());
0
346}-
347bool QGroupBox::isFlat() const-
348{-
349 const QGroupBoxPrivate * const d = d_func();-
350 return
never executed: return d->flat;
d->flat;
never executed: return d->flat;
0
351}-
352-
353void QGroupBox::setFlat(bool b)-
354{-
355 QGroupBoxPrivate * const d = d_func();-
356 if (d->flat == b
d->flat == bDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
357 return;
never executed: return;
0
358 d->flat = b;-
359 updateGeometry();-
360 update();-
361}
never executed: end of block
0
362void QGroupBox::setCheckable(bool checkable)-
363{-
364 QGroupBoxPrivate * const d = d_func();-
365-
366 bool wasCheckable = d->checkable;-
367 d->checkable = checkable;-
368-
369 if (checkable
checkableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
370 setChecked(true);-
371 if (!wasCheckable
!wasCheckableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
372 setFocusPolicy(Qt::StrongFocus);-
373 d->_q_setChildrenEnabled(true);-
374 updateGeometry();-
375 }
never executed: end of block
0
376 }
never executed: end of block
else {
0
377 if (wasCheckable
wasCheckableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
378 setFocusPolicy(Qt::NoFocus);-
379 d->_q_setChildrenEnabled(true);-
380 updateGeometry();-
381 }
never executed: end of block
0
382 d->_q_setChildrenEnabled(true);-
383 }
never executed: end of block
0
384-
385 if (wasCheckable != checkable
wasCheckable != checkableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
386 d->calculateFrame();-
387 update();-
388 }
never executed: end of block
0
389}
never executed: end of block
0
390-
391bool QGroupBox::isCheckable() const-
392{-
393 const QGroupBoxPrivate * const d = d_func();-
394 return
never executed: return d->checkable;
d->checkable;
never executed: return d->checkable;
0
395}-
396-
397-
398bool QGroupBox::isChecked() const-
399{-
400 const QGroupBoxPrivate * const d = d_func();-
401 return
never executed: return d->checkable && d->checked;
d->checkable && d->checked;
never executed: return d->checkable && d->checked;
0
402}-
403void QGroupBox::setChecked(bool b)-
404{-
405 QGroupBoxPrivate * const d = d_func();-
406 if (d->checkable
d->checkableDescription
TRUEnever evaluated
FALSEnever evaluated
&& b != d->checked
b != d->checkedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
407 update();-
408 d->checked = b;-
409 d->_q_setChildrenEnabled(b);-
410-
411 QAccessible::State st;-
412 st.checked = true;-
413 QAccessibleStateChangeEvent e(this, st);-
414 QAccessible::updateAccessibility(&e);-
415-
416 toggled(b);-
417 }
never executed: end of block
0
418}
never executed: end of block
0
419-
420-
421-
422-
423-
424void QGroupBoxPrivate::_q_setChildrenEnabled(bool b)-
425{-
426 QGroupBox * const q = q_func();-
427 for (QObject *o : q->children()) {-
428 if (o->isWidgetType()
o->isWidgetType()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
429 QWidget *w = static_cast<QWidget *>(o);-
430 if (b
bDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
431 if (!w->testAttribute(Qt::WA_ForceDisabled)
!w->testAttrib...ForceDisabled)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
432 w->setEnabled(true);
never executed: w->setEnabled(true);
0
433 }
never executed: end of block
else {
0
434 if (w->isEnabled()
w->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
435 w->setEnabled(false);-
436 w->setAttribute(Qt::WA_ForceDisabled, false);-
437 }
never executed: end of block
0
438 }
never executed: end of block
0
439 }-
440 }
never executed: end of block
0
441}
never executed: end of block
0
442-
443-
444void QGroupBox::changeEvent(QEvent *ev)-
445{-
446 QGroupBoxPrivate * const d = d_func();-
447 if (ev->type() == QEvent::EnabledChange
ev->type() == ...:EnabledChangeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
448 if (d->checkable
d->checkableDescription
TRUEnever evaluated
FALSEnever evaluated
&& isEnabled()
isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
449-
450 if (!d->checked
!d->checkedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
451 d->_q_setChildrenEnabled(false);
never executed: d->_q_setChildrenEnabled(false);
0
452 }
never executed: end of block
0
453 }
never executed: end of block
else if (ev->type() == QEvent::FontChange
ev->type() == ...nt::FontChangeDescription
TRUEnever evaluated
FALSEnever evaluated
0
454-
455-
456-
457 || ev->type() == QEvent::StyleChange
ev->type() == ...t::StyleChangeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
458 d->calculateFrame();-
459 }
never executed: end of block
0
460 QWidget::changeEvent(ev);-
461}
never executed: end of block
0
462-
463-
464void QGroupBox::mousePressEvent(QMouseEvent *event)-
465{-
466 if (event->button() != Qt::LeftButton
event->button(...Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
467 event->ignore();-
468 return;
never executed: return;
0
469 }-
470-
471 QGroupBoxPrivate * const d = d_func();-
472 QStyleOptionGroupBox box;-
473 initStyleOption(&box);-
474 d->pressedControl = style()->hitTestComplexControl(QStyle::CC_GroupBox, &box,-
475 event->pos(), this);-
476 if (d->checkable
d->checkableDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(d->pressedCon...roupBoxLabel))Description
TRUEnever evaluated
FALSEnever evaluated
d->pressedControl & (QStyle::SC_GroupBoxCheckBox | QStyle::SC_GroupBoxLabel))
(d->pressedCon...roupBoxLabel))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
477 d->overCheckBox = true;-
478 update(style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this));-
479 }
never executed: end of block
else {
0
480 event->ignore();-
481 }
never executed: end of block
0
482}-
483-
484-
485void QGroupBox::mouseMoveEvent(QMouseEvent *event)-
486{-
487 QGroupBoxPrivate * const d = d_func();-
488 QStyleOptionGroupBox box;-
489 initStyleOption(&box);-
490 QStyle::SubControl pressed = style()->hitTestComplexControl(QStyle::CC_GroupBox, &box,-
491 event->pos(), this);-
492 bool oldOverCheckBox = d->overCheckBox;-
493 d->overCheckBox = (pressed == QStyle::SC_GroupBoxCheckBox
pressed == QSt...oupBoxCheckBoxDescription
TRUEnever evaluated
FALSEnever evaluated
|| pressed == QStyle::SC_GroupBoxLabel
pressed == QSt..._GroupBoxLabelDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
494 if (d->checkable
d->checkableDescription
TRUEnever evaluated
FALSEnever evaluated
&& (d->pressedControl == QStyle::SC_GroupBoxCheckBox
d->pressedCont...oupBoxCheckBoxDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->pressedControl == QStyle::SC_GroupBoxLabel
d->pressedCont..._GroupBoxLabelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
495 && (
(d->overCheckB...dOverCheckBox)Description
TRUEnever evaluated
FALSEnever evaluated
d->overCheckBox != oldOverCheckBox)
(d->overCheckB...dOverCheckBox)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
496 update(style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this));
never executed: update(style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this));
0
497-
498 event->ignore();-
499}
never executed: end of block
0
500-
501-
502void QGroupBox::mouseReleaseEvent(QMouseEvent *event)-
503{-
504 if (event->button() != Qt::LeftButton
event->button(...Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
505 event->ignore();-
506 return;
never executed: return;
0
507 }-
508-
509 QGroupBoxPrivate * const d = d_func();-
510 if (!d->overCheckBox
!d->overCheckBoxDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
511 event->ignore();-
512 return;
never executed: return;
0
513 }-
514 QStyleOptionGroupBox box;-
515 initStyleOption(&box);-
516 QStyle::SubControl released = style()->hitTestComplexControl(QStyle::CC_GroupBox, &box,-
517 event->pos(), this);-
518 bool toggle = d->checkable
d->checkableDescription
TRUEnever evaluated
FALSEnever evaluated
&& (released == QStyle::SC_GroupBoxLabel
released == QS..._GroupBoxLabelDescription
TRUEnever evaluated
FALSEnever evaluated
0
519 || released == QStyle::SC_GroupBoxCheckBox
released == QS...oupBoxCheckBoxDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
520 d->pressedControl = QStyle::SC_None;-
521 d->overCheckBox = false;-
522 if (toggle
toggleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
523 d->click();
never executed: d->click();
0
524 else if (d->checkable
d->checkableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
525 update(style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this));
never executed: update(style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this));
0
526}
never executed: end of block
0
527-
528-
529-
530-
Switch to Source codePreprocessed file

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