Skip to content

Commit

Permalink
Fix a bunch of minor Qt deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
Koromix committed Nov 2, 2021
1 parent 7caa60f commit 2098ce9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/tycommander/arduino_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#endif
#include <QCoreApplication>
#include <QFileDialog>
#include <QSysInfo>
#include <QOperatingSystemVersion>
#include <QWinEventNotifier>

#include "arduino_dialog.hpp"
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/tycommander/enhanced_widgets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/tycommander/session_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,11 @@ SessionPeer::SessionPeer(QLocalSocket *socket)
QObject::connect(socket, &QLocalSocket::disconnected, this, [=]() {
close(RemoteClose);
});
QObject::connect(socket, static_cast<void(QLocalSocket::*)(QLocalSocket::LocalSocketError)>(&QLocalSocket::error),
this, [=]() {
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
QObject::connect(socket, &QLocalSocket::errorOccurred, this, [=]() {
#else
QObject::connect(socket, static_cast<void(QLocalSocket::*)(QLocalSocket::LocalSocketError)>(&QLocalSocket::error), this, [=]() {
#endif
close(Error);
});
}
Expand Down

0 comments on commit 2098ce9

Please sign in to comment.