summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qtooltip.cpp10
-rw-r--r--src/widgets/kernel/qwidget.cpp6
2 files changed, 6 insertions, 10 deletions
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index 3417d93d587..97332cd7d5d 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -6,15 +6,12 @@
#include <qapplication.h>
#include <qevent.h>
-#include <qpointer.h>
#include <qstyle.h>
#include <qstyleoption.h>
#include <qstylepainter.h>
#if QT_CONFIG(effects)
#include <private/qeffects_p.h>
#endif
-#include <qtextdocument.h>
-#include <qdebug.h>
#include <qpa/qplatformscreen.h>
#include <qpa/qplatformcursor.h>
#if QT_CONFIG(style_stylesheet)
@@ -23,12 +20,9 @@
#include <qpa/qplatformwindow.h>
#include <qpa/qplatformwindow_p.h>
-#include <qlabel.h>
#include <QtWidgets/private/qlabel_p.h>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <qtooltip.h>
-
-#include <QtCore/qbasictimer.h>
#include <QtWidgets/private/qtooltip_p.h>
QT_BEGIN_NAMESPACE
@@ -190,10 +184,10 @@ void QTipLabel::resizeEvent(QResizeEvent *e)
void QTipLabel::mouseMoveEvent(QMouseEvent *e)
{
if (!rect.isNull()) {
- QPoint pos = e->globalPosition().toPoint();
+ QPointF pos = e->globalPosition();
if (widget)
pos = widget->mapFromGlobal(pos);
- if (!rect.contains(pos))
+ if (!rect.contains(pos.toPoint()))
hideTip();
}
QLabel::mouseMoveEvent(e);
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 9499c88af12..bd2b5be11aa 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -32,7 +32,7 @@
#include "private/qwidgetwindow_p.h"
#include "qpainter.h"
#if QT_CONFIG(tooltip)
-#include "qtooltip.h"
+#include "private/qtooltip_p.h"
#endif
#if QT_CONFIG(whatsthis)
#include "qwhatsthis.h"
@@ -1435,7 +1435,9 @@ void QWidgetPrivate::createTLSysExtra()
if (extra->topextra->opacity != 255 && q->isWindow())
extra->topextra->window->setOpacity(qreal(extra->topextra->opacity) / qreal(255));
- const bool isTipLabel = q->inherits("QTipLabel");
+#if QT_CONFIG(tooltip)
+ const bool isTipLabel = qobject_cast<const QTipLabel *>(q) != nullptr;
+#endif
const bool isAlphaWidget = !isTipLabel && q->inherits("QAlphaWidget");
#ifdef Q_OS_WIN
// Pass on native parent handle for Widget embedded into Active X.