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>
This commit is contained in:
hjk
2019-07-04 16:02:09 +02:00
parent 8d84e2f2e1
commit 6e4d0a70e9
7 changed files with 30 additions and 65 deletions

View File

@@ -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