qwidgetaction.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/kernel/qwidgetaction.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5QWidgetAction::QWidgetAction(QObject *parent)-
6 : QAction(*(new QWidgetActionPrivate), parent)-
7{-
8}
never executed: end of block
0
9-
10-
11-
12-
13QWidgetAction::~QWidgetAction()-
14{-
15 QWidgetActionPrivate * const d = d_func();-
16 for (int i = 0; i < d->createdWidgets.count()
i < d->createdWidgets.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
17 disconnect(d->createdWidgets.at(i), qFlagLocation("2""destroyed(QObject*)" "\0" __FILE__ ":" "122"),
never executed: disconnect(d->createdWidgets.at(i), qFlagLocation("2""destroyed(QObject*)" "\0" __FILE__ ":" "122"), this, qFlagLocation("1""_q_widgetDestroyed(QObject*)" "\0" __FILE__ ":" "123"));
0
18 this, qFlagLocation("1""_q_widgetDestroyed(QObject*)" "\0" __FILE__ ":" "123"));
never executed: disconnect(d->createdWidgets.at(i), qFlagLocation("2""destroyed(QObject*)" "\0" __FILE__ ":" "122"), this, qFlagLocation("1""_q_widgetDestroyed(QObject*)" "\0" __FILE__ ":" "123"));
0
19 QList<QWidget *> widgetsToDelete = d->createdWidgets;-
20 d->createdWidgets.clear();-
21 qDeleteAll(widgetsToDelete);-
22 delete d->defaultWidget;-
23}
never executed: end of block
0
24void QWidgetAction::setDefaultWidget(QWidget *widget)-
25{-
26 QWidgetActionPrivate * const d = d_func();-
27 if (widget == d->defaultWidget
widget == d->defaultWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->defaultWidgetInUse
d->defaultWidgetInUseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
28 return;
never executed: return;
0
29 delete d->defaultWidget;-
30 d->defaultWidget = widget;-
31 if (!widget
!widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
32 return;
never executed: return;
0
33-
34 setVisible(!(widget->isHidden() && widget->testAttribute(Qt::WA_WState_ExplicitShowHide)));-
35 d->defaultWidget->hide();-
36 d->defaultWidget->setParent(0);-
37 d->defaultWidgetInUse = false;-
38 if (!isEnabled()
!isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
39 d->defaultWidget->setEnabled(false);
never executed: d->defaultWidget->setEnabled(false);
0
40}
never executed: end of block
0
41-
42-
43-
44-
45QWidget *QWidgetAction::defaultWidget() const-
46{-
47 const QWidgetActionPrivate * const d = d_func();-
48 return
never executed: return d->defaultWidget;
d->defaultWidget;
never executed: return d->defaultWidget;
0
49}-
50QWidget *QWidgetAction::requestWidget(QWidget *parent)-
51{-
52 QWidgetActionPrivate * const d = d_func();-
53-
54 QWidget *w = createWidget(parent);-
55 if (!w
!wDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
56 if (d->defaultWidgetInUse
d->defaultWidgetInUseDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->defaultWidget
!d->defaultWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
57 return
never executed: return 0;
0;
never executed: return 0;
0
58 d->defaultWidget->setParent(parent);-
59 d->defaultWidgetInUse = true;-
60 return
never executed: return d->defaultWidget;
d->defaultWidget;
never executed: return d->defaultWidget;
0
61 }-
62-
63 connect(w, qFlagLocation("2""destroyed(QObject*)" "\0" __FILE__ ":" "186"),-
64 this, qFlagLocation("1""_q_widgetDestroyed(QObject*)" "\0" __FILE__ ":" "187"));-
65 d->createdWidgets.append(w);-
66 return
never executed: return w;
w;
never executed: return w;
0
67}-
68void QWidgetAction::releaseWidget(QWidget *widget)-
69{-
70 QWidgetActionPrivate * const d = d_func();-
71-
72 if (widget == d->defaultWidget
widget == d->defaultWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
73 d->defaultWidget->hide();-
74 d->defaultWidget->setParent(0);-
75 d->defaultWidgetInUse = false;-
76 return;
never executed: return;
0
77 }-
78-
79 if (!d->createdWidgets.contains(widget)
!d->createdWid...ntains(widget)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
80 return;
never executed: return;
0
81-
82 disconnect(widget, qFlagLocation("2""destroyed(QObject*)" "\0" __FILE__ ":" "214"),-
83 this, qFlagLocation("1""_q_widgetDestroyed(QObject*)" "\0" __FILE__ ":" "215"));-
84 d->createdWidgets.removeAll(widget);-
85 deleteWidget(widget);-
86}
never executed: end of block
0
87-
88-
89-
90-
91bool QWidgetAction::event(QEvent *event)-
92{-
93 QWidgetActionPrivate * const d = d_func();-
94 if (event->type() == QEvent::ActionChanged
event->type() ...:ActionChangedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
95 if (d->defaultWidget
d->defaultWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
96 d->defaultWidget->setEnabled(isEnabled());
never executed: d->defaultWidget->setEnabled(isEnabled());
0
97 for (int i = 0; i < d->createdWidgets.count()
i < d->createdWidgets.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
98 d->createdWidgets.at(i)->setEnabled(isEnabled());
never executed: d->createdWidgets.at(i)->setEnabled(isEnabled());
0
99 }
never executed: end of block
0
100 return
never executed: return QAction::event(event);
QAction::event(event);
never executed: return QAction::event(event);
0
101}-
102-
103-
104-
105-
106bool QWidgetAction::eventFilter(QObject *obj, QEvent *event)-
107{-
108 return
never executed: return QAction::eventFilter(obj,event);
QAction::eventFilter(obj,event);
never executed: return QAction::eventFilter(obj,event);
0
109}-
110QWidget *QWidgetAction::createWidget(QWidget *parent)-
111{-
112 (void)parent;-
113 return
never executed: return 0;
0;
never executed: return 0;
0
114}-
115void QWidgetAction::deleteWidget(QWidget *widget)-
116{-
117 widget->hide();-
118 widget->deleteLater();-
119}
never executed: end of block
0
120-
121-
122-
123-
124-
125QList<QWidget *> QWidgetAction::createdWidgets() const-
126{-
127 const QWidgetActionPrivate * const d = d_func();-
128 return
never executed: return d->createdWidgets;
d->createdWidgets;
never executed: return d->createdWidgets;
0
129}-
130-
131-
132-
Switch to Source codePreprocessed file

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