aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-07-04 16:02:09 +0200
committerhjk <hjk@qt.io>2019-07-05 07:49:32 +0000
commit6e4d0a70e9cd28639aecb69f4bb025af3633bec4 (patch)
tree12621c929b25cb6e5aca1b7092a32dbc6b1daf46 /src/libs
parent8d84e2f2e163bceec8870893d7de55d14174f333 (diff)
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 <christian.kandeler@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/utils/CMakeLists.txt1
-rw-r--r--src/libs/utils/tooltip/reuse.h55
-rw-r--r--src/libs/utils/tooltip/tips.cpp24
-rw-r--r--src/libs/utils/tooltip/tips.h3
-rw-r--r--src/libs/utils/tooltip/tooltip.cpp10
-rw-r--r--src/libs/utils/utils-lib.pri1
-rw-r--r--src/libs/utils/utils.qbs1
7 files changed, 30 insertions, 65 deletions
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 <utils/hostosinfo.h>
-
-#include <QPoint>
-#include <QRect>
-#include <QWidget>
-#include <QApplication>
-#include <QDesktopWidget>
-
-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 <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <QRect>
@@ -43,6 +43,12 @@
#include <QPaintEvent>
#include <QVBoxLayout>
+#include <QPoint>
+#include <QRect>
+#include <QWidget>
+#include <QApplication>
+#include <QDesktopWidget>
+
#include <memory>
namespace Utils {
@@ -287,5 +293,21 @@ bool WidgetTip::equals(int typeId, const QVariant &other, const QVariant &otherC
&& other.value<QWidget *>() == 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 <utils/faketooltip.h>
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
-#include <QString>
+#include <QApplication>
#include <QColor>
-#include <QGuiApplication>
+#include <QDebug>
+#include <QDesktopWidget>
#include <QKeyEvent>
+#include <QMenu>
#include <QMouseEvent>
#include <QWidget>
-#include <QMenu>
-
-#include <QDebug>
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",