qrubberband.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/widgets/qrubberband.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16class QRubberBandPrivate : public QWidgetPrivate-
17{-
18 inline QRubberBand* q_func() { return static_cast<QRubberBand *>(q_ptr); } inline const QRubberBand* q_func() const { return static_cast<const QRubberBand *>(q_ptr); } friend class QRubberBand;-
19public:-
20 QRect rect;-
21 QRubberBand::Shape shape;-
22 QRegion clipping;-
23 void updateMask();-
24};-
25void QRubberBand::initStyleOption(QStyleOptionRubberBand *option) const-
26{-
27 if (!option
!optionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
28 return;
never executed: return;
0
29 option->initFrom(this);-
30 option->shape = d_func()->shape;-
31-
32 option->opaque = true;-
33-
34-
35-
36}
never executed: end of block
0
37QRubberBand::QRubberBand(Shape s, QWidget *p)-
38 : QWidget(*new QRubberBandPrivate, p, (p && p->windowType() != Qt::Desktop) ? Qt::Widget : Qt::ToolTip)-
39{-
40 QRubberBandPrivate * const d = d_func();-
41 d->shape = s;-
42 setAttribute(Qt::WA_TransparentForMouseEvents);-
43-
44 setAttribute(Qt::WA_NoSystemBackground);-
45-
46 setAttribute(Qt::WA_WState_ExplicitShowHide);-
47 setVisible(false);-
48-
49-
50-
51-
52-
53-
54-
55}
never executed: end of block
0
56-
57-
58-
59-
60QRubberBand::~QRubberBand()-
61{-
62}-
63QRubberBand::Shape QRubberBand::shape() const-
64{-
65 const QRubberBandPrivate * const d = d_func();-
66 return
never executed: return d->shape;
d->shape;
never executed: return d->shape;
0
67}-
68-
69-
70-
71-
72void QRubberBandPrivate::updateMask()-
73{-
74 QRubberBand * const q = q_func();-
75 QStyleHintReturnMask mask;-
76 QStyleOptionRubberBand opt;-
77 q->initStyleOption(&opt);-
78 if (q->style()->styleHint(QStyle::SH_RubberBand_Mask, &opt, q, &mask)
q->style()->st...opt, q, &mask)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
79 q->setMask(mask.region);-
80 }
never executed: end of block
else {
0
81 q->clearMask();-
82 }
never executed: end of block
0
83}-
84-
85-
86-
87-
88void QRubberBand::paintEvent(QPaintEvent *)-
89{-
90 QStylePainter painter(this);-
91 QStyleOptionRubberBand option;-
92 initStyleOption(&option);-
93 painter.drawControl(QStyle::CE_RubberBand, option);-
94}
never executed: end of block
0
95-
96-
97-
98-
99void QRubberBand::changeEvent(QEvent *e)-
100{-
101 QWidget::changeEvent(e);-
102 switch (e->type()) {-
103 case
never executed: case QEvent::ParentChange:
QEvent::ParentChange:
never executed: case QEvent::ParentChange:
0
104 if (parent()
parent()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
105 setWindowFlags(windowFlags() & ~Qt::ToolTip);-
106 }
never executed: end of block
else {
0
107 setWindowFlags(windowFlags() | Qt::ToolTip);-
108 }
never executed: end of block
0
109 break;
never executed: break;
0
110 default
never executed: default:
:
never executed: default:
0
111 break;
never executed: break;
0
112 }-
113-
114 if (e->type() == QEvent::ZOrderChange
e->type() == Q...::ZOrderChangeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
115 raise();
never executed: raise();
0
116}
never executed: end of block
0
117-
118-
119-
120-
121void QRubberBand::showEvent(QShowEvent *e)-
122{-
123 raise();-
124 e->ignore();-
125}
never executed: end of block
0
126-
127-
128-
129-
130void QRubberBand::resizeEvent(QResizeEvent *)-
131{-
132 QRubberBandPrivate * const d = d_func();-
133 d->updateMask();-
134}
never executed: end of block
0
135-
136-
137-
138-
139void QRubberBand::moveEvent(QMoveEvent *)-
140{-
141 QRubberBandPrivate * const d = d_func();-
142 d->updateMask();-
143}
never executed: end of block
0
144void QRubberBand::setGeometry(const QRect &geom)-
145{-
146 QWidget::setGeometry(geom);-
147}
never executed: end of block
0
148bool QRubberBand::event(QEvent *e)-
149{-
150 return
never executed: return QWidget::event(e);
QWidget::event(e);
never executed: return QWidget::event(e);
0
151}-
152-
153-
154-
Switch to Source codePreprocessed file

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