diff --git a/src/tycommander/arduino_dialog.cc b/src/tycommander/arduino_dialog.cc index 0e29235..e6fb40b 100644 --- a/src/tycommander/arduino_dialog.cc +++ b/src/tycommander/arduino_dialog.cc @@ -13,7 +13,7 @@ #endif #include #include -#include +#include #include #include "arduino_dialog.hpp" @@ -152,7 +152,9 @@ void ArduinoDialog::appendMessage(const QString &msg, const QTextCharFormat &fmt void ArduinoDialog::executeAsRoot(const QString &command) { #ifdef _WIN32 - if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA) { + auto vista = QOperatingSystemVersion(QOperatingSystemVersion::Windows, 6, 0); + + if (QOperatingSystemVersion::current() >= vista) { installWithUAC(command); return; } diff --git a/src/tycommander/enhanced_widgets.cc b/src/tycommander/enhanced_widgets.cc index 9cdb45b..4cf73a7 100644 --- a/src/tycommander/enhanced_widgets.cc +++ b/src/tycommander/enhanced_widgets.cc @@ -139,9 +139,9 @@ void EnhancedLineInput::keyPressEvent(QKeyEvent *ev) void EnhancedLineInput::wheelEvent(QWheelEvent *ev) { - if (ev->delta() > 0) { + if (ev->angleDelta().y() > 0) { moveInHistory(-1); - } else if (ev->delta() < 0) { + } else if (ev->angleDelta().y() < 0) { moveInHistory(1); } } diff --git a/src/tycommander/session_channel.cc b/src/tycommander/session_channel.cc index 80403d2..bc46f42 100644 --- a/src/tycommander/session_channel.cc +++ b/src/tycommander/session_channel.cc @@ -202,8 +202,11 @@ SessionPeer::SessionPeer(QLocalSocket *socket) QObject::connect(socket, &QLocalSocket::disconnected, this, [=]() { close(RemoteClose); }); - QObject::connect(socket, static_cast(&QLocalSocket::error), - this, [=]() { +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) + QObject::connect(socket, &QLocalSocket::errorOccurred, this, [=]() { +#else + QObject::connect(socket, static_cast(&QLocalSocket::error), this, [=]() { +#endif close(Error); }); }