diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 00307728a68..5863c35d1ff 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -144,7 +144,6 @@ add_qtc_library(Utils textutils.cpp textutils.h theme/theme.cpp theme/theme.h theme/theme_p.h tooltip/effects.h - tooltip/reuse.h tooltip/tips.cpp tooltip/tips.h tooltip/tooltip.cpp tooltip/tooltip.h touchbar/touchbar.h diff --git a/src/libs/utils/tooltip/reuse.h b/src/libs/utils/tooltip/reuse.h deleted file mode 100644 index ee2fca72de4..00000000000 --- a/src/libs/utils/tooltip/reuse.h +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include - -#include -#include -#include -#include -#include - -namespace Utils { -namespace Internal { - -inline int screenNumber(const QPoint &pos, QWidget *w) -{ - if (QApplication::desktop()->isVirtualDesktop()) - return QApplication::desktop()->screenNumber(pos); - else - return QApplication::desktop()->screenNumber(w); -} - -inline QRect screenGeometry(const QPoint &pos, QWidget *w) -{ - if (HostOsInfo::isMacHost()) - return QApplication::desktop()->availableGeometry(screenNumber(pos, w)); - return QApplication::desktop()->screenGeometry(screenNumber(pos, w)); -} - -} // namespace Internal -} // namespace Utils diff --git a/src/libs/utils/tooltip/tips.cpp b/src/libs/utils/tooltip/tips.cpp index d882bdb1d88..f6927efef52 100644 --- a/src/libs/utils/tooltip/tips.cpp +++ b/src/libs/utils/tooltip/tips.cpp @@ -25,8 +25,8 @@ #include "tips.h" #include "tooltip.h" -#include "reuse.h" +#include #include #include @@ -43,6 +43,12 @@ #include #include +#include +#include +#include +#include +#include + #include namespace Utils { @@ -287,5 +293,21 @@ bool WidgetTip::equals(int typeId, const QVariant &other, const QVariant &otherC && other.value() == m_widget; } + +int screenNumber(const QPoint &pos, QWidget *w) +{ + if (QApplication::desktop()->isVirtualDesktop()) + return QApplication::desktop()->screenNumber(pos); + else + return QApplication::desktop()->screenNumber(w); +} + +QRect screenGeometry(const QPoint &pos, QWidget *w) +{ + if (HostOsInfo::isMacHost()) + return QApplication::desktop()->availableGeometry(screenNumber(pos, w)); + return QApplication::desktop()->screenGeometry(screenNumber(pos, w)); +} + } // namespace Internal } // namespace Utils diff --git a/src/libs/utils/tooltip/tips.h b/src/libs/utils/tooltip/tips.h index 22415075ab8..68aec099d9c 100644 --- a/src/libs/utils/tooltip/tips.h +++ b/src/libs/utils/tooltip/tips.h @@ -36,6 +36,9 @@ namespace Utils { namespace Internal { +int screenNumber(const QPoint &pos, QWidget *w); +QRect screenGeometry(const QPoint &pos, QWidget *w); + class TipLabel : public QLabel { public: diff --git a/src/libs/utils/tooltip/tooltip.cpp b/src/libs/utils/tooltip/tooltip.cpp index 27cbc83720d..3dfb6d9b863 100644 --- a/src/libs/utils/tooltip/tooltip.cpp +++ b/src/libs/utils/tooltip/tooltip.cpp @@ -26,21 +26,19 @@ #include "tooltip.h" #include "tips.h" #include "effects.h" -#include "reuse.h" #include #include #include -#include +#include #include -#include +#include +#include #include +#include #include #include -#include - -#include using namespace Utils; using namespace Internal; diff --git a/src/libs/utils/utils-lib.pri b/src/libs/utils/utils-lib.pri index c7fef47c97f..a4697e06225 100644 --- a/src/libs/utils/utils-lib.pri +++ b/src/libs/utils/utils-lib.pri @@ -214,7 +214,6 @@ HEADERS += \ $$PWD/elidinglabel.h \ $$PWD/tooltip/tooltip.h \ $$PWD/tooltip/tips.h \ - $$PWD/tooltip/reuse.h \ $$PWD/tooltip/effects.h \ $$PWD/unixutils.h \ $$PWD/ansiescapecodehandler.h \ diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 694045e2900..10368cd5397 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -293,7 +293,6 @@ Project { prefix: "tooltip/" files: [ "effects.h", - "reuse.h", "tips.cpp", "tips.h", "tooltip.cpp",