Use qOverload in Qt signal/slots.

This commit is contained in:
Andrius Štikonas 2017-10-09 13:39:34 +01:00
parent 2760f02fbf
commit 9f3b2b8fd4
2 changed files with 5 additions and 1 deletions

View File

@ -29,6 +29,9 @@ set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE})
set(SOVERSION "6")
add_definitions(-D'VERSION="${VERSION}"') #"
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(ECM 1.0.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")

View File

@ -20,6 +20,7 @@
#include "util/report.h"
#include <QtGlobal>
#include <QString>
#include <QStringList>
@ -61,7 +62,7 @@ void ExternalCommand::setup(const QProcess::ProcessChannelMode processChannelMod
setEnvironment(QStringList() << QStringLiteral("LC_ALL=C") << QStringLiteral("PATH=") + QString::fromUtf8(getenv("PATH")) << QStringLiteral("LVM_SUPPRESS_FD_WARNINGS=1"));
setProcessChannelMode(processChannelMode);
connect(this, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, &ExternalCommand::onFinished);
connect(this, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), this, &ExternalCommand::onFinished);
connect(this, &ExternalCommand::readyReadStandardOutput, this, &ExternalCommand::onReadOutput);
}