dialogs/qcolordialog.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8 -
9struct QWellArrayData; -
10 -
11class QWellArray : public QWidget -
12{ -
13 public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); struct QPrivateSignal {}; -
14 -
15 -
16 -
17public: -
18 QWellArray(int rows, int cols, QWidget* parent=0); -
19 ~QWellArray() {} -
20 QString cellContent(int row, int col) const; -
21 -
22 int selectedColumn() const { return selCol; }
never executed: return selCol;
0
23 int selectedRow() const { return selRow; }
never executed: return selRow;
0
24 -
25 virtual void setCurrent(int row, int col); -
26 virtual void setSelected(int row, int col); -
27 -
28 QSize sizeHint() const; -
29 -
30 virtual void setCellBrush(int row, int col, const QBrush &); -
31 QBrush cellBrush(int row, int col); -
32 -
33 inline int cellWidth() const -
34 { return cellw; }
executed: return cellw;
Execution Count:6
6
35 -
36 inline int cellHeight() const -
37 { return cellh; }
executed: return cellh;
Execution Count:6
6
38 -
39 inline int rowAt(int y) const -
40 { return y / cellh; }
executed: return y / cellh;
Execution Count:12
12
41 -
42 inline int columnAt(int x) const -
43 { if (isRightToLeft()) return ncols - (x / cellw) - 1; return x / cellw; }
partially evaluated: isRightToLeft()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
never executed: return ncols - (x / cellw) - 1;
executed: return x / cellw;
Execution Count:12
0-12
44 -
45 inline int rowY(int row) const -
46 { return cellh * row; }
executed: return cellh * row;
Execution Count:35
35
47 -
48 inline int columnX(int column) const -
49 { if (isRightToLeft()) return cellw * (ncols - column - 1); return cellw * column; }
partially evaluated: isRightToLeft()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:147
never executed: return cellw * (ncols - column - 1);
executed: return cellw * column;
Execution Count:147
0-147
50 -
51 inline int numRows() const -
52 { return nrows; }
executed: return nrows;
Execution Count:130
130
53 -
54 inline int numCols() const -
55 {return ncols; }
never executed: return ncols;
0
56 -
57 inline QRect cellRect() const -
58 { return QRect(0, 0, cellw, cellh); }
never executed: return QRect(0, 0, cellw, cellh);
0
59 -
60 inline QSize gridSize() const -
61 { return QSize(ncols * cellw, nrows * cellh); }
executed: return QSize(ncols * cellw, nrows * cellh);
Execution Count:4
4
62 -
63 QRect cellGeometry(int row, int column) -
64 { -
65 QRect r; -
66 if (row >= 0 && row < nrows && column >= 0 && column < ncols)
evaluated: row >= 0
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:19
partially evaluated: row < nrows
TRUEFALSE
yes
Evaluation Count:17
no
Evaluation Count:0
partially evaluated: column >= 0
TRUEFALSE
yes
Evaluation Count:17
no
Evaluation Count:0
partially evaluated: column < ncols
TRUEFALSE
yes
Evaluation Count:17
no
Evaluation Count:0
0-19
67 r.setRect(columnX(column), rowY(row), cellw, cellh);
executed: r.setRect(columnX(column), rowY(row), cellw, cellh);
Execution Count:17
17
68 return r;
executed: return r;
Execution Count:36
36
69 } -
70 -
71 inline void updateCell(int row, int column) { update(cellGeometry(row, column)); }
executed: }
Execution Count:36
36
72 -
73public: -
74 void selected(int row, int col); -
75 -
76protected: -
77 virtual void paintCell(QPainter *, int row, int col, const QRect&); -
78 virtual void paintCellContents(QPainter *, int row, int col, const QRect&); -
79 -
80 void mousePressEvent(QMouseEvent*); -
81 void mouseReleaseEvent(QMouseEvent*); -
82 void keyPressEvent(QKeyEvent*); -
83 void focusInEvent(QFocusEvent*); -
84 void focusOutEvent(QFocusEvent*); -
85 void paintEvent(QPaintEvent *); -
86 -
87private: -
88 QWellArray(const QWellArray &) = delete; QWellArray &operator=(const QWellArray &) = delete; -
89 -
90 int nrows; -
91 int ncols; -
92 int cellw; -
93 int cellh; -
94 int curRow; -
95 int curCol; -
96 int selRow; -
97 int selCol; -
98 QWellArrayData *d; -
99}; -
100 -
101void QWellArray::paintEvent(QPaintEvent *e) -
102{ -
103 QRect r = e->rect(); -
104 int cx = r.x(); -
105 int cy = r.y(); -
106 int ch = r.height(); -
107 int cw = r.width(); -
108 int colfirst = columnAt(cx); -
109 int collast = columnAt(cx + cw); -
110 int rowfirst = rowAt(cy); -
111 int rowlast = rowAt(cy + ch); -
112 -
113 if (isRightToLeft()) {
partially evaluated: isRightToLeft()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
114 int t = colfirst; -
115 colfirst = collast; -
116 collast = t; -
117 }
never executed: }
0
118 -
119 QPainter painter(this); -
120 QPainter *p = &painter; -
121 QRect rect(0, 0, cellWidth(), cellHeight()); -
122 -
123 -
124 if (collast < 0 || collast >= ncols)
partially evaluated: collast < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
partially evaluated: collast >= ncols
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
125 collast = ncols-1;
executed: collast = ncols-1;
Execution Count:6
6
126 if (rowlast < 0 || rowlast >= nrows)
partially evaluated: rowlast < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
partially evaluated: rowlast >= nrows
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
127 rowlast = nrows-1;
executed: rowlast = nrows-1;
Execution Count:6
6
128 -
129 -
130 for (int r = rowfirst; r <= rowlast; ++r) {
evaluated: r <= rowlast
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:6
6-18
131 -
132 int rowp = rowY(r); -
133 -
134 -
135 -
136 -
137 for (int c = colfirst; c <= collast; ++c) {
evaluated: c <= collast
TRUEFALSE
yes
Evaluation Count:130
yes
Evaluation Count:18
18-130
138 -
139 int colp = columnX(c); -
140 -
141 rect.translate(colp, rowp); -
142 paintCell(p, r, c, rect); -
143 rect.translate(-colp, -rowp); -
144 }
executed: }
Execution Count:130
130
145 }
executed: }
Execution Count:18
18
146}
executed: }
Execution Count:6
6
147 -
148struct QWellArrayData { -
149 QBrush *brush; -
150}; -
151 -
152QWellArray::QWellArray(int rows, int cols, QWidget *parent) -
153 : QWidget(parent) -
154 ,nrows(rows), ncols(cols) -
155{ -
156 d = 0; -
157 setFocusPolicy(Qt::StrongFocus); -
158 cellw = 28; -
159 cellh = 24; -
160 curCol = 0; -
161 curRow = 0; -
162 selCol = -1; -
163 selRow = -1; -
164}
executed: }
Execution Count:6
6
165 -
166QSize QWellArray::sizeHint() const -
167{ -
168 ensurePolished(); -
169 return gridSize().boundedTo(QSize(640, 480));
executed: return gridSize().boundedTo(QSize(640, 480));
Execution Count:4
4
170} -
171 -
172 -
173void QWellArray::paintCell(QPainter* p, int row, int col, const QRect &rect) -
174{ -
175 int b = 3; -
176 -
177 const QPalette & g = palette(); -
178 QStyleOptionFrame opt; -
179 int dfw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); -
180 opt.lineWidth = dfw; -
181 opt.midLineWidth = 1; -
182 opt.rect = rect.adjusted(b, b, -b, -b); -
183 opt.palette = g; -
184 opt.state = QStyle::State_Enabled | QStyle::State_Sunken; -
185 style()->drawPrimitive(QStyle::PE_Frame, &opt, p, this); -
186 b += dfw; -
187 -
188 if ((row == curRow) && (col == curCol)) {
evaluated: (row == curRow)
TRUEFALSE
yes
Evaluation Count:34
yes
Evaluation Count:96
evaluated: (col == curCol)
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:28
6-96
189 if (hasFocus()) {
evaluated: hasFocus()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:4
2-4
190 QStyleOptionFocusRect opt; -
191 opt.palette = g; -
192 opt.rect = rect; -
193 opt.state = QStyle::State_None | QStyle::State_KeyboardFocusChange; -
194 style()->drawPrimitive(QStyle::PE_FrameFocusRect, &opt, p, this); -
195 }
executed: }
Execution Count:2
2
196 }
executed: }
Execution Count:6
6
197 paintCellContents(p, row, col, opt.rect.adjusted(dfw, dfw, -dfw, -dfw)); -
198}
executed: }
Execution Count:130
130
199 -
200 -
201 -
202 -
203void QWellArray::paintCellContents(QPainter *p, int row, int col, const QRect &r) -
204{ -
205 if (d) {
never evaluated: d
0
206 p->fillRect(r, d->brush[row*numCols()+col]); -
207 } else {
never executed: }
0
208 p->fillRect(r, Qt::white); -
209 p->setPen(Qt::black); -
210 p->drawLine(r.topLeft(), r.bottomRight()); -
211 p->drawLine(r.topRight(), r.bottomLeft()); -
212 }
never executed: }
0
213} -
214 -
215void QWellArray::mousePressEvent(QMouseEvent *e) -
216{ -
217 -
218 QPoint pos = e->pos(); -
219 setCurrent(rowAt(pos.y()), columnAt(pos.x())); -
220}
never executed: }
0
221 -
222void QWellArray::mouseReleaseEvent(QMouseEvent * ) -
223{ -
224 -
225 setSelected(curRow, curCol); -
226}
never executed: }
0
227 -
228 -
229 -
230 -
231 -
232 -
233 -
234void QWellArray::setCurrent(int row, int col) -
235{ -
236 if ((curRow == row) && (curCol == col))
evaluated: (curRow == row)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
partially evaluated: (curCol == col)
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-3
237 return;
executed: return;
Execution Count:1
1
238 -
239 if (row < 0 || col < 0)
partially evaluated: row < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
partially evaluated: col < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
240 row = col = -1;
never executed: row = col = -1;
0
241 -
242 int oldRow = curRow; -
243 int oldCol = curCol; -
244 -
245 curRow = row; -
246 curCol = col; -
247 -
248 updateCell(oldRow, oldCol); -
249 updateCell(curRow, curCol); -
250}
executed: }
Execution Count:3
3
251 -
252 -
253 -
254 -
255 -
256 -
257 -
258void QWellArray::setSelected(int row, int col) -
259{ -
260 int oldRow = selRow; -
261 int oldCol = selCol; -
262 -
263 if (row < 0 || col < 0)
evaluated: row < 0
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:4
partially evaluated: col < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-8
264 row = col = -1;
executed: row = col = -1;
Execution Count:8
8
265 -
266 selCol = col; -
267 selRow = row; -
268 -
269 updateCell(oldRow, oldCol); -
270 updateCell(selRow, selCol); -
271 if (row >= 0)
evaluated: row >= 0
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:8
4-8
272 selected(row, col);
executed: selected(row, col);
Execution Count:4
4
273 -
274 -
275 if (isVisible() && qobject_cast<QMenu*>(parentWidget()))
partially evaluated: isVisible()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
never evaluated: qobject_cast<QMenu*>(parentWidget())
0-12
276 parentWidget()->close();
never executed: parentWidget()->close();
0
277 -
278}
executed: }
Execution Count:12
12
279 -
280void QWellArray::focusInEvent(QFocusEvent*) -
281{ -
282 updateCell(curRow, curCol); -
283}
executed: }
Execution Count:4
4
284 -
285void QWellArray::setCellBrush(int row, int col, const QBrush &b) -
286{ -
287 if (!d) {
never evaluated: !d
0
288 d = new QWellArrayData; -
289 int i = numRows()*numCols(); -
290 d->brush = new QBrush[i]; -
291 }
never executed: }
0
292 if (row >= 0 && row < numRows() && col >= 0 && col < numCols())
never evaluated: row >= 0
never evaluated: row < numRows()
never evaluated: col >= 0
never evaluated: col < numCols()
0
293 d->brush[row*numCols()+col] = b;
never executed: d->brush[row*numCols()+col] = b;
0
294}
never executed: }
0
295 -
296 -
297 -
298 -
299 -
300 -
301QBrush QWellArray::cellBrush(int row, int col) -
302{ -
303 if (d && row >= 0 && row < numRows() && col >= 0 && col < numCols())
never evaluated: d
never evaluated: row >= 0
never evaluated: row < numRows()
never evaluated: col >= 0
never evaluated: col < numCols()
0
304 return d->brush[row*numCols()+col];
never executed: return d->brush[row*numCols()+col];
0
305 return Qt::NoBrush;
never executed: return Qt::NoBrush;
0
306} -
307 -
308 -
309 -
310 -
311 -
312 -
313void QWellArray::focusOutEvent(QFocusEvent*) -
314{ -
315 updateCell(curRow, curCol); -
316}
executed: }
Execution Count:2
2
317 -
318 -
319 -
320void QWellArray::keyPressEvent(QKeyEvent* e) -
321{ -
322 switch(e->key()) { -
323 case Qt::Key_Left: -
324 if(curCol > 0)
never evaluated: curCol > 0
0
325 setCurrent(curRow, curCol - 1);
never executed: setCurrent(curRow, curCol - 1);
0
326 break;
never executed: break;
0
327 case Qt::Key_Right: -
328 if(curCol < numCols()-1)
never evaluated: curCol < numCols()-1
0
329 setCurrent(curRow, curCol + 1);
never executed: setCurrent(curRow, curCol + 1);
0
330 break;
never executed: break;
0
331 case Qt::Key_Up: -
332 if(curRow > 0)
never evaluated: curRow > 0
0
333 setCurrent(curRow - 1, curCol);
never executed: setCurrent(curRow - 1, curCol);
0
334 break;
never executed: break;
0
335 case Qt::Key_Down: -
336 if(curRow < numRows()-1)
never evaluated: curRow < numRows()-1
0
337 setCurrent(curRow + 1, curCol);
never executed: setCurrent(curRow + 1, curCol);
0
338 break;
never executed: break;
0
339 case Qt::Key_Space: -
340 setSelected(curRow, curCol); -
341 break;
never executed: break;
0
342 default: -
343 e->ignore(); -
344 return;
never executed: return;
0
345 } -
346 -
347}
never executed: }
0
348 -
349 -
350 -
351 -
352 -
353 -
354 -
355int QColorDialog::customCount() -
356{ -
357 return QColorDialogOptions::customColorCount();
never executed: return QColorDialogOptions::customColorCount();
0
358} -
359 -
360 -
361 -
362 -
363 -
364 -
365QColor QColorDialog::customColor(int index) -
366{ -
367 return QColor(QColorDialogOptions::customColor(index));
never executed: return QColor(QColorDialogOptions::customColor(index));
0
368} -
369void QColorDialog::setCustomColor(int index, QColor color) -
370{ -
371 QColorDialogOptions::setCustomColor(index, color.rgba()); -
372}
never executed: }
0
373 -
374 -
375 -
376 -
377 -
378 -
379QColor QColorDialog::standardColor(int index) -
380{ -
381 return QColor(QColorDialogOptions::standardColor(index));
never executed: return QColor(QColorDialogOptions::standardColor(index));
0
382} -
383void QColorDialog::setStandardColor(int index, QColor color) -
384{ -
385 QColorDialogOptions::setStandardColor(index, color.rgba()); -
386}
never executed: }
0
387 -
388static inline void rgb2hsv(QRgb rgb, int &h, int &s, int &v) -
389{ -
390 QColor c; -
391 c.setRgb(rgb); -
392 c.getHsv(&h, &s, &v); -
393}
executed: }
Execution Count:36
36
394 -
395class QColorWell : public QWellArray -
396{ -
397public: -
398 QColorWell(QWidget *parent, int r, int c, QRgb *vals) -
399 :QWellArray(r, c, parent), values(vals), mousePressed(false), oldCurrent(-1, -1) -
400 { setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); }
executed: }
Execution Count:6
6
401 -
402protected: -
403 void paintCellContents(QPainter *, int row, int col, const QRect&); -
404 void mousePressEvent(QMouseEvent *e); -
405 void mouseMoveEvent(QMouseEvent *e); -
406 void mouseReleaseEvent(QMouseEvent *e); -
407 -
408 void dragEnterEvent(QDragEnterEvent *e); -
409 void dragLeaveEvent(QDragLeaveEvent *e); -
410 void dragMoveEvent(QDragMoveEvent *e); -
411 void dropEvent(QDropEvent *e); -
412 -
413 -
414private: -
415 QRgb *values; -
416 bool mousePressed; -
417 QPoint pressPos; -
418 QPoint oldCurrent; -
419 -
420}; -
421 -
422void QColorWell::paintCellContents(QPainter *p, int row, int col, const QRect &r) -
423{ -
424 int i = row + col*numRows(); -
425 p->fillRect(r, QColor(values[i])); -
426}
executed: }
Execution Count:130
130
427 -
428void QColorWell::mousePressEvent(QMouseEvent *e) -
429{ -
430 oldCurrent = QPoint(selectedRow(), selectedColumn()); -
431 QWellArray::mousePressEvent(e); -
432 mousePressed = true; -
433 pressPos = e->pos(); -
434}
never executed: }
0
435 -
436void QColorWell::mouseMoveEvent(QMouseEvent *e) -
437{ -
438 QWellArray::mouseMoveEvent(e); -
439 -
440 if (!mousePressed)
never evaluated: !mousePressed
0
441 return;
never executed: return;
0
442 if ((pressPos - e->pos()).manhattanLength() > QApplication::startDragDistance()) {
never evaluated: (pressPos - e->pos()).manhattanLength() > QApplication::startDragDistance()
0
443 setCurrent(oldCurrent.x(), oldCurrent.y()); -
444 int i = rowAt(pressPos.y()) + columnAt(pressPos.x()) * numRows(); -
445 QColor col(values[i]); -
446 QMimeData *mime = new QMimeData; -
447 mime->setColorData(col); -
448 QPixmap pix(cellWidth(), cellHeight()); -
449 pix.fill(col); -
450 QPainter p(&pix); -
451 p.drawRect(0, 0, pix.width() - 1, pix.height() - 1); -
452 p.end(); -
453 QDrag *drg = new QDrag(this); -
454 drg->setMimeData(mime); -
455 drg->setPixmap(pix); -
456 mousePressed = false; -
457 drg->start(); -
458 }
never executed: }
0
459 -
460}
never executed: }
0
461 -
462 -
463void QColorWell::dragEnterEvent(QDragEnterEvent *e) -
464{ -
465 if (qvariant_cast<QColor>(e->mimeData()->colorData()).isValid())
never evaluated: qvariant_cast<QColor>(e->mimeData()->colorData()).isValid()
0
466 e->accept();
never executed: e->accept();
0
467 else -
468 e->ignore();
never executed: e->ignore();
0
469} -
470 -
471void QColorWell::dragLeaveEvent(QDragLeaveEvent *) -
472{ -
473 if (hasFocus())
never evaluated: hasFocus()
0
474 parentWidget()->setFocus();
never executed: parentWidget()->setFocus();
0
475}
never executed: }
0
476 -
477void QColorWell::dragMoveEvent(QDragMoveEvent *e) -
478{ -
479 if (qvariant_cast<QColor>(e->mimeData()->colorData()).isValid()) {
never evaluated: qvariant_cast<QColor>(e->mimeData()->colorData()).isValid()
0
480 setCurrent(rowAt(e->pos().y()), columnAt(e->pos().x())); -
481 e->accept(); -
482 } else {
never executed: }
0
483 e->ignore(); -
484 }
never executed: }
0
485} -
486 -
487void QColorWell::dropEvent(QDropEvent *e) -
488{ -
489 QColor col = qvariant_cast<QColor>(e->mimeData()->colorData()); -
490 if (col.isValid()) {
never evaluated: col.isValid()
0
491 int i = rowAt(e->pos().y()) + columnAt(e->pos().x()) * numRows(); -
492 values[i] = col.rgb(); -
493 update(); -
494 e->accept(); -
495 } else {
never executed: }
0
496 e->ignore(); -
497 }
never executed: }
0
498} -
499 -
500 -
501 -
502void QColorWell::mouseReleaseEvent(QMouseEvent *e) -
503{ -
504 if (!mousePressed)
never evaluated: !mousePressed
0
505 return;
never executed: return;
0
506 QWellArray::mouseReleaseEvent(e); -
507 mousePressed = false; -
508}
never executed: }
0
509 -
510class QColorPicker : public QFrame -
511{ -
512 public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); struct QPrivateSignal {}; -
513public: -
514 QColorPicker(QWidget* parent); -
515 ~QColorPicker(); -
516 -
517public : -
518 void setCol(int h, int s); -
519 -
520public: -
521 void newCol(int h, int s); -
522 -
523protected: -
524 QSize sizeHint() const; -
525 void paintEvent(QPaintEvent*); -
526 void mouseMoveEvent(QMouseEvent *); -
527 void mousePressEvent(QMouseEvent *); -
528 void resizeEvent(QResizeEvent *); -
529 -
530private: -
531 int hue; -
532 int sat; -
533 -
534 QPoint colPt(); -
535 int huePt(const QPoint &pt); -
536 int satPt(const QPoint &pt); -
537 void setCol(const QPoint &pt); -
538 -
539 QPixmap pix; -
540}; -
541 -
542static int pWidth = 220; -
543static int pHeight = 200; -
544 -
545class QColorLuminancePicker : public QWidget -
546{ -
547 public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); struct QPrivateSignal {}; -
548public: -
549 QColorLuminancePicker(QWidget* parent=0); -
550 ~QColorLuminancePicker(); -
551 -
552public : -
553 void setCol(int h, int s, int v); -
554 void setCol(int h, int s); -
555 -
556public: -
557 void newHsv(int h, int s, int v); -
558 -
559protected: -
560 void paintEvent(QPaintEvent*); -
561 void mouseMoveEvent(QMouseEvent *); -
562 void mousePressEvent(QMouseEvent *); -
563 -
564private: -
565 enum { foff = 3, coff = 4 }; -
566 int val; -
567 int hue; -
568 int sat; -
569 -
570 int y2val(int y); -
571 int val2y(int val); -
572 void setVal(int v); -
573 -
574 QPixmap *pix; -
575}; -
576 -
577 -
578int QColorLuminancePicker::y2val(int y) -
579{ -
580 int d = height() - 2*coff - 1; -
581 return 255 - (y - coff)*255/d;
executed: return 255 - (y - coff)*255/d;
Execution Count:5200
5200
582} -
583 -
584int QColorLuminancePicker::val2y(int v) -
585{ -
586 int d = height() - 2*coff - 1; -
587 return coff + (255-v)*d/255;
executed: return coff + (255-v)*d/255;
Execution Count:2
2
588} -
589 -
590QColorLuminancePicker::QColorLuminancePicker(QWidget* parent) -
591 :QWidget(parent) -
592{ -
593 hue = 100; val = 100; sat = 100; -
594 pix = 0; -
595 -
596}
executed: }
Execution Count:3
3
597 -
598QColorLuminancePicker::~QColorLuminancePicker() -
599{ -
600 delete pix; -
601}
executed: }
Execution Count:3
3
602 -
603void QColorLuminancePicker::mouseMoveEvent(QMouseEvent *m) -
604{ -
605 setVal(y2val(m->y())); -
606}
never executed: }
0
607void QColorLuminancePicker::mousePressEvent(QMouseEvent *m) -
608{ -
609 setVal(y2val(m->y())); -
610}
never executed: }
0
611 -
612void QColorLuminancePicker::setVal(int v) -
613{ -
614 if (val == v)
never evaluated: val == v
0
615 return;
never executed: return;
0
616 val = qMax(0, qMin(v,255)); -
617 delete pix; pix=0; -
618 repaint(); -
619 newHsv(hue, sat, val); -
620}
never executed: }
0
621 -
622 -
623void QColorLuminancePicker::setCol(int h, int s) -
624{ -
625 setCol(h, s, val); -
626 newHsv(h, s, val); -
627}
never executed: }
0
628 -
629void QColorLuminancePicker::paintEvent(QPaintEvent *) -
630{ -
631 int w = width() - 5; -
632 -
633 QRect r(0, foff, w, height() - 2*foff); -
634 int wi = r.width() - 2; -
635 int hi = r.height() - 2; -
636 if (!pix || pix->height() != hi || pix->width() != wi) {
partially evaluated: !pix
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
never evaluated: pix->height() != hi
never evaluated: pix->width() != wi
0-2
637 delete pix; -
638 QImage img(wi, hi, QImage::Format_RGB32); -
639 int y; -
640 uint *pixel = (uint *) img.scanLine(0); -
641 for (y = 0; y < hi; y++) {
evaluated: y < hi
TRUEFALSE
yes
Evaluation Count:400
yes
Evaluation Count:2
2-400
642 const uint *end = pixel + wi; -
643 while (pixel < end) {
evaluated: pixel < end
TRUEFALSE
yes
Evaluation Count:5200
yes
Evaluation Count:400
400-5200
644 QColor c; -
645 c.setHsv(hue, sat, y2val(y+coff)); -
646 *pixel = c.rgb(); -
647 ++pixel; -
648 }
executed: }
Execution Count:5200
5200
649 }
executed: }
Execution Count:400
400
650 pix = new QPixmap(QPixmap::fromImage(img)); -
651 }
executed: }
Execution Count:2
2
652 QPainter p(this); -
653 p.drawPixmap(1, coff, *pix); -
654 const QPalette &g = palette(); -
655 qDrawShadePanel(&p, r, g, true); -
656 p.setPen(g.foreground().color()); -
657 p.setBrush(g.foreground()); -
658 QPolygon a; -
659 int y = val2y(val); -
660 a.setPoints(3, w, y, w+5, y+5, w+5, y-5); -
661 p.eraseRect(w, 0, 5, height()); -
662 p.drawPolygon(a); -
663}
executed: }
Execution Count:2
2
664 -
665void QColorLuminancePicker::setCol(int h, int s , int v) -
666{ -
667 val = v; -
668 hue = h; -
669 sat = s; -
670 delete pix; pix=0; -
671 repaint(); -
672}
executed: }
Execution Count:18
18
673 -
674QPoint QColorPicker::colPt() -
675{ -
676 QRect r = contentsRect(); -
677 return QPoint((360 - hue) * (r.width() - 1) / 360, (255 - sat) * (r.height() - 1) / 255);
executed: return QPoint((360 - hue) * (r.width() - 1) / 360, (255 - sat) * (r.height() - 1) / 255);
Execution Count:16
16
678} -
679 -
680int QColorPicker::huePt(const QPoint &pt) -
681{ -
682 QRect r = contentsRect(); -
683 return 360 - pt.x() * 360 / (r.width() - 1);
executed: return 360 - pt.x() * 360 / (r.width() - 1);
Execution Count:88000
88000
684} -
685 -
686int QColorPicker::satPt(const QPoint &pt) -
687{ -
688 QRect r = contentsRect(); -
689 return 255 - pt.y() * 255 / (r.height() - 1);
executed: return 255 - pt.y() * 255 / (r.height() - 1);
Execution Count:88000
88000
690} -
691 -
692void QColorPicker::setCol(const QPoint &pt) -
693{ -
694 setCol(huePt(pt), satPt(pt)); -
695}
never executed: }
0
696 -
697QColorPicker::QColorPicker(QWidget* parent) -
698 : QFrame(parent) -
699{ -
700 hue = 0; sat = 0; -
701 setCol(150, 255); -
702 -
703 setAttribute(Qt::WA_NoSystemBackground); -
704 setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed) ); -
705}
executed: }
Execution Count:3
3
706 -
707QColorPicker::~QColorPicker() -
708{ -
709} -
710 -
711QSize QColorPicker::sizeHint() const -
712{ -
713 return QSize(pWidth + 2*frameWidth(), pHeight + 2*frameWidth());
executed: return QSize(pWidth + 2*frameWidth(), pHeight + 2*frameWidth());
Execution Count:2
2
714} -
715 -
716void QColorPicker::setCol(int h, int s) -
717{ -
718 int nhue = qMin(qMax(0,h), 359); -
719 int nsat = qMin(qMax(0,s), 255); -
720 if (nhue == hue && nsat == sat)
evaluated: nhue == hue
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:7
partially evaluated: nsat == sat
TRUEFALSE
yes
Evaluation Count:14
no
Evaluation Count:0
0-14
721 return;
executed: return;
Execution Count:14
14
722 -
723 QRect r(colPt(), QSize(20,20)); -
724 hue = nhue; sat = nsat; -
725 r = r.united(QRect(colPt(), QSize(20,20))); -
726 r.translate(contentsRect().x()-9, contentsRect().y()-9); -
727 -
728 repaint(r); -
729}
executed: }
Execution Count:7
7
730 -
731void QColorPicker::mouseMoveEvent(QMouseEvent *m) -
732{ -
733 QPoint p = m->pos() - contentsRect().topLeft(); -
734 setCol(p); -
735 newCol(hue, sat); -
736}
never executed: }
0
737 -
738void QColorPicker::mousePressEvent(QMouseEvent *m) -
739{ -
740 QPoint p = m->pos() - contentsRect().topLeft(); -
741 setCol(p); -
742 newCol(hue, sat); -
743}
never executed: }
0
744 -
745void QColorPicker::paintEvent(QPaintEvent* ) -
746{ -
747 QPainter p(this); -
748 drawFrame(&p); -
749 QRect r = contentsRect(); -
750 -
751 p.drawPixmap(r.topLeft(), pix); -
752 QPoint pt = colPt() + r.topLeft(); -
753 p.setPen(Qt::black); -
754 -
755 p.fillRect(pt.x()-9, pt.y(), 20, 2, Qt::black); -
756 p.fillRect(pt.x(), pt.y()-9, 2, 20, Qt::black); -
757 -
758}
executed: }
Execution Count:2
2
759 -
760void QColorPicker::resizeEvent(QResizeEvent *ev) -
761{ -
762 QFrame::resizeEvent(ev); -
763 -
764 int w = width() - frameWidth() * 2; -
765 int h = height() - frameWidth() * 2; -
766 QImage img(w, h, QImage::Format_RGB32); -
767 int x, y; -
768 uint *pixel = (uint *) img.scanLine(0); -
769 for (y = 0; y < h; y++) {
evaluated: y < h
TRUEFALSE
yes
Evaluation Count:400
yes
Evaluation Count:2
2-400
770 const uint *end = pixel + w; -
771 x = 0; -
772 while (pixel < end) {
evaluated: pixel < end
TRUEFALSE
yes
Evaluation Count:88000
yes
Evaluation Count:400
400-88000
773 QPoint p(x, y); -
774 QColor c; -
775 c.setHsv(huePt(p), satPt(p), 200); -
776 *pixel = c.rgb(); -
777 ++pixel; -
778 ++x; -
779 }
executed: }
Execution Count:88000
88000
780 }
executed: }
Execution Count:400
400
781 pix = QPixmap::fromImage(img); -
782}
executed: }
Execution Count:2
2
783 -
784 -
785class QColSpinBox : public QSpinBox -
786{ -
787public: -
788 QColSpinBox(QWidget *parent) -
789 : QSpinBox(parent) { setRange(0, 255); }
executed: }
Execution Count:21
21
790 void setValue(int i) { -
791 bool block = signalsBlocked(); -
792 blockSignals(true); -
793 QSpinBox::setValue(i); -
794 blockSignals(block); -
795 }
executed: }
Execution Count:98
98
796}; -
797 -
798class QColorShowLabel; -
799 -
800class QColorShower : public QWidget -
801{ -
802 public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); struct QPrivateSignal {}; -
803public: -
804 QColorShower(QColorDialog *parent); -
805 -
806 -
807 void setHsv(int h, int s, int v); -
808 -
809 int currentAlpha() const -
810 { return (colorDialog->options() & QColorDialog::ShowAlphaChannel) ? alphaEd->value() : 255; }
executed: return (colorDialog->options() & QColorDialog::ShowAlphaChannel) ? alphaEd->value() : 255;
Execution Count:23
23
811 void setCurrentAlpha(int a) { alphaEd->setValue(a); rgbEd(); }
executed: }
Execution Count:5
5
812 void showAlpha(bool b); -
813 bool isAlphaVisible() const; -
814 -
815 QRgb currentColor() const { return curCol; }
executed: return curCol;
Execution Count:80
80
816 QColor currentQColor() const { return curQColor; }
executed: return curQColor;
Execution Count:3
3
817 void retranslateStrings(); -
818 void updateQColor(); -
819 -
820public : -
821 void setRgb(QRgb rgb); -
822 -
823public: -
824 void newCol(QRgb rgb); -
825 void currentColorChanged(const QColor &color); -
826 -
827private : -
828 void rgbEd(); -
829 void hsvEd(); -
830private: -
831 void showCurrentColor(); -
832 int hue, sat, val; -
833 QRgb curCol; -
834 QColor curQColor; -
835 QLabel *lblHue; -
836 QLabel *lblSat; -
837 QLabel *lblVal; -
838 QLabel *lblRed; -
839 QLabel *lblGreen; -
840 QLabel *lblBlue; -
841 QColSpinBox *hEd; -
842 QColSpinBox *sEd; -
843 QColSpinBox *vEd; -
844 QColSpinBox *rEd; -
845 QColSpinBox *gEd; -
846 QColSpinBox *bEd; -
847 QColSpinBox *alphaEd; -
848 QLabel *alphaLab; -
849 QColorShowLabel *lab; -
850 bool rgbOriginal; -
851 QColorDialog *colorDialog; -
852 -
853 friend class QColorDialog; -
854 friend class QColorDialogPrivate; -
855}; -
856 -
857class QColorShowLabel : public QFrame -
858{ -
859 public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = 0, int n = -1) { return staticMetaObject.tr(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); struct QPrivateSignal {}; -
860 -
861public: -
862 QColorShowLabel(QWidget *parent) : QFrame(parent) { -
863 setFrameStyle(QFrame::Panel|QFrame::Sunken); -
864 setAcceptDrops(true); -
865 mousePressed = false; -
866 }
executed: }
Execution Count:3
3
867 void setColor(QColor c) { col = c; }
executed: }
Execution Count:18
18
868 -
869public: -
870 void colorDropped(QRgb); -
871 -
872protected: -
873 void paintEvent(QPaintEvent *); -
874 void mousePressEvent(QMouseEvent *e); -
875 void mouseMoveEvent(QMouseEvent *e); -
876 void mouseReleaseEvent(QMouseEvent *e); -
877 -
878 void dragEnterEvent(QDragEnterEvent *e); -
879 void dragLeaveEvent(QDragLeaveEvent *e); -
880 void dropEvent(QDropEvent *e); -
881 -
882 -
883private: -
884 QColor col; -
885 bool mousePressed; -
886 QPoint pressPos; -
887}; -
888 -
889void QColorShowLabel::paintEvent(QPaintEvent *e) -
890{ -
891 QPainter p(this); -
892 drawFrame(&p); -
893 p.fillRect(contentsRect()&e->rect(), col); -
894}
executed: }
Execution Count:2
2
895 -
896void QColorShower::showAlpha(bool b) -
897{ -
898 alphaLab->setVisible(b); -
899 alphaEd->setVisible(b); -
900}
executed: }
Execution Count:2
2
901 -
902inline bool QColorShower::isAlphaVisible() const -
903{ -
904 return alphaLab->isVisible();
never executed: return alphaLab->isVisible();
0
905} -
906 -
907void QColorShowLabel::mousePressEvent(QMouseEvent *e) -
908{ -
909 mousePressed = true; -
910 pressPos = e->pos(); -
911}
never executed: }
0
912 -
913void QColorShowLabel::mouseMoveEvent(QMouseEvent *e) -
914{ -
915 -
916 -
917 -
918 if (!mousePressed)
never evaluated: !mousePressed
0
919 return;
never executed: return;
0
920 if ((pressPos - e->pos()).manhattanLength() > QApplication::startDragDistance()) {
never evaluated: (pressPos - e->pos()).manhattanLength() > QApplication::startDragDistance()
0
921 QMimeData *mime = new QMimeData; -
922 mime->setColorData(col); -
923 QPixmap pix(30, 20); -
924 pix.fill(col); -
925 QPainter p(&pix); -
926 p.drawRect(0, 0, pix.width() - 1, pix.height() - 1); -
927 p.end(); -
928 QDrag *drg = new QDrag(this); -
929 drg->setMimeData(mime); -
930 drg->setPixmap(pix); -
931 mousePressed = false; -
932 drg->start(); -
933 }
never executed: }
0
934 -
935}
never executed: }
0
936 -
937 -
938void QColorShowLabel::dragEnterEvent(QDragEnterEvent *e) -
939{ -
940 if (qvariant_cast<QColor>(e->mimeData()->colorData()).isValid())
never evaluated: qvariant_cast<QColor>(e->mimeData()->colorData()).isValid()
0
941 e->accept();
never executed: e->accept();
0
942 else -
943 e->ignore();
never executed: e->ignore();
0
944} -
945 -
946void QColorShowLabel::dragLeaveEvent(QDragLeaveEvent *) -
947{ -
948} -
949 -
950void QColorShowLabel::dropEvent(QDropEvent *e) -
951{ -
952 QColor color = qvariant_cast<QColor>(e->mimeData()->colorData()); -
953 if (color.isValid()) {
never evaluated: color.isValid()
0
954 col = color; -
955 repaint(); -
956 colorDropped(col.rgb()); -
957 e->accept(); -
958 } else {
never executed: }
0
959 e->ignore(); -
960 }
never executed: }
0
961} -
962 -
963 -
964void QColorShowLabel::mouseReleaseEvent(QMouseEvent *) -
965{ -
966 if (!mousePressed)
never evaluated: !mousePressed
0
967 return;
never executed: return;
0
968 mousePressed = false; -
969}
never executed: }
0
970 -
971QColorShower::QColorShower(QColorDialog *parent) -
972 : QWidget(parent) -
973{ -
974 colorDialog = parent; -
975 -
976 curCol = qRgb(255, 255, 255); -
977 curQColor = Qt::white; -
978 -
979 QGridLayout *gl = new QGridLayout(this); -
980 gl->setMargin(gl->spacing()); -
981 lab = new QColorShowLabel(this); -
982 -
983 -
984 -
985 -
986 -
987 lab->setMinimumWidth(60); -
988 -
989 -
990 -
991 -
992 -
993 -
994 -
995 gl->addWidget(lab, 0, 0, -1, 1); -
996 -
997 -
998 -
999 -
1000 -
1001 -
1002 connect(lab, "2""colorDropped(QRgb)", this, "2""newCol(QRgb)"); -
1003 connect(lab, "2""colorDropped(QRgb)", this, "1""setRgb(QRgb)"); -
1004 -
1005 hEd = new QColSpinBox(this); -
1006 hEd->setRange(0, 359); -
1007 lblHue = new QLabel(this); -
1008 -
1009 lblHue->setBuddy(hEd); -
1010 -
1011 lblHue->setAlignment(Qt::AlignRight|Qt::AlignVCenter); -
1012 -
1013 gl->addWidget(lblHue, 0, 1); -
1014 gl->addWidget(hEd, 0, 2); -
1015 sEd = new QColSpinBox(this); -
1016 lblSat = new QLabel(this); -
1017 -
1018 lblSat->setBuddy(sEd); -
1019 -
1020 lblSat->setAlignment(Qt::AlignRight|Qt::AlignVCenter); -
1021 -
1022 gl->addWidget(lblSat, 1, 1); -
1023 gl->addWidget(sEd, 1, 2); -
1024 vEd = new QColSpinBox(this); -
1025 lblVal = new QLabel(this); -
1026 -
1027 lblVal->setBuddy(vEd); -
1028 -
1029 lblVal->setAlignment(Qt::AlignRight|Qt::AlignVCenter); -
1030 -
1031 gl->addWidget(lblVal, 2, 1); -
1032 gl->addWidget(vEd, 2, 2); -
1033 rEd = new QColSpinBox(this); -
1034 lblRed = new QLabel(this); -
1035 -
1036 lblRed->setBuddy(rEd); -
1037 -
1038 lblRed->setAlignment(Qt::AlignRight|Qt::AlignVCenter); -
1039 -
1040 gl->addWidget(lblRed, 0, 3); -
1041 gl->addWidget(rEd, 0, 4); -
1042 gEd = new QColSpinBox(this); -
1043 lblGreen = new QLabel(this); -
1044 -
1045 lblGreen->setBuddy(gEd); -
1046 -
1047 lblGreen->setAlignment(Qt::AlignRight|Qt::AlignVCenter); -
1048 -
1049 gl->addWidget(lblGreen, 1, 3); -
1050 gl->addWidget(gEd, 1, 4); -
1051 bEd = new QColSpinBox(this); -
1052 lblBlue = new QLabel(this); -
1053 -
1054 lblBlue->setBuddy(bEd); -
1055 -
1056 lblBlue->setAlignment(Qt::AlignRight|Qt::AlignVCenter); -
1057 -
1058 gl->addWidget(lblBlue, 2, 3); -
1059 gl->addWidget(bEd, 2, 4); -
1060 alphaEd = new QColSpinBox(this); -
1061 alphaLab = new QLabel(this); -
1062 -
1063 alphaLab->setBuddy(alphaEd); -
1064 -
1065 alphaLab->setAlignment(Qt::AlignRight|Qt::AlignVCenter); -
1066 -
1067 gl->addWidget(alphaLab, 3, 1, 1, 3); -
1068 gl->addWidget(alphaEd, 3, 4); -
1069 alphaEd->hide(); -
1070 alphaLab->hide(); -
1071 -
1072 connect(hEd, "2""valueChanged(int)", this, "1""hsvEd()"); -
1073 connect(sEd, "2""valueChanged(int)", this, "1""hsvEd()"); -
1074 connect(vEd, "2""valueChanged(int)", this, "1""hsvEd()"); -
1075 -
1076 connect(rEd, "2""valueChanged(int)", this, "1""rgbEd()"); -
1077 connect(gEd, "2""valueChanged(int)", this, "1""rgbEd()"); -
1078 connect(bEd, "2""valueChanged(int)", this, "1""rgbEd()"); -
1079 connect(alphaEd, "2""valueChanged(int)", this, "1""rgbEd()"); -
1080 -
1081 retranslateStrings(); -
1082}
executed: }
Execution Count:3
3
1083 -
1084inline QRgb QColorDialogPrivate::currentColor() const { return cs->currentColor(); }
never executed: return cs->currentColor();
0
1085inline int QColorDialogPrivate::currentAlpha() const { return cs->currentAlpha(); }
never executed: return cs->currentAlpha();
0
1086inline void QColorDialogPrivate::setCurrentAlpha(int a) { cs->setCurrentAlpha(a); }
executed: }
Execution Count:5
5
1087inline void QColorDialogPrivate::showAlpha(bool b) { cs->showAlpha(b); }
executed: }
Execution Count:2
2
1088inline bool QColorDialogPrivate::isAlphaVisible() const { return cs->isAlphaVisible(); }
never executed: return cs->isAlphaVisible();
0
1089 -
1090QColor QColorDialogPrivate::currentQColor() const -
1091{ -
1092 if (!options->testOption(QColorDialogOptions::DontUseNativeDialog) && nativeDialogInUse)
partially evaluated: !options->testOption(QColorDialogOptions::DontUseNativeDialog)
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
partially evaluated: nativeDialogInUse
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1093 return platformColorDialogHelper()->currentColor();
never executed: return platformColorDialogHelper()->currentColor();
0
1094 return cs->currentQColor();
executed: return cs->currentQColor();
Execution Count:3
3
1095} -
1096 -
1097void QColorShower::showCurrentColor() -
1098{ -
1099 lab->setColor(currentColor()); -
1100 lab->repaint(); -
1101}
executed: }
Execution Count:18
18
1102 -
1103void QColorShower::rgbEd() -
1104{ -
1105 rgbOriginal = true; -
1106 curCol = qRgba(rEd->value(), gEd->value(), bEd->value(), currentAlpha()); -
1107 -
1108 rgb2hsv(currentColor(), hue, sat, val); -
1109 -
1110 hEd->setValue(hue); -
1111 sEd->setValue(sat); -
1112 vEd->setValue(val); -
1113 -
1114 showCurrentColor(); -
1115 newCol(currentColor()); -
1116 updateQColor(); -
1117}
executed: }
Execution Count:5
5
1118 -
1119void QColorShower::hsvEd() -
1120{ -
1121 rgbOriginal = false; -
1122 hue = hEd->value(); -
1123 sat = sEd->value(); -
1124 val = vEd->value(); -
1125 -
1126 QColor c; -
1127 c.setHsv(hue, sat, val); -
1128 curCol = c.rgb(); -
1129 -
1130 rEd->setValue(qRed(currentColor())); -
1131 gEd->setValue(qGreen(currentColor())); -
1132 bEd->setValue(qBlue(currentColor())); -
1133 -
1134 showCurrentColor(); -
1135 newCol(currentColor()); -
1136 updateQColor(); -
1137}
never executed: }
0
1138 -
1139void QColorShower::setRgb(QRgb rgb) -
1140{ -
1141 rgbOriginal = true; -
1142 curCol = rgb; -
1143 -
1144 rgb2hsv(currentColor(), hue, sat, val); -
1145 -
1146 hEd->setValue(hue); -
1147 sEd->setValue(sat); -
1148 vEd->setValue(val); -
1149 -
1150 rEd->setValue(qRed(currentColor())); -
1151 gEd->setValue(qGreen(currentColor())); -
1152 bEd->setValue(qBlue(currentColor())); -
1153 -
1154 showCurrentColor(); -
1155 updateQColor(); -
1156}
executed: }
Execution Count:13
13
1157 -
1158void QColorShower::setHsv(int h, int s, int v) -
1159{ -
1160 if (h < -1 || (uint)s > 255 || (uint)v > 255)
never evaluated: h < -1
never evaluated: (uint)s > 255
never evaluated: (uint)v > 255
0
1161 return;
never executed: return;
0
1162 -
1163 rgbOriginal = false; -
1164 hue = h; val = v; sat = s; -
1165 QColor c; -
1166 c.setHsv(hue, sat, val); -
1167 curCol = c.rgb(); -
1168 -
1169 hEd->setValue(hue); -
1170 sEd->setValue(sat); -
1171 vEd->setValue(val); -
1172 -
1173 rEd->setValue(qRed(currentColor())); -
1174 gEd->setValue(qGreen(currentColor())); -
1175 bEd->setValue(qBlue(currentColor())); -
1176 -
1177 showCurrentColor(); -
1178 updateQColor(); -
1179}
never executed: }
0
1180 -
1181void QColorShower::retranslateStrings() -
1182{ -
1183 lblHue->setText(QColorDialog::tr("Hu&e:")); -
1184 lblSat->setText(QColorDialog::tr("&Sat:")); -
1185 lblVal->setText(QColorDialog::tr("&Val:")); -
1186 lblRed->setText(QColorDialog::tr("&Red:")); -
1187 lblGreen->setText(QColorDialog::tr("&Green:")); -
1188 lblBlue->setText(QColorDialog::tr("Bl&ue:")); -
1189 alphaLab->setText(QColorDialog::tr("A&lpha channel:")); -
1190}
executed: }
Execution Count:6
6
1191 -
1192void QColorShower::updateQColor() -
1193{ -
1194 QColor oldQColor(curQColor); -
1195 curQColor.setRgba(qRgba(qRed(curCol), qGreen(curCol), qBlue(curCol), currentAlpha())); -
1196 if (curQColor != oldQColor)
evaluated: curQColor != oldQColor
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:16
2-16
1197 currentColorChanged(curQColor);
executed: currentColorChanged(curQColor);
Execution Count:2
2
1198}
executed: }
Execution Count:18
18
1199 -
1200 -
1201void QColorDialogPrivate::_q_newHsv(int h, int s, int v) -
1202{ -
1203 cs->setHsv(h, s, v); -
1204 cp->setCol(h, s); -
1205 lp->setCol(h, s, v); -
1206}
never executed: }
0
1207 -
1208 -
1209void QColorDialogPrivate::setCurrentColor(QRgb rgb) -
1210{ -
1211 cs->setRgb(rgb); -
1212 _q_newColorTypedIn(rgb); -
1213}
executed: }
Execution Count:13
13
1214 -
1215 -
1216void QColorDialogPrivate::setCurrentQColor(const QColor &color) -
1217{ -
1218 QColorDialog * const q = q_func(); -
1219 if (cs->curQColor != color) {
never evaluated: cs->curQColor != color
0
1220 cs->curQColor = color; -
1221 q->currentColorChanged(color); -
1222 }
never executed: }
0
1223}
never executed: }
0
1224 -
1225bool QColorDialogPrivate::selectColor(const QColor &col) -
1226{ -
1227 QRgb color = col.rgb(); -
1228 int i = 0, j = 0; -
1229 -
1230 if (standard) {
partially evaluated: standard
TRUEFALSE
yes
Evaluation Count:5
no
Evaluation Count:0
0-5
1231 const QRgb *standardColors = QColorDialogOptions::standardColors(); -
1232 for (i = 0; i < 6; i++) {
evaluated: i < 6
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:1
1-30
1233 for (j = 0; j < 8; j++) {
evaluated: j < 8
TRUEFALSE
yes
Evaluation Count:240
yes
Evaluation Count:26
26-240
1234 if (color == standardColors[i + j*6]) {
evaluated: color == standardColors[i + j*6]
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:236
4-236
1235 _q_newStandard(i, j); -
1236 standard->setCurrent(i, j); -
1237 standard->setSelected(i, j); -
1238 standard->setFocus(); -
1239 return true;
executed: return true;
Execution Count:4
4
1240 } -
1241 }
executed: }
Execution Count:236
236
1242 }
executed: }
Execution Count:26
26
1243 }
executed: }
Execution Count:1
1
1244 -
1245 if (custom) {
partially evaluated: custom
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
1246 const QRgb *customColors = QColorDialogOptions::customColors(); -
1247 for (i = 0; i < 2; i++) {
evaluated: i < 2
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
1-2
1248 for (j = 0; j < 8; j++) {
evaluated: j < 8
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:2
2-16
1249 if (color == customColors[i + j*2]) {
partially evaluated: color == customColors[i + j*2]
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
1250 _q_newCustom(i, j); -
1251 custom->setCurrent(i, j); -
1252 custom->setSelected(i, j); -
1253 custom->setFocus(); -
1254 return true;
never executed: return true;
0
1255 } -
1256 }
executed: }
Execution Count:16
16
1257 }
executed: }
Execution Count:2
2
1258 }
executed: }
Execution Count:1
1
1259 return false;
executed: return false;
Execution Count:1
1
1260} -
1261 -
1262 -
1263void QColorDialogPrivate::_q_newColorTypedIn(QRgb rgb) -
1264{ -
1265 int h, s, v; -
1266 rgb2hsv(rgb, h, s, v); -
1267 cp->setCol(h, s); -
1268 lp->setCol(h, s, v); -
1269}
executed: }
Execution Count:18
18
1270 -
1271void QColorDialogPrivate::_q_newCustom(int r, int c) -
1272{ -
1273 const int i = r + 2 * c; -
1274 setCurrentColor(QColorDialogOptions::customColor(i)); -
1275 nextCust = i; -
1276 if (standard)
never evaluated: standard
0
1277 standard->setSelected(-1,-1);
never executed: standard->setSelected(-1,-1);
0
1278}
never executed: }
0
1279 -
1280void QColorDialogPrivate::_q_newStandard(int r, int c) -
1281{ -
1282 setCurrentColor(QColorDialogOptions::standardColor(r + c * 6)); -
1283 if (custom)
partially evaluated: custom
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
0-8
1284 custom->setSelected(-1,-1);
executed: custom->setSelected(-1,-1);
Execution Count:8
8
1285}
executed: }
Execution Count:8
8
1286 -
1287void QColorDialogPrivate::init(const QColor &initial) -
1288{ -
1289 QColorDialog * const q = q_func(); -
1290 -
1291 q->setSizeGripEnabled(false); -
1292 q->setWindowTitle(QColorDialog::tr("Select Color")); -
1293 -
1294 nativeDialogInUse = (platformColorDialogHelper() != 0); -
1295 -
1296 nextCust = 0; -
1297 QVBoxLayout *mainLay = new QVBoxLayout(q); -
1298 -
1299 mainLay->setSizeConstraint(QLayout::SetFixedSize); -
1300 -
1301 QHBoxLayout *topLay = new QHBoxLayout(); -
1302 mainLay->addLayout(topLay); -
1303 -
1304 leftLay = 0; -
1305 -
1306 -
1307 -
1308 -
1309 -
1310 -
1311 -
1312 smallDisplay = (QApplication::desktop()->width() < 480 || QApplication::desktop()->height() < 350);
partially evaluated: QApplication::desktop()->width() < 480
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
partially evaluated: QApplication::desktop()->height() < 350
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1313 const int lumSpace = topLay->spacing() / 2; -
1314 -
1315 -
1316 if (!smallDisplay) {
partially evaluated: !smallDisplay
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
1317 leftLay = new QVBoxLayout; -
1318 topLay->addLayout(leftLay); -
1319 }
executed: }
Execution Count:3
3
1320 -
1321 if (!smallDisplay) {
partially evaluated: !smallDisplay
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
1322 standard = new QColorWell(q, 6, 8, QColorDialogOptions::standardColors()); -
1323 lblBasicColors = new QLabel(q); -
1324 -
1325 lblBasicColors->setBuddy(standard); -
1326 -
1327 q->connect(standard, "2""selected(int,int)", "1""_q_newStandard(int,int)"); -
1328 leftLay->addWidget(lblBasicColors); -
1329 leftLay->addWidget(standard); -
1330 -
1331 -
1332 leftLay->addStretch(); -
1333 -
1334 -
1335 custom = new QColorWell(q, 2, 8, QColorDialogOptions::customColors()); -
1336 custom->setAcceptDrops(true); -
1337 -
1338 q->connect(custom, "2""selected(int,int)", "1""_q_newCustom(int,int)"); -
1339 lblCustomColors = new QLabel(q); -
1340 -
1341 lblCustomColors->setBuddy(custom); -
1342 -
1343 leftLay->addWidget(lblCustomColors); -
1344 leftLay->addWidget(custom); -
1345 -
1346 addCusBt = new QPushButton(q); -
1347 QObject::connect(addCusBt, "2""clicked()", q, "1""_q_addCustom()"); -
1348 leftLay->addWidget(addCusBt); -
1349 } else {
executed: }
Execution Count:3
3
1350 pWidth = 150; -
1351 pHeight = 100; -
1352 -
1353 custom = 0; -
1354 standard = 0; -
1355 }
never executed: }
0
1356 -
1357 QVBoxLayout *rightLay = new QVBoxLayout; -
1358 topLay->addLayout(rightLay); -
1359 -
1360 QHBoxLayout *pickLay = new QHBoxLayout; -
1361 rightLay->addLayout(pickLay); -
1362 -
1363 QVBoxLayout *cLay = new QVBoxLayout; -
1364 pickLay->addLayout(cLay); -
1365 cp = new QColorPicker(q); -
1366 -
1367 cp->setFrameStyle(QFrame::Panel + QFrame::Sunken); -
1368 cLay->addSpacing(lumSpace); -
1369 cLay->addWidget(cp); -
1370 -
1371 cLay->addSpacing(lumSpace); -
1372 -
1373 lp = new QColorLuminancePicker(q); -
1374 lp->setFixedWidth(20); -
1375 pickLay->addWidget(lp); -
1376 -
1377 -
1378 QObject::connect(cp, "2""newCol(int,int)", lp, "1""setCol(int,int)"); -
1379 QObject::connect(lp, "2""newHsv(int,int,int)", q, "1""_q_newHsv(int,int,int)"); -
1380 -
1381 rightLay->addStretch(); -
1382 -
1383 cs = new QColorShower(q); -
1384 QObject::connect(cs, "2""newCol(QRgb)", q, "1""_q_newColorTypedIn(QRgb)"); -
1385 QObject::connect(cs, "2""currentColorChanged(QColor)", -
1386 q, "2""currentColorChanged(QColor)"); -
1387 -
1388 -
1389 -
1390 -
1391 -
1392 rightLay->addWidget(cs); -
1393 -
1394 -
1395 buttons = new QDialogButtonBox(q); -
1396 mainLay->addWidget(buttons); -
1397 -
1398 ok = buttons->addButton(QDialogButtonBox::Ok); -
1399 QObject::connect(ok, "2""clicked()", q, "1""accept()"); -
1400 ok->setDefault(true); -
1401 cancel = buttons->addButton(QDialogButtonBox::Cancel); -
1402 QObject::connect(cancel, "2""clicked()", q, "1""reject()"); -
1403 -
1404 retranslateStrings(); -
1405 -
1406 -
1407 -
1408 -
1409 -
1410 q->setCurrentColor(initial); -
1411}
executed: }
Execution Count:3
3
1412 -
1413void QColorDialogPrivate::initHelper(QPlatformDialogHelper *h) -
1414{ -
1415 QColorDialog *d = q_func(); -
1416 QObject::connect(h, "2""currentColorChanged(QColor)", d, "2""currentColorChanged(QColor)"); -
1417 QObject::connect(h, "2""colorSelected(QColor)", d, "2""colorSelected(QColor)"); -
1418 static_cast<QPlatformColorDialogHelper *>(h)->setOptions(options); -
1419}
never executed: }
0
1420 -
1421void QColorDialogPrivate::helperPrepareShow(QPlatformDialogHelper *) -
1422{ -
1423 options->setWindowTitle(q_func()->windowTitle()); -
1424}
never executed: }
0
1425 -
1426void QColorDialogPrivate::_q_addCustom() -
1427{ -
1428 QColorDialogOptions::setCustomColor(nextCust, cs->currentColor()); -
1429 if (custom)
never evaluated: custom
0
1430 custom->update();
never executed: custom->update();
0
1431 nextCust = (nextCust+1) % 16; -
1432}
never executed: }
0
1433 -
1434void QColorDialogPrivate::retranslateStrings() -
1435{ -
1436 if (!smallDisplay) {
partially evaluated: !smallDisplay
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
1437 lblBasicColors->setText(QColorDialog::tr("&Basic colors")); -
1438 lblCustomColors->setText(QColorDialog::tr("&Custom colors")); -
1439 addCusBt->setText(QColorDialog::tr("&Add to Custom Colors")); -
1440 }
executed: }
Execution Count:3
3
1441 -
1442 cs->retranslateStrings(); -
1443}
executed: }
Execution Count:3
3
1444 -
1445static const Qt::WindowFlags DefaultWindowFlags = -
1446 Qt::Dialog | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint -
1447 | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint; -
1448QColorDialog::QColorDialog(QWidget *parent) -
1449 : QDialog(*new QColorDialogPrivate, parent, DefaultWindowFlags) -
1450{ -
1451 QColorDialogPrivate * const d = d_func(); -
1452 d->init(Qt::white); -
1453}
executed: }
Execution Count:3
3
1454 -
1455 -
1456 -
1457 -
1458 -
1459 -
1460 -
1461QColorDialog::QColorDialog(const QColor &initial, QWidget *parent) -
1462 : QDialog(*new QColorDialogPrivate, parent, DefaultWindowFlags) -
1463{ -
1464 QColorDialogPrivate * const d = d_func(); -
1465 d->init(initial); -
1466}
never executed: }
0
1467 -
1468 -
1469 -
1470 -
1471 -
1472 -
1473void QColorDialog::setCurrentColor(const QColor &color) -
1474{ -
1475 QColorDialogPrivate * const d = d_func(); -
1476 d->setCurrentColor(color.rgb()); -
1477 d->selectColor(color); -
1478 d->setCurrentAlpha(color.alpha()); -
1479 -
1480 if (!testOption(QColorDialog::DontUseNativeDialog) && d->nativeDialogInUse)
partially evaluated: !testOption(QColorDialog::DontUseNativeDialog)
TRUEFALSE
yes
Evaluation Count:5
no
Evaluation Count:0
partially evaluated: d->nativeDialogInUse
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
1481 d->platformColorDialogHelper()->setCurrentColor(color);
never executed: d->platformColorDialogHelper()->setCurrentColor(color);
0
1482}
executed: }
Execution Count:5
5
1483 -
1484QColor QColorDialog::currentColor() const -
1485{ -
1486 const QColorDialogPrivate * const d = d_func(); -
1487 return d->currentQColor();
executed: return d->currentQColor();
Execution Count:2
2
1488} -
1489QColor QColorDialog::selectedColor() const -
1490{ -
1491 const QColorDialogPrivate * const d = d_func(); -
1492 return d->selectedQColor;
executed: return d->selectedQColor;
Execution Count:1
1
1493} -
1494 -
1495 -
1496 -
1497 -
1498 -
1499 -
1500 -
1501void QColorDialog::setOption(ColorDialogOption option, bool on) -
1502{ -
1503 const QColorDialog::ColorDialogOptions previousOptions = options(); -
1504 if (!(previousOptions & option) != !on)
partially evaluated: !(previousOptions & option) != !on
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
1505 setOptions(previousOptions ^ option);
executed: setOptions(previousOptions ^ option);
Execution Count:1
1
1506}
executed: }
Execution Count:1
1
1507bool QColorDialog::testOption(ColorDialogOption option) const -
1508{ -
1509 const QColorDialogPrivate * const d = d_func(); -
1510 return d->options->testOption(static_cast<QColorDialogOptions::ColorDialogOption>(option));
executed: return d->options->testOption(static_cast<QColorDialogOptions::ColorDialogOption>(option));
Execution Count:5
5
1511} -
1512void QColorDialog::setOptions(ColorDialogOptions options) -
1513{ -
1514 QColorDialogPrivate * const d = d_func(); -
1515 -
1516 if (QColorDialog::options() == options)
partially evaluated: QColorDialog::options() == options
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1517 return;
never executed: return;
0
1518 -
1519 d->options->setOptions(QColorDialogOptions::ColorDialogOptions(int(options))); -
1520 d->buttons->setVisible(!(options & NoButtons)); -
1521 d->showAlpha(options & ShowAlphaChannel); -
1522}
executed: }
Execution Count:2
2
1523 -
1524QColorDialog::ColorDialogOptions QColorDialog::options() const -
1525{ -
1526 const QColorDialogPrivate * const d = d_func(); -
1527 return QColorDialog::ColorDialogOptions(int(d->options->options()));
executed: return QColorDialog::ColorDialogOptions(int(d->options->options()));
Execution Count:30
30
1528} -
1529void QColorDialog::setVisible(bool visible) -
1530{ -
1531 QColorDialogPrivate * const d = d_func(); -
1532 -
1533 if (visible){
evaluated: visible
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2
1534 if (testAttribute(Qt::WA_WState_ExplicitShowHide) && !testAttribute(Qt::WA_WState_Hidden))
partially evaluated: testAttribute(Qt::WA_WState_ExplicitShowHide)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
never evaluated: !testAttribute(Qt::WA_WState_Hidden)
0-2
1535 return;
never executed: return;
0
1536 } else if (testAttribute(Qt::WA_WState_ExplicitShowHide) && testAttribute(Qt::WA_WState_Hidden))
executed: }
Execution Count:2
partially evaluated: testAttribute(Qt::WA_WState_ExplicitShowHide)
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
partially evaluated: testAttribute(Qt::WA_WState_Hidden)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1537 return;
never executed: return;
0
1538 -
1539 if (visible)
evaluated: visible
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2
1540 d->selectedQColor = QColor();
executed: d->selectedQColor = QColor();
Execution Count:2
2
1541 if (!(options() & DontUseNativeDialog))
partially evaluated: !(options() & DontUseNativeDialog)
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
1542 d->setNativeDialogVisible(visible);
executed: d->setNativeDialogVisible(visible);
Execution Count:4
4
1543 -
1544 if (d->nativeDialogInUse) {
partially evaluated: d->nativeDialogInUse
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
1545 -
1546 -
1547 setAttribute(Qt::WA_DontShowOnScreen); -
1548 } else {
never executed: }
0
1549 d->nativeDialogInUse = false; -
1550 setAttribute(Qt::WA_DontShowOnScreen, false); -
1551 }
executed: }
Execution Count:4
4
1552 -
1553 -
1554 QDialog::setVisible(visible); -
1555}
executed: }
Execution Count:4
4
1556void QColorDialog::open(QObject *receiver, const char *member) -
1557{ -
1558 QColorDialogPrivate * const d = d_func(); -
1559 connect(this, "2""colorSelected(QColor)", receiver, member); -
1560 d->receiverToDisconnectOnClose = receiver; -
1561 d->memberToDisconnectOnClose = member; -
1562 QDialog::open(); -
1563}
never executed: }
0
1564QColor QColorDialog::getColor(const QColor &initial, QWidget *parent, const QString &title, -
1565 ColorDialogOptions options) -
1566{ -
1567 QColorDialog dlg(parent); -
1568 if (!title.isEmpty())
partially evaluated: !title.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1569 dlg.setWindowTitle(title);
never executed: dlg.setWindowTitle(title);
0
1570 dlg.setOptions(options); -
1571 dlg.setCurrentColor(initial); -
1572 dlg.exec(); -
1573 return dlg.selectedColor();
executed: return dlg.selectedColor();
Execution Count:1
1
1574} -
1575QRgb QColorDialog::getRgba(QRgb initial, bool *ok, QWidget *parent) -
1576{ -
1577 QColor color(getColor(QColor(initial), parent, QString(), ShowAlphaChannel)); -
1578 QRgb result = color.isValid() ? color.rgba() : initial;
partially evaluated: color.isValid()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
1579 if (ok)
partially evaluated: ok
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
1580 *ok = color.isValid();
executed: *ok = color.isValid();
Execution Count:1
1
1581 return result;
executed: return result;
Execution Count:1
1
1582} -
1583 -
1584 -
1585 -
1586 -
1587 -
1588QColorDialog::~QColorDialog() -
1589{ -
1590 -
1591 -
1592 -
1593 -
1594 -
1595 -
1596 -
1597} -
1598 -
1599 -
1600 -
1601 -
1602void QColorDialog::changeEvent(QEvent *e) -
1603{ -
1604 QColorDialogPrivate * const d = d_func(); -
1605 if (e->type() == QEvent::LanguageChange)
partially evaluated: e->type() == QEvent::LanguageChange
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
1606 d->retranslateStrings();
never executed: d->retranslateStrings();
0
1607 QDialog::changeEvent(e); -
1608}
executed: }
Execution Count:7
7
1609void QColorDialog::done(int result) -
1610{ -
1611 QColorDialogPrivate * const d = d_func(); -
1612 QDialog::done(result); -
1613 if (result == Accepted) {
partially evaluated: result == Accepted
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
1614 d->selectedQColor = d->currentQColor(); -
1615 colorSelected(d->selectedQColor); -
1616 } else {
executed: }
Execution Count:1
1
1617 d->selectedQColor = QColor(); -
1618 }
never executed: }
0
1619 if (d->receiverToDisconnectOnClose) {
partially evaluated: d->receiverToDisconnectOnClose
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1620 disconnect(this, "2""colorSelected(QColor)", -
1621 d->receiverToDisconnectOnClose, d->memberToDisconnectOnClose); -
1622 d->receiverToDisconnectOnClose = 0; -
1623 }
never executed: }
0
1624 d->memberToDisconnectOnClose.clear(); -
1625}
executed: }
Execution Count:1
1
1626 -
1627 -
1628 -
1629 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial