Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/widgets/qstackedwidget.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | class QStackedWidgetPrivate : public QFramePrivate | - | ||||||
8 | { | - | ||||||
9 | inline QStackedWidget* q_func() { return static_cast<QStackedWidget *>(q_ptr); } inline const QStackedWidget* q_func() const { return static_cast<const QStackedWidget *>(q_ptr); } friend class QStackedWidget; | - | ||||||
10 | public: | - | ||||||
11 | QStackedWidgetPrivate():layout(0){} never executed: end of block | 0 | ||||||
12 | QStackedLayout *layout; | - | ||||||
13 | bool blockChildAdd; | - | ||||||
14 | }; | - | ||||||
15 | QStackedWidget::QStackedWidget(QWidget *parent) | - | ||||||
16 | : QFrame(*new QStackedWidgetPrivate, parent) | - | ||||||
17 | { | - | ||||||
18 | QStackedWidgetPrivate * const d = d_func(); | - | ||||||
19 | d->layout = new QStackedLayout(this); | - | ||||||
20 | connect(d->layout, qFlagLocation("2""widgetRemoved(int)" "\0" __FILE__ ":" "140"), this, qFlagLocation("2""widgetRemoved(int)" "\0" __FILE__ ":" "140")); | - | ||||||
21 | connect(d->layout, qFlagLocation("2""currentChanged(int)" "\0" __FILE__ ":" "141"), this, qFlagLocation("2""currentChanged(int)" "\0" __FILE__ ":" "141")); | - | ||||||
22 | } never executed: end of block | 0 | ||||||
23 | - | |||||||
24 | - | |||||||
25 | - | |||||||
26 | - | |||||||
27 | QStackedWidget::~QStackedWidget() | - | ||||||
28 | { | - | ||||||
29 | } | - | ||||||
30 | int QStackedWidget::addWidget(QWidget *widget) | - | ||||||
31 | { | - | ||||||
32 | return never executed: d_func()->layout->addWidget(widget);return d_func()->layout->addWidget(widget); never executed: return d_func()->layout->addWidget(widget); | 0 | ||||||
33 | } | - | ||||||
34 | int QStackedWidget::insertWidget(int index, QWidget *widget) | - | ||||||
35 | { | - | ||||||
36 | return never executed: d_func()->layout->insertWidget(index, widget);return d_func()->layout->insertWidget(index, widget); never executed: return d_func()->layout->insertWidget(index, widget); | 0 | ||||||
37 | } | - | ||||||
38 | void QStackedWidget::removeWidget(QWidget *widget) | - | ||||||
39 | { | - | ||||||
40 | d_func()->layout->removeWidget(widget); | - | ||||||
41 | } never executed: end of block | 0 | ||||||
42 | void QStackedWidget::setCurrentIndex(int index) | - | ||||||
43 | { | - | ||||||
44 | d_func()->layout->setCurrentIndex(index); | - | ||||||
45 | } never executed: end of block | 0 | ||||||
46 | - | |||||||
47 | int QStackedWidget::currentIndex() const | - | ||||||
48 | { | - | ||||||
49 | return never executed: d_func()->layout->currentIndex();return d_func()->layout->currentIndex(); never executed: return d_func()->layout->currentIndex(); | 0 | ||||||
50 | } | - | ||||||
51 | - | |||||||
52 | - | |||||||
53 | - | |||||||
54 | - | |||||||
55 | - | |||||||
56 | - | |||||||
57 | QWidget *QStackedWidget::currentWidget() const | - | ||||||
58 | { | - | ||||||
59 | return never executed: d_func()->layout->currentWidget();return d_func()->layout->currentWidget(); never executed: return d_func()->layout->currentWidget(); | 0 | ||||||
60 | } | - | ||||||
61 | void QStackedWidget::setCurrentWidget(QWidget *widget) | - | ||||||
62 | { | - | ||||||
63 | QStackedWidgetPrivate * const d = d_func(); | - | ||||||
64 | if (__builtin_expect(!!(d->layout->indexOf(widget) == -1), false)
| 0 | ||||||
65 | QMessageLogger(__FILE__, 247, __PRETTY_FUNCTION__).warning("QStackedWidget::setCurrentWidget: widget %p not contained in stack", widget); | - | ||||||
66 | return; never executed: return; | 0 | ||||||
67 | } | - | ||||||
68 | d->layout->setCurrentWidget(widget); | - | ||||||
69 | } never executed: end of block | 0 | ||||||
70 | - | |||||||
71 | - | |||||||
72 | - | |||||||
73 | - | |||||||
74 | - | |||||||
75 | - | |||||||
76 | - | |||||||
77 | int QStackedWidget::indexOf(QWidget *widget) const | - | ||||||
78 | { | - | ||||||
79 | return never executed: d_func()->layout->indexOf(widget);return d_func()->layout->indexOf(widget); never executed: return d_func()->layout->indexOf(widget); | 0 | ||||||
80 | } | - | ||||||
81 | - | |||||||
82 | - | |||||||
83 | - | |||||||
84 | - | |||||||
85 | - | |||||||
86 | - | |||||||
87 | - | |||||||
88 | QWidget *QStackedWidget::widget(int index) const | - | ||||||
89 | { | - | ||||||
90 | return never executed: d_func()->layout->widget(index);return d_func()->layout->widget(index); never executed: return d_func()->layout->widget(index); | 0 | ||||||
91 | } | - | ||||||
92 | int QStackedWidget::count() const | - | ||||||
93 | { | - | ||||||
94 | return never executed: d_func()->layout->count();return d_func()->layout->count(); never executed: return d_func()->layout->count(); | 0 | ||||||
95 | } | - | ||||||
96 | - | |||||||
97 | - | |||||||
98 | bool QStackedWidget::event(QEvent *e) | - | ||||||
99 | { | - | ||||||
100 | return never executed: QFrame::event(e);return QFrame::event(e); never executed: return QFrame::event(e); | 0 | ||||||
101 | } | - | ||||||
102 | - | |||||||
103 | - | |||||||
104 | - | |||||||
Switch to Source code | Preprocessed file |