qbuttongroup.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/widgets/qbuttongroup.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8void QButtonGroupPrivate::detectCheckedButton()-
9{-
10 QAbstractButton *previous = checkedButton;-
11 checkedButton = 0;-
12 if (exclusive
exclusiveDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
13 return;
never executed: return;
0
14 for (int i = 0; i < buttonList.count()
i < buttonList.count()Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
15 if (buttonList.at(i) != previous
buttonList.at(i) != previousDescription
TRUEnever evaluated
FALSEnever evaluated
&& buttonList.at(i)->isChecked()
buttonList.at(i)->isChecked()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
16 checkedButton = buttonList.at(i);-
17 return;
never executed: return;
0
18 }-
19 }
never executed: end of block
0
20}
never executed: end of block
0
21QButtonGroup::QButtonGroup(QObject *parent)-
22 : QObject(*new QButtonGroupPrivate, parent)-
23{-
24}
never executed: end of block
0
25-
26-
27-
28-
29QButtonGroup::~QButtonGroup()-
30{-
31 QButtonGroupPrivate * const d = d_func();-
32 for (int i = 0; i < d->buttonList.count()
i < d->buttonList.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
33 d->buttonList.at(i)->d_func()->group = 0;
never executed: d->buttonList.at(i)->d_func()->group = 0;
0
34}
never executed: end of block
0
35bool QButtonGroup::exclusive() const-
36{-
37 const QButtonGroupPrivate * const d = d_func();-
38 return
never executed: return d->exclusive;
d->exclusive;
never executed: return d->exclusive;
0
39}-
40-
41void QButtonGroup::setExclusive(bool exclusive)-
42{-
43 QButtonGroupPrivate * const d = d_func();-
44 d->exclusive = exclusive;-
45}
never executed: end of block
0
46void QButtonGroup::addButton(QAbstractButton *button, int id)-
47{-
48 QButtonGroupPrivate * const d = d_func();-
49 if (QButtonGroup *previous = button->d_func()->group
QButtonGroup *..._func()->groupDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
50 previous->removeButton(button);
never executed: previous->removeButton(button);
0
51 button->d_func()->group = this;-
52 d->buttonList.append(button);-
53 if (id == -1
id == -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
54 const QHash<QAbstractButton*, int>::const_iterator it-
55 = std::min_element(d->mapping.cbegin(), d->mapping.cend());-
56 if (it == d->mapping.cend()
it == d->mapping.cend()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
57 d->mapping[button] = -2;
never executed: d->mapping[button] = -2;
0
58 else-
59 d->mapping[button] = *it - 1;
never executed: d->mapping[button] = *it - 1;
0
60 } else {-
61 d->mapping[button] = id;-
62 }
never executed: end of block
0
63-
64 if (d->exclusive
d->exclusiveDescription
TRUEnever evaluated
FALSEnever evaluated
&& button->isChecked()
button->isChecked()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
65 button->d_func()->notifyChecked();
never executed: button->d_func()->notifyChecked();
0
66}
never executed: end of block
0
67-
68-
69-
70-
71-
72-
73void QButtonGroup::removeButton(QAbstractButton *button)-
74{-
75 QButtonGroupPrivate * const d = d_func();-
76 if (d->checkedButton == button
d->checkedButton == buttonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
77 d->detectCheckedButton();-
78 }
never executed: end of block
0
79 if (button->d_func()->group == this
button->d_func...>group == thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
80 button->d_func()->group = 0;-
81 d->buttonList.removeAll(button);-
82 d->mapping.remove(button);-
83 }
never executed: end of block
0
84}
never executed: end of block
0
85-
86-
87-
88-
89-
90-
91QList<QAbstractButton*> QButtonGroup::buttons() const-
92{-
93 const QButtonGroupPrivate * const d = d_func();-
94 return
never executed: return d->buttonList;
d->buttonList;
never executed: return d->buttonList;
0
95}-
96-
97-
98-
99-
100-
101-
102-
103QAbstractButton *QButtonGroup::checkedButton() const-
104{-
105 const QButtonGroupPrivate * const d = d_func();-
106 return
never executed: return d->checkedButton;
d->checkedButton;
never executed: return d->checkedButton;
0
107}-
108-
109-
110-
111-
112-
113-
114-
115QAbstractButton *QButtonGroup::button(int id) const-
116{-
117 const QButtonGroupPrivate * const d = d_func();-
118 return
never executed: return d->mapping.key(id);
d->mapping.key(id);
never executed: return d->mapping.key(id);
0
119}-
120void QButtonGroup::setId(QAbstractButton *button, int id)-
121{-
122 QButtonGroupPrivate * const d = d_func();-
123 if (button
buttonDescription
TRUEnever evaluated
FALSEnever evaluated
&& id != -1
id != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
124 d->mapping[button] = id;
never executed: d->mapping[button] = id;
0
125}
never executed: end of block
0
126int QButtonGroup::id(QAbstractButton *button) const-
127{-
128 const QButtonGroupPrivate * const d = d_func();-
129 return
never executed: return d->mapping.value(button, -1);
d->mapping.value(button, -1);
never executed: return d->mapping.value(button, -1);
0
130}-
131int QButtonGroup::checkedId() const-
132{-
133 const QButtonGroupPrivate * const d = d_func();-
134 return
never executed: return d->mapping.value(d->checkedButton, -1);
d->mapping.value(d->checkedButton, -1);
never executed: return d->mapping.value(d->checkedButton, -1);
0
135}-
136-
137-
138-
Switch to Source codePreprocessed file

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