diff options
author | The Qt Project <gerrit-noreply@qt-project.org> | 2019-10-14 08:49:14 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2019-10-14 08:49:14 +0000 |
commit | eba59bfd14d0ea29f36e80be81137d26cc67e23a (patch) | |
tree | 69ff8601b3d4a62bea38e1a32245f45cb744aaac /src/widgets/kernel/qtooltip.cpp | |
parent | f03ac58b1ecc24f01cb83b275a9b6088f9483545 (diff) | |
parent | f4b4c4f79b629498f3cddbbc10df8c1b4d6020d9 (diff) |
Merge "Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake" into wip/cmake
Diffstat (limited to 'src/widgets/kernel/qtooltip.cpp')
-rw-r--r-- | src/widgets/kernel/qtooltip.cpp | 45 |
1 files changed, 3 insertions, 42 deletions
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index d030a28356..97a279d65d 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -36,9 +36,6 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#if 0 // Used to be included in Qt4 for Q_WS_MAC -# include <private/qcore_mac_p.h> -#endif #include <QtWidgets/private/qtwidgetsglobal_p.h> @@ -63,11 +60,6 @@ #include <QtWidgets/private/qlabel_p.h> #include <qtooltip.h> -#if 0 // Used to be included in Qt4 for Q_WS_MAC -# include <private/qcore_mac_p.h> -#include <private/qt_cocoa_helpers_mac_p.h> -#endif - QT_BEGIN_NAMESPACE /*! @@ -317,20 +309,7 @@ void QTipLabel::timerEvent(QTimerEvent *e) || e->timerId() == expireTimer.timerId()){ hideTimer.stop(); expireTimer.stop(); -#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(effects) - if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)){ - // Fade out tip on mac (makes it invisible). - // The tip will not be deleted until a new tip is shown. - - // DRSWAT - Cocoa - macWindowFade(qt_mac_window_for(this)); - QTipLabel::instance->fadingOut = true; // will never be false again. - } - else - hideTipImmediately(); -#else hideTipImmediately(); -#endif } } @@ -420,29 +399,11 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w) #endif //QT_NO_STYLE_STYLESHEET -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // When in full screen mode, there is no Dock nor Menu so we can use - // the whole screen for displaying the tooltip. However when not in - // full screen mode we need to save space for the dock, so we use - // availableGeometry instead. - extern bool qt_mac_app_fullscreen; //qapplication_mac.mm - QRect screen; - if(qt_mac_app_fullscreen) - screen = QDesktopWidgetPrivate::screenGeometry(getTipScreen(pos, w)); - else - screen = QDesktopWidgetPrivate::availableGeometry(getTipScreen(pos, w)); -#else QRect screen = QDesktopWidgetPrivate::screenGeometry(getTipScreen(pos, w)); -#endif QPoint p = pos; - p += QPoint(2, -#if 0 // Used to be included in Qt4 for Q_WS_WIN - 21 -#else - 16 -#endif - ); + p += QPoint(2, 16); + if (p.x() + this->width() > screen.x() + screen.width()) p.rx() -= 4 + this->width(); if (p.y() + this->height() > screen.y() + screen.height()) @@ -541,7 +502,7 @@ QT_WARNING_POP QTipLabel::instance->setObjectName(QLatin1String("qtooltip_label")); -#if QT_CONFIG(effects) && !0 /* Used to be included in Qt4 for Q_WS_MAC */ +#if QT_CONFIG(effects) if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)) qFadeEffect(QTipLabel::instance); else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip)) |