Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | class 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; | - |
19 | public: | - |
20 | QRect rect; | - |
21 | QRubberBand::Shape shape; | - |
22 | QRegion clipping; | - |
23 | void updateMask(); | - |
24 | }; | - |
25 | void QRubberBand::initStyleOption(QStyleOptionRubberBand *option) const | - |
26 | { | - |
27 | if (!option) partially evaluated: !option no Evaluation Count:0 | yes Evaluation Count:44 |
| 0-44 |
28 | return; | 0 |
29 | option->initFrom(this); | - |
30 | option->shape = d_func()->shape; | - |
31 | | - |
32 | option->opaque = true; | - |
33 | | - |
34 | | - |
35 | | - |
36 | } executed: } Execution Count:44 | 44 |
37 | QRubberBand::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 | } executed: } Execution Count:47 | 47 |
56 | | - |
57 | | - |
58 | | - |
59 | | - |
60 | QRubberBand::~QRubberBand() | - |
61 | { | - |
62 | } | - |
63 | QRubberBand::Shape QRubberBand::shape() const | - |
64 | { | - |
65 | const QRubberBandPrivate * const d = d_func(); | - |
66 | return d->shape; never executed: return d->shape; | 0 |
67 | } | - |
68 | | - |
69 | | - |
70 | | - |
71 | | - |
72 | void 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)) { partially evaluated: q->style()->styleHint(QStyle::SH_RubberBand_Mask, &opt, q, &mask) yes Evaluation Count:44 | no Evaluation Count:0 |
| 0-44 |
79 | q->setMask(mask.region); | - |
80 | } else { executed: } Execution Count:44 | 44 |
81 | q->clearMask(); | - |
82 | } | 0 |
83 | } | - |
84 | | - |
85 | | - |
86 | | - |
87 | | - |
88 | void QRubberBand::paintEvent(QPaintEvent *) | - |
89 | { | - |
90 | QStylePainter painter(this); | - |
91 | QStyleOptionRubberBand option; | - |
92 | initStyleOption(&option); | - |
93 | painter.drawControl(QStyle::CE_RubberBand, option); | - |
94 | } | 0 |
95 | | - |
96 | | - |
97 | | - |
98 | | - |
99 | void QRubberBand::changeEvent(QEvent *e) | - |
100 | { | - |
101 | QWidget::changeEvent(e); | - |
102 | switch (e->type()) { | - |
103 | case QEvent::ParentChange: | - |
104 | if (parent()) { never evaluated: parent() | 0 |
105 | setWindowFlags(windowFlags() & ~Qt::ToolTip); | - |
106 | } else { | 0 |
107 | setWindowFlags(windowFlags() | Qt::ToolTip); | - |
108 | } | 0 |
109 | break; | 0 |
110 | default: | - |
111 | break; executed: break; Execution Count:8 | 8 |
112 | } | - |
113 | | - |
114 | if (e->type() == QEvent::ZOrderChange) partially evaluated: e->type() == QEvent::ZOrderChange no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
115 | raise(); | 0 |
116 | } executed: } Execution Count:8 | 8 |
117 | | - |
118 | | - |
119 | | - |
120 | | - |
121 | void QRubberBand::showEvent(QShowEvent *e) | - |
122 | { | - |
123 | raise(); | - |
124 | e->ignore(); | - |
125 | } executed: } Execution Count:2 | 2 |
126 | | - |
127 | | - |
128 | | - |
129 | | - |
130 | void QRubberBand::resizeEvent(QResizeEvent *) | - |
131 | { | - |
132 | QRubberBandPrivate * const d = d_func(); | - |
133 | d->updateMask(); | - |
134 | } executed: } Execution Count:22 | 22 |
135 | | - |
136 | | - |
137 | | - |
138 | | - |
139 | void QRubberBand::moveEvent(QMoveEvent *) | - |
140 | { | - |
141 | QRubberBandPrivate * const d = d_func(); | - |
142 | d->updateMask(); | - |
143 | } executed: } Execution Count:22 | 22 |
144 | void QRubberBand::setGeometry(const QRect &geom) | - |
145 | { | - |
146 | QWidget::setGeometry(geom); | - |
147 | } executed: } Execution Count:263 | 263 |
148 | bool QRubberBand::event(QEvent *e) | - |
149 | { | - |
150 | return QWidget::event(e); executed: return QWidget::event(e); Execution Count:180 | 180 |
151 | } | - |
152 | | - |
153 | | - |
154 | | - |
| | |