Replace deprecated Qt APIs, Windows fixes

This commit is contained in:
Jack Andersen 2020-03-30 18:07:18 -10:00
parent 5bda353d57
commit 6e08f95d10
5 changed files with 9 additions and 8 deletions

View File

@ -7,7 +7,7 @@
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/5.12.6/msvc2017_64/lib/cmake/Qt5",
"cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/5.14.1/msvc2017_64/lib/cmake/Qt5",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"variables": []
@ -19,7 +19,7 @@
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/5.12.6/msvc2017_64/lib/cmake/Qt5",
"cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/5.14.1/msvc2017_64/lib/cmake/Qt5",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"variables": []

2
externals/LibCommon vendored

@ -1 +1 @@
Subproject commit 828bda48869ae3a75ae77ac690bb33dcd2ecedee
Subproject commit 22bf8551d31b3ac3e712b853ad20f769ef5a49c7

View File

@ -281,7 +281,7 @@ bool CGizmo::TransformFromInput(const CRay& rkRay, CCamera& rCamera)
// Calculate normalized cursor position
QPoint CursorPos = QCursor::pos();
QRect Geom = QApplication::desktop()->screenGeometry();
QRect Geom = QApplication::primaryScreen()->geometry();
CVector2f MouseCoords(
(((2.f * CursorPos.x()) / Geom.width()) - 1.f),
(1.f - ((2.f * CursorPos.y()) / Geom.height()))
@ -618,7 +618,7 @@ void CGizmo::UpdateTransform()
void CGizmo::WrapCursor()
{
QRect Geom = QApplication::desktop()->screenGeometry();
QRect Geom = QApplication::primaryScreen()->geometry();
QPoint CursorPos = QCursor::pos();
// Horizontal

View File

@ -332,9 +332,9 @@ QString GetDolphinPath()
}
QString AskForDolphinPath(QWidget* pParentWidget) {
#if Q_OS_WIN
#if defined(Q_OS_WIN)
QString Path = UICommon::OpenFileDialog(pParentWidget, "Open Dolphin", "*.exe");
#elif Q_OS_MACOS
#elif defined(Q_OS_MACOS)
QString Path = UICommon::OpenFileDialog(pParentWidget, "Open Dolphin", "*.app");
if (Path.endsWith(".app"))
Path += "/Contents/MacOS/Dolphin";

View File

@ -3,6 +3,7 @@
#include <QDesktopWidget>
#include <QLineEdit>
#include <QMouseEvent>
#include <QScreen>
WDraggableSpinBox::WDraggableSpinBox(QWidget *parent)
: QDoubleSpinBox(parent)
@ -66,7 +67,7 @@ void WDraggableSpinBox::mouseMoveEvent(QMouseEvent*)
setValue(value() + DragAmount);
// Wrap cursor
int ScreenHeight = QApplication::desktop()->screenGeometry().height();
int ScreenHeight = QApplication::primaryScreen()->geometry().height();
if (CursorPos.y() == ScreenHeight - 1)
QCursor::setPos(CursorPos.x(), 1);