qwhatsthis.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/kernel/qwhatsthis.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6__attribute__((visibility("default"))) void qDeleteInEventHandler(QObject *o);-
7-
8class QWhatsThat : public QWidget-
9{-
10 public: template <typename ThisObject> inline void qt_check_for_QOBJECT_macro(const ThisObject &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; }-
11#pragma GCC diagnostic push-
12 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
13#pragma GCC diagnostic pop-
14 struct QPrivateSignal {};-
15-
16public:-
17 QWhatsThat(const QString& txt, QWidget* parent, QWidget *showTextFor);-
18 ~QWhatsThat() ;-
19-
20 static QWhatsThat *instance;-
21-
22protected:-
23 void showEvent(QShowEvent *e) override;-
24 void mousePressEvent(QMouseEvent*) override;-
25 void mouseReleaseEvent(QMouseEvent*) override;-
26 void mouseMoveEvent(QMouseEvent*) override;-
27 void keyPressEvent(QKeyEvent*) override;-
28 void paintEvent(QPaintEvent*) override;-
29-
30private:-
31 QPointer<QWidget>widget;-
32 bool pressed;-
33 QString text;-
34 QTextDocument* doc;-
35 QString anchor;-
36 QPixmap background;-
37};-
38-
39QWhatsThat *QWhatsThat::instance = 0;-
40-
41-
42static int shadowWidth = 6;-
43static const int vMargin = 8;-
44static const int hMargin = 12;-
45-
46static inline bool dropShadow()-
47{-
48 if (const
const QPlatfor...latformTheme()Description
TRUEnever evaluated
FALSEnever evaluated
QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()
const QPlatfor...latformTheme()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
49 return
never executed: return theme->themeHint(QPlatformTheme::DropShadow).toBool();
theme->themeHint(QPlatformTheme::DropShadow).toBool();
never executed: return theme->themeHint(QPlatformTheme::DropShadow).toBool();
0
50 return
never executed: return false;
false;
never executed: return false;
0
51}-
52-
53QWhatsThat::QWhatsThat(const QString& txt, QWidget* parent, QWidget *showTextFor)-
54 : QWidget(parent, Qt::Popup),-
55 widget(showTextFor), pressed(false), text(txt)-
56{-
57 delete instance;-
58 instance = this;-
59 setAttribute(Qt::WA_DeleteOnClose, true);-
60 setAttribute(Qt::WA_NoSystemBackground, true);-
61 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
62 setPalette(parent->palette());
never executed: setPalette(parent->palette());
0
63 setMouseTracking(true);-
64 setFocusPolicy(Qt::StrongFocus);-
65-
66 setCursor(Qt::ArrowCursor);-
67-
68 QRect r;-
69 doc = 0;-
70 ensurePolished();-
71 if (Qt::mightBeRichText(text)
Qt::mightBeRichText(text)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
72 doc = new QTextDocument();-
73 doc->setUndoRedoEnabled(false);-
74 doc->setDefaultFont(QApplication::font(this));-
75-
76-
77-
78 doc->setHtml(text);-
79-
80 doc->setUndoRedoEnabled(false);-
81 doc->adjustSize();-
82 r.setTop(0);-
83 r.setLeft(0);-
84 r.setSize(doc->size().toSize());-
85 }
never executed: end of block
0
86 else-
87 {-
88 int sw = QApplication::desktop()->width() / 3;-
89 if (sw < 200
sw < 200Description
TRUEnever evaluated
FALSEnever evaluated
)
0
90 sw = 200;
never executed: sw = 200;
0
91 else if (sw > 300
sw > 300Description
TRUEnever evaluated
FALSEnever evaluated
)
0
92 sw = 300;
never executed: sw = 300;
0
93-
94 r = fontMetrics().boundingRect(0, 0, sw, 1000,-
95 Qt::AlignLeft + Qt::AlignTop-
96 + Qt::TextWordWrap + Qt::TextExpandTabs,-
97 text);-
98 }
never executed: end of block
0
99 shadowWidth = dropShadow()
dropShadow()Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : 6;
0
100 resize(r.width() + 2*hMargin + shadowWidth, r.height() + 2*vMargin + shadowWidth);-
101}
never executed: end of block
0
102-
103QWhatsThat::~QWhatsThat()-
104{-
105 instance = 0;-
106 if (doc
docDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
107 delete doc;
never executed: delete doc;
0
108}
never executed: end of block
0
109-
110void QWhatsThat::showEvent(QShowEvent *)-
111{-
112 background = QGuiApplication::primaryScreen()->grabWindow(QApplication::desktop()->internalWinId(),-
113 x(), y(), width(), height());-
114}
never executed: end of block
0
115-
116void QWhatsThat::mousePressEvent(QMouseEvent* e)-
117{-
118 pressed = true;-
119 if (e->button() == Qt::LeftButton
e->button() == Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
&& rect().contains(e->pos())
rect().contains(e->pos())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
120 if (doc
docDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
121 anchor = doc->documentLayout()->anchorAt(e->pos() - QPoint(hMargin, vMargin));
never executed: anchor = doc->documentLayout()->anchorAt(e->pos() - QPoint(hMargin, vMargin));
0
122 return;
never executed: return;
0
123 }-
124 close();-
125}
never executed: end of block
0
126-
127void QWhatsThat::mouseReleaseEvent(QMouseEvent* e)-
128{-
129 if (!pressed
!pressedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
130 return;
never executed: return;
0
131 if (widget
widgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& e->button() == Qt::LeftButton
e->button() == Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
&& doc
docDescription
TRUEnever evaluated
FALSEnever evaluated
&& rect().contains(e->pos())
rect().contains(e->pos())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
132 QString a = doc->documentLayout()->anchorAt(e->pos() - QPoint(hMargin, vMargin));-
133 QString href;-
134 if (anchor == a
anchor == aDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
135 href = a;
never executed: href = a;
0
136 anchor.clear();-
137 if (!href.isEmpty()
!href.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
138 QWhatsThisClickedEvent e(href);-
139 if (QApplication::sendEvent(widget, &e)
QApplication::...nt(widget, &e)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
140 return;
never executed: return;
0
141 }
never executed: end of block
0
142 }
never executed: end of block
0
143 close();-
144}
never executed: end of block
0
145-
146void QWhatsThat::mouseMoveEvent(QMouseEvent* e)-
147{-
148-
149-
150-
151 if (!doc
!docDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
152 return;
never executed: return;
0
153 QString a = doc->documentLayout()->anchorAt(e->pos() - QPoint(hMargin, vMargin));-
154 if (!a.isEmpty()
!a.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
155 setCursor(Qt::PointingHandCursor);
never executed: setCursor(Qt::PointingHandCursor);
0
156 else-
157 setCursor(Qt::ArrowCursor);
never executed: setCursor(Qt::ArrowCursor);
0
158-
159}-
160-
161void QWhatsThat::keyPressEvent(QKeyEvent*)-
162{-
163 close();-
164}
never executed: end of block
0
165-
166void QWhatsThat::paintEvent(QPaintEvent*)-
167{-
168 const bool drawShadow = dropShadow();-
169-
170 QRect r = rect();-
171 r.adjust(0, 0, -1, -1);-
172 if (drawShadow
drawShadowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
173 r.adjust(0, 0, -shadowWidth, -shadowWidth);
never executed: r.adjust(0, 0, -shadowWidth, -shadowWidth);
0
174 QPainter p(this);-
175 p.drawPixmap(0, 0, background);-
176 p.setPen(QPen(palette().toolTipText(), 0));-
177 p.setBrush(palette().toolTipBase());-
178 p.drawRect(r);-
179 int w = r.width();-
180 int h = r.height();-
181 p.setPen(palette().brush(QPalette::Dark).color());-
182 p.drawRect(1, 1, w-2, h-2);-
183 if (drawShadow
drawShadowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
184 p.setPen(palette().shadow().color());-
185 p.drawPoint(w + 5, 6);-
186 p.drawLine(w + 3, 6, w + 5, 8);-
187 p.drawLine(w + 1, 6, w + 5, 10);-
188 int i;-
189 for(i=7; i < h
i < hDescription
TRUEnever evaluated
FALSEnever evaluated
; i += 2)
0
190 p.drawLine(w, i, w + 5, i + 5);
never executed: p.drawLine(w, i, w + 5, i + 5);
0
191 for(i = w - i + h; i > 6
i > 6Description
TRUEnever evaluated
FALSEnever evaluated
; i -= 2)
0
192 p.drawLine(i, h, i + 5, h + 5);
never executed: p.drawLine(i, h, i + 5, h + 5);
0
193 for(; i > 0
i > 0Description
TRUEnever evaluated
FALSEnever evaluated
; i -= 2)
0
194 p.drawLine(6, h + 6 - i, i + 5, h + 5);
never executed: p.drawLine(6, h + 6 - i, i + 5, h + 5);
0
195 }
never executed: end of block
0
196 r.adjust(0, 0, 1, 1);-
197 p.setPen(palette().toolTipText().color());-
198 r.adjust(hMargin, vMargin, -hMargin, -vMargin);-
199-
200 if (doc
docDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
201 p.translate(r.x(), r.y());-
202 QRect rect = r;-
203 rect.translate(-r.x(), -r.y());-
204 p.setClipRect(rect);-
205 QAbstractTextDocumentLayout::PaintContext context;-
206 context.palette.setBrush(QPalette::Text, context.palette.toolTipText());-
207 doc->documentLayout()->draw(&p, context);-
208 }
never executed: end of block
0
209 else-
210 {-
211 p.drawText(r, Qt::AlignLeft + Qt::AlignTop + Qt::TextWordWrap + Qt::TextExpandTabs, text);-
212 }
never executed: end of block
0
213}-
214-
215static const char * const button_image[] = {-
216"16 16 3 1",-
217" c None",-
218"o c #000000",-
219"a c #000080",-
220"o aaaaa ",-
221"oo aaa aaa ",-
222"ooo aaa aaa",-
223"oooo aa aa",-
224"ooooo aa aa",-
225"oooooo a aaa",-
226"ooooooo aaa ",-
227"oooooooo aaa ",-
228"ooooooooo aaa ",-
229"ooooo aaa ",-
230"oo ooo ",-
231"o ooo aaa ",-
232" ooo aaa ",-
233" ooo ",-
234" ooo ",-
235" ooo "};-
236-
237class QWhatsThisPrivate : public QObject-
238{-
239 public:-
240 QWhatsThisPrivate();-
241 ~QWhatsThisPrivate();-
242 static QWhatsThisPrivate *instance;-
243 bool eventFilter(QObject *, QEvent *) override;-
244 QPointer<QAction> action;-
245 static void say(QWidget *, const QString &, int x = 0, int y = 0);-
246 static void notifyToplevels(QEvent *e);-
247 bool leaveOnMouseRelease;-
248};-
249-
250void QWhatsThisPrivate::notifyToplevels(QEvent *e)-
251{-
252 const QWidgetList toplevels = QApplication::topLevelWidgets();-
253 for (auto *w : toplevels)-
254 QApplication::sendEvent(w, e);
never executed: QApplication::sendEvent(w, e);
0
255}
never executed: end of block
0
256-
257QWhatsThisPrivate *QWhatsThisPrivate::instance = 0;-
258-
259QWhatsThisPrivate::QWhatsThisPrivate()-
260 : leaveOnMouseRelease(false)-
261{-
262 instance = this;-
263 (static_cast<QApplication *>(QCoreApplication::instance()))->installEventFilter(this);-
264-
265 QPoint pos = QCursor::pos();-
266 if (QWidget *w = QApplication::widgetAt(pos)
QWidget *w = Q...:widgetAt(pos)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
267 QHelpEvent e(QEvent::QueryWhatsThis, w->mapFromGlobal(pos), pos);-
268 bool sentEvent = QApplication::sendEvent(w, &e);-
269-
270-
271-
272 QApplication::setOverrideCursor((!sentEvent || !e.isAccepted())?-
273 Qt::ForbiddenCursor:Qt::WhatsThisCursor);-
274 }
never executed: end of block
else {
0
275 QApplication::setOverrideCursor(Qt::WhatsThisCursor);-
276-
277 }
never executed: end of block
0
278-
279 QAccessibleEvent event(this, QAccessible::ContextHelpStart);-
280 QAccessible::updateAccessibility(&event);-
281-
282}
never executed: end of block
0
283-
284QWhatsThisPrivate::~QWhatsThisPrivate()-
285{-
286 if (action
actionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
287 action->setChecked(false);
never executed: action->setChecked(false);
0
288-
289 QApplication::restoreOverrideCursor();-
290-
291-
292 QAccessibleEvent event(this, QAccessible::ContextHelpEnd);-
293 QAccessible::updateAccessibility(&event);-
294-
295 instance = 0;-
296}
never executed: end of block
0
297-
298bool QWhatsThisPrivate::eventFilter(QObject *o, QEvent *e)-
299{-
300 if (!o->isWidgetType()
!o->isWidgetType()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
301 return
never executed: return false;
false;
never executed: return false;
0
302 QWidget * w = static_cast<QWidget *>(o);-
303 bool customWhatsThis = w->testAttribute(Qt::WA_CustomWhatsThis);-
304 switch (e->type()) {-
305 case
never executed: case QEvent::MouseButtonPress:
QEvent::MouseButtonPress:
never executed: case QEvent::MouseButtonPress:
0
306 {-
307 QMouseEvent *me = static_cast<QMouseEvent*>(e);-
308 if (me->button() == Qt::RightButton
me->button() =...t::RightButtonDescription
TRUEnever evaluated
FALSEnever evaluated
|| customWhatsThis
customWhatsThisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
309 return
never executed: return false;
false;
never executed: return false;
0
310 QHelpEvent e(QEvent::WhatsThis, me->pos(), me->globalPos());-
311 if (!QApplication::sendEvent(w, &e)
!QApplication:...ndEvent(w, &e)Description
TRUEnever evaluated
FALSEnever evaluated
|| !e.isAccepted()
!e.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
312 leaveOnMouseRelease = true;
never executed: leaveOnMouseRelease = true;
0
313-
314 } break;
never executed: break;
0
315-
316 case
never executed: case QEvent::MouseMove:
QEvent::MouseMove:
never executed: case QEvent::MouseMove:
0
317 {-
318 QMouseEvent *me = static_cast<QMouseEvent*>(e);-
319 QHelpEvent e(QEvent::QueryWhatsThis, me->pos(), me->globalPos());-
320 bool sentEvent = QApplication::sendEvent(w, &e);-
321-
322-
323-
324 QApplication::changeOverrideCursor((!sentEvent || !e.isAccepted())?-
325 Qt::ForbiddenCursor:Qt::WhatsThisCursor);-
326-
327 }-
328-
329 case
never executed: case QEvent::MouseButtonRelease:
QEvent::MouseButtonRelease:
never executed: case QEvent::MouseButtonRelease:
code before this statement never executed: case QEvent::MouseButtonRelease:
0
330 case
never executed: case QEvent::MouseButtonDblClick:
QEvent::MouseButtonDblClick:
never executed: case QEvent::MouseButtonDblClick:
0
331 if (leaveOnMouseRelease
leaveOnMouseReleaseDescription
TRUEnever evaluated
FALSEnever evaluated
&& e->type() == QEvent::MouseButtonRelease
e->type() == Q...eButtonReleaseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
332 QWhatsThis::leaveWhatsThisMode();
never executed: QWhatsThis::leaveWhatsThisMode();
0
333 if (static_cast<
static_cast<QM...t::RightButtonDescription
TRUEnever evaluated
FALSEnever evaluated
QMouseEvent*>(e)->button() == Qt::RightButton
static_cast<QM...t::RightButtonDescription
TRUEnever evaluated
FALSEnever evaluated
|| customWhatsThis
customWhatsThisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
334 return
never executed: return false;
false;
never executed: return false;
0
335 break;
never executed: break;
0
336 case
never executed: case QEvent::KeyPress:
QEvent::KeyPress:
never executed: case QEvent::KeyPress:
0
337 {-
338 QKeyEvent* kev = (QKeyEvent*)e;-
339-
340 if (kev->matches(QKeySequence::Cancel)
kev->matches(Q...uence::Cancel)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
341 QWhatsThis::leaveWhatsThisMode();-
342 return
never executed: return true;
true;
never executed: return true;
0
343 } else if (customWhatsThis
customWhatsThisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
344 return
never executed: return false;
false;
never executed: return false;
0
345 } else if (kev->key() == Qt::Key_Menu
kev->key() == Qt::Key_MenuDescription
TRUEnever evaluated
FALSEnever evaluated
||
0
346 (kev->key() == Qt::Key_F10
kev->key() == Qt::Key_F10Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
347 kev->modifiers() == Qt::ShiftModifier
kev->modifiers...:ShiftModifierDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
348-
349 return
never executed: return false;
false;
never executed: return false;
0
350 } else if (kev->key() != Qt::Key_Shift
kev->key() != Qt::Key_ShiftDescription
TRUEnever evaluated
FALSEnever evaluated
&& kev->key() != Qt::Key_Alt
kev->key() != Qt::Key_AltDescription
TRUEnever evaluated
FALSEnever evaluated
0
351 && kev->key() != Qt::Key_Control
kev->key() != Qt::Key_ControlDescription
TRUEnever evaluated
FALSEnever evaluated
&& kev->key() != Qt::Key_Meta
kev->key() != Qt::Key_MetaDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
352 QWhatsThis::leaveWhatsThisMode();-
353 }
never executed: end of block
0
354 } break;
never executed: break;
0
355 default
never executed: default:
:
never executed: default:
0
356 return
never executed: return false;
false;
never executed: return false;
0
357 }-
358 return
never executed: return true;
true;
never executed: return true;
0
359}-
360-
361class QWhatsThisAction: public QAction-
362{-
363 public: template <typename ThisObject> inline void qt_check_for_QOBJECT_macro(const ThisObject &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; }-
364#pragma GCC diagnostic push-
365 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
366#pragma GCC diagnostic pop-
367 struct QPrivateSignal {};-
368-
369public:-
370 explicit QWhatsThisAction(QObject* parent = 0);-
371-
372private :-
373 void actionTriggered();-
374};-
375-
376QWhatsThisAction::QWhatsThisAction(QObject *parent) : QAction(tr("What's This?"), parent)-
377{-
378-
379 QPixmap p(button_image);-
380 setIcon(p);-
381-
382 setCheckable(true);-
383 connect(this, qFlagLocation("2""triggered()" "\0" __FILE__ ":" "505"), this, qFlagLocation("1""actionTriggered()" "\0" __FILE__ ":" "505"));-
384-
385 setShortcut(Qt::ShiftModifier + Qt::Key_F1);-
386-
387}
never executed: end of block
0
388-
389void QWhatsThisAction::actionTriggered()-
390{-
391 if (isChecked()
isChecked()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
392 QWhatsThis::enterWhatsThisMode();-
393 QWhatsThisPrivate::instance->action = this;-
394 }
never executed: end of block
0
395}
never executed: end of block
0
396void QWhatsThis::enterWhatsThisMode()-
397{-
398 if (QWhatsThisPrivate::instance
QWhatsThisPrivate::instanceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
399 return;
never executed: return;
0
400 (void) new QWhatsThisPrivate;-
401 QEvent e(QEvent::EnterWhatsThisMode);-
402 QWhatsThisPrivate::notifyToplevels(&e);-
403 }
never executed: end of block
0
404-
405-
406-
407-
408-
409-
410-
411bool QWhatsThis::inWhatsThisMode()-
412{-
413 return
never executed: return (QWhatsThisPrivate::instance != 0);
(QWhatsThisPrivate::instance != 0);
never executed: return (QWhatsThisPrivate::instance != 0);
0
414}-
415void QWhatsThis::leaveWhatsThisMode()-
416{-
417 delete QWhatsThisPrivate::instance;-
418 QEvent e(QEvent::LeaveWhatsThisMode);-
419 QWhatsThisPrivate::notifyToplevels(&e);-
420}
never executed: end of block
0
421-
422void QWhatsThisPrivate::say(QWidget * widget, const QString &text, int x, int y)-
423{-
424 if (text.size() == 0
text.size() == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
425 return;
never executed: return;
0
426-
427 QWhatsThat *whatsThat = new QWhatsThat(-
428 text,-
429-
430-
431-
432 0,-
433-
434 widget-
435 );-
436-
437-
438-
439-
440 int scr = (widget
widgetDescription
TRUEnever evaluated
FALSEnever evaluated
?
0
441 QApplication::desktop()->screenNumber(widget) :-
442-
443-
444-
445 QApplication::desktop()->screenNumber(QPoint(x,y))-
446-
447 );-
448 QRect screen = QApplication::desktop()->screenGeometry(scr);-
449-
450 int w = whatsThat->width();-
451 int h = whatsThat->height();-
452 int sx = screen.x();-
453 int sy = screen.y();-
454-
455-
456-
457 QPoint pos;-
458 if (widget
widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
459 pos = widget->mapToGlobal(QPoint(0,0));
never executed: pos = widget->mapToGlobal(QPoint(0,0));
0
460-
461 if (widget
widgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& w > widget->width() + 16
w > widget->width() + 16Description
TRUEnever evaluated
FALSEnever evaluated
)
0
462 x = pos.x() + widget->width()/2 - w/2;
never executed: x = pos.x() + widget->width()/2 - w/2;
0
463 else-
464 x = x - w/2;
never executed: x = x - w/2;
0
465-
466-
467-
468 if (x + w + shadowWidth > sx+screen.width()
x + w + shadow...screen.width()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
469 x = (widget
widgetDescription
TRUEnever evaluated
FALSEnever evaluated
? (qMin(screen.width(),
never executed: x = (widget? (qMin(screen.width(), pos.x() + widget->width()) ) : screen.width()) - w;
0
470 pos.x() + widget->width())
never executed: x = (widget? (qMin(screen.width(), pos.x() + widget->width()) ) : screen.width()) - w;
0
471 ) : screen.width())
never executed: x = (widget? (qMin(screen.width(), pos.x() + widget->width()) ) : screen.width()) - w;
0
472 - w;
never executed: x = (widget? (qMin(screen.width(), pos.x() + widget->width()) ) : screen.width()) - w;
0
473-
474 if (x < sx
x < sxDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
475 x = sx;
never executed: x = sx;
0
476-
477 if (widget
widgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& h > widget->height() + 16
h > widget->height() + 16Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
478 y = pos.y() + widget->height() + 2;-
479-
480 if (y + h + 10 > sy+screen.height()
y + h + 10 > s...creen.height()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
481 y = pos.y() + 2 - shadowWidth - h;
never executed: y = pos.y() + 2 - shadowWidth - h;
0
482 }
never executed: end of block
0
483 y = y + 2;-
484-
485-
486-
487 if (y + h + shadowWidth > sy+screen.height()
y + h + shadow...creen.height()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
488 y = (widget
widgetDescription
TRUEnever evaluated
FALSEnever evaluated
? (qMin(screen.height(),
never executed: y = (widget ? (qMin(screen.height(), pos.y() + widget->height()) ) : screen.height()) - h;
0
489 pos.y() + widget->height())
never executed: y = (widget ? (qMin(screen.height(), pos.y() + widget->height()) ) : screen.height()) - h;
0
490 ) : screen.height())
never executed: y = (widget ? (qMin(screen.height(), pos.y() + widget->height()) ) : screen.height()) - h;
0
491 - h;
never executed: y = (widget ? (qMin(screen.height(), pos.y() + widget->height()) ) : screen.height()) - h;
0
492 if (y < sy
y < syDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
493 y = sy;
never executed: y = sy;
0
494-
495 whatsThat->move(x, y);-
496 whatsThat->show();-
497 whatsThat->grabKeyboard();-
498}
never executed: end of block
0
499void QWhatsThis::showText(const QPoint &pos, const QString &text, QWidget *w)-
500{-
501 leaveWhatsThisMode();-
502 QWhatsThisPrivate::say(w, text, pos.x(), pos.y());-
503}
never executed: end of block
0
504-
505-
506-
507-
508-
509-
510void QWhatsThis::hideText()-
511{-
512 qDeleteInEventHandler(QWhatsThat::instance);-
513}
never executed: end of block
0
514QAction *QWhatsThis::createAction(QObject *parent)-
515{-
516 return
never executed: return new QWhatsThisAction(parent);
new QWhatsThisAction(parent);
never executed: return new QWhatsThisAction(parent);
0
517}-
518-
519-
520-
Switch to Source codePreprocessed file

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