forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user