From 6e4d0a70e9cd28639aecb69f4bb025af3633bec4 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 4 Jul 2019 16:02:09 +0200 Subject: Utils: Move reuse.h out of sight It caused a deprecation warning in each user. The warning itself is not gone but appears less often now. Change-Id: I03a995897635a182fa254fa574ccbfbfc7515f1a Reviewed-by: Christian Kandeler --- src/libs/utils/CMakeLists.txt | 1 - src/libs/utils/tooltip/reuse.h | 55 -------------------------------------- src/libs/utils/tooltip/tips.cpp | 24 ++++++++++++++++- src/libs/utils/tooltip/tips.h | 3 +++ src/libs/utils/tooltip/tooltip.cpp | 10 +++---- src/libs/utils/utils-lib.pri | 1 - src/libs/utils/utils.qbs | 1 - 7 files changed, 30 insertions(+), 65 deletions(-) delete mode 100644 src/libs/utils/tooltip/reuse.h (limited to 'src/libs') diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 00307728a6..5863c35d1f 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 ee2fca72de..0000000000 --- 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 d882bdb1d8..f6927efef5 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 22415075ab..68aec099d9 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 27cbc83720..3dfb6d9b86 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 c7fef47c97..a4697e0622 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 694045e290..10368cd539 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", -- cgit v1.2.3