-
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e290245cb9d4c7b6a208dbe245aab3105f4fd0a..ffaeaf43d6d8da08084dabe9a649827427946537 100644
a
|
b
|
if(QT6) |
50 | 50 | else() |
51 | 51 | message(STATUS "Building Qt 5 version") |
52 | 52 | set(Qt5_NO_LINK_QTMAIN ON) |
53 | | find_package(Qt5 5.14 REQUIRED Core) |
| 53 | # Support down to Qt 5.6 (aka OS X 10.7) |
| 54 | find_package(Qt5 5.6 REQUIRED Core) |
54 | 55 | endif() |
55 | 56 | |
56 | 57 | set(CMAKE_AUTOMOC ON) |
-
diff --git a/plugins/qca-gnupg/gpgaction.cpp b/plugins/qca-gnupg/gpgaction.cpp
index c739dd1a7f63c18fe68f256ac91622299460215e..314659dec708a5367a28ac69bec520ec000136e2 100644
a
|
b
|
static QDateTime getTimestamp(const QString &s) |
35 | 35 | if (s.contains(QLatin1Char('T'))) { |
36 | 36 | return QDateTime::fromString(s, Qt::ISODate); |
37 | 37 | } else { |
| 38 | #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) |
38 | 39 | return QDateTime::fromSecsSinceEpoch(s.toInt()); |
| 40 | #else |
| 41 | QDateTime dt; |
| 42 | dt.setTime_t(s.toInt()); |
| 43 | return dt; |
| 44 | #endif |
39 | 45 | } |
40 | 46 | } |
41 | 47 | |
… |
… |
void GpgAction::processStatusLine(const QString &line) |
586 | 592 | QString s, rest; |
587 | 593 | s = nextArg(line, &rest); |
588 | 594 | |
| 595 | #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) |
| 596 | const auto splitPars = Qt::SkipEmptyParts; |
| 597 | #else |
| 598 | const auto splitPars = QString::SkipEmptyParts; |
| 599 | #endif |
| 600 | |
589 | 601 | if (s == QLatin1String("NODATA")) { |
590 | 602 | // only set this if it'll make it better |
591 | 603 | if (curError == GpgOp::ErrorUnknown) |
… |
… |
void GpgAction::processStatusLine(const QString &line) |
665 | 677 | output.verifyResult = GpgOp::VerifyBad; |
666 | 678 | } else if (s == QLatin1String("ERRSIG")) { |
667 | 679 | output.wasSigned = true; |
668 | | const QStringList list = rest.split(QLatin1Char(' '), Qt::SkipEmptyParts); |
| 680 | const QStringList list = rest.split(QLatin1Char(' '), splitPars); |
669 | 681 | output.signerId = list[0]; |
670 | 682 | output.timestamp = getTimestamp(list[4]); |
671 | 683 | output.verifyResult = GpgOp::VerifyNoKey; |
672 | 684 | } else if (s == QLatin1String("VALIDSIG")) { |
673 | | const QStringList list = rest.split(QLatin1Char(' '), Qt::SkipEmptyParts); |
| 685 | const QStringList list = rest.split(QLatin1Char(' '), splitPars); |
674 | 686 | output.timestamp = getTimestamp(list[2]); |
675 | 687 | } |
676 | 688 | } |
-
diff --git a/plugins/qca-gnupg/utils.cpp b/plugins/qca-gnupg/utils.cpp
index f4ecffa013e51d505938b9393a8196edff252583..8ee4fc3fb987b3dea78f910ef995c16487b65158 100644
a
|
b
|
QString find_bin() |
130 | 130 | const QString pathSep = QStringLiteral(":"); |
131 | 131 | #endif |
132 | 132 | |
133 | | QStringList paths = QString::fromLocal8Bit(qgetenv("PATH")).split(pathSep, Qt::SkipEmptyParts); |
| 133 | #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) |
| 134 | const auto splitPars = Qt::SkipEmptyParts; |
| 135 | #else |
| 136 | const auto splitPars = QString::SkipEmptyParts; |
| 137 | #endif |
| 138 | QStringList paths = QString::fromLocal8Bit(qgetenv("PATH")).split(pathSep, splitPars); |
134 | 139 | |
135 | 140 | #ifdef Q_OS_MAC |
136 | 141 | // On Mac OS bundled always uses system default PATH |
-
diff --git a/plugins/qca-logger/qca-logger.cpp b/plugins/qca-logger/qca-logger.cpp
index a80cc365e268f5d88a8eed988ee8cfc61008a6b6..e77afdf9a4fd3c5160224e8facb422815c872fdd 100644
a
|
b
|
|
25 | 25 | |
26 | 26 | #include <cstdlib> |
27 | 27 | |
| 28 | #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) |
| 29 | # define ENDL Qt::endl |
| 30 | #else |
| 31 | # define ENDL endl |
| 32 | #endif |
| 33 | |
28 | 34 | using namespace QCA; |
29 | 35 | |
30 | 36 | namespace loggerQCAPlugin { |
… |
… |
public: |
47 | 53 | |
48 | 54 | void logTextMessage(const QString &message, enum QCA::Logger::Severity severity) override |
49 | 55 | { |
50 | | _stream << now() << " " << severityName(severity) << " " << message << Qt::endl; |
| 56 | _stream << now() << " " << severityName(severity) << " " << message << ENDL; |
51 | 57 | } |
52 | 58 | |
53 | 59 | void logBinaryMessage(const QByteArray &blob, enum QCA::Logger::Severity severity) override |
54 | 60 | { |
55 | 61 | Q_UNUSED(blob); |
56 | 62 | _stream << now() << " " << severityName(severity) << " " |
57 | | << "Binary blob not implemented yet" << Qt::endl; |
| 63 | << "Binary blob not implemented yet" << ENDL; |
58 | 64 | } |
59 | 65 | |
60 | 66 | private: |
-
diff --git a/src/qca_cert.cpp b/src/qca_cert.cpp
index 610cd1f1a66c9b793274678786b64f480b48516a..12b4663c1a113865923001d5bc851471c826405c 100644
a
|
b
|
|
32 | 32 | |
33 | 33 | #include <cstdlib> |
34 | 34 | |
| 35 | #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) |
| 36 | # define SPLITPARS Qt::KeepEmptyParts |
| 37 | #else |
| 38 | # define SPLITPARS QString::KeepEmptyParts |
| 39 | #endif |
| 40 | |
35 | 41 | namespace QCA { |
36 | 42 | |
37 | 43 | Provider::Context *getContext(const QString &type, const QString &provider); |
… |
… |
static QByteArray ipaddr_str2bin(const QString &str) |
1250 | 1256 | { |
1251 | 1257 | // ipv6 |
1252 | 1258 | if (str.contains(QLatin1Char(':'))) { |
1253 | | const QStringList parts = str.split(QLatin1Char(':'), Qt::KeepEmptyParts); |
| 1259 | const QStringList parts = str.split(QLatin1Char(':'), SPLITPARS); |
1254 | 1260 | if (parts.count() < 3 || parts.count() > 8) |
1255 | 1261 | return QByteArray(); |
1256 | 1262 | |
… |
… |
static QByteArray ipaddr_str2bin(const QString &str) |
1307 | 1313 | |
1308 | 1314 | return ipv6; |
1309 | 1315 | } else if (str.contains(QLatin1Char('.'))) { |
1310 | | const QStringList parts = str.split(QLatin1Char('.'), Qt::KeepEmptyParts); |
| 1316 | const QStringList parts = str.split(QLatin1Char('.'), SPLITPARS); |
1311 | 1317 | if (parts.count() != 4) |
1312 | 1318 | return QByteArray(); |
1313 | 1319 | |
… |
… |
static bool cert_match_domain(const QString &certname, const QString &acedomain) |
1349 | 1355 | return false; |
1350 | 1356 | |
1351 | 1357 | // hack into parts, and require at least 1 part |
1352 | | const QStringList parts_name = name.split(QLatin1Char('.'), Qt::KeepEmptyParts); |
| 1358 | const QStringList parts_name = name.split(QLatin1Char('.'), SPLITPARS); |
1353 | 1359 | if (parts_name.isEmpty()) |
1354 | 1360 | return false; |
1355 | 1361 | |
… |
… |
static bool cert_match_domain(const QString &certname, const QString &acedomain) |
1361 | 1367 | if (parts_name.count() >= 2 && parts_name[parts_name.count() - 2].contains(QLatin1Char('*'))) |
1362 | 1368 | return false; |
1363 | 1369 | |
1364 | | const QStringList parts_compare = acedomain.split(QLatin1Char('.'), Qt::KeepEmptyParts); |
| 1370 | const QStringList parts_compare = acedomain.split(QLatin1Char('.'), SPLITPARS); |
1365 | 1371 | if (parts_compare.isEmpty()) |
1366 | 1372 | return false; |
1367 | 1373 | |
-
diff --git a/src/qca_core.cpp b/src/qca_core.cpp
index 19cbff9afcd89b6e99a60f17786a3f9102c63a42..1be2cb895ef6d844b4130a36342743335ec9654c 100644
a
|
b
|
bool isSupported(const QStringList &features, const QString &provider) |
353 | 353 | |
354 | 354 | bool isSupported(const char *features, const QString &provider) |
355 | 355 | { |
356 | | return isSupported(QString::fromLatin1(features).split(QLatin1Char(','), Qt::SkipEmptyParts), provider); |
| 356 | #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) |
| 357 | const auto splitPars = Qt::SkipEmptyParts; |
| 358 | #else |
| 359 | const auto splitPars = QString::SkipEmptyParts; |
| 360 | #endif |
| 361 | return isSupported(QString::fromLatin1(features).split(QLatin1Char(','), splitPars), provider); |
357 | 362 | } |
358 | 363 | |
359 | 364 | QStringList supportedFeatures() |
-
diff --git a/tools/qcatool/main.cpp b/tools/qcatool/main.cpp
index b9ad99742df241d95745d362898b52675a22e3d6..ba009b9832ecf8e862bf89263ffcec5362f59b06 100644
a
|
b
|
|
31 | 31 | #include "import_plugins.h" |
32 | 32 | #endif |
33 | 33 | |
| 34 | #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) |
| 35 | # define ENDL Qt::endl |
| 36 | # define SPLITPARS Qt::KeepEmptyParts |
| 37 | #else |
| 38 | # define ENDL endl |
| 39 | # define SPLITPARS QString::KeepEmptyParts |
| 40 | #endif |
| 41 | |
34 | 42 | const char *const APPNAME = "qcatool"; |
35 | 43 | const char *const EXENAME = "qcatool"; |
36 | 44 | const char *const VERSION = QCA_VERSION_STR; |
… |
… |
public: |
85 | 93 | |
86 | 94 | void logTextMessage(const QString &message, enum QCA::Logger::Severity severity) override |
87 | 95 | { |
88 | | _stream << now() << " " << severityName(severity) << " " << message << Qt::endl; |
| 96 | _stream << now() << " " << severityName(severity) << " " << message << endl; |
89 | 97 | } |
90 | 98 | |
91 | 99 | void logBinaryMessage(const QByteArray &blob, enum QCA::Logger::Severity severity) override |
92 | 100 | { |
93 | 101 | Q_UNUSED(blob); |
94 | 102 | _stream << now() << " " << severityName(severity) << " " |
95 | | << "Binary blob not implemented yet" << Qt::endl; |
| 103 | << "Binary blob not implemented yet" << endl; |
96 | 104 | } |
97 | 105 | |
98 | 106 | private: |
… |
… |
static void output_plugin_diagnostic_text() |
124 | 132 | QCA::clearPluginDiagnosticText(); |
125 | 133 | if (str[str.length() - 1] == QLatin1Char('\n')) |
126 | 134 | str.truncate(str.length() - 1); |
127 | | const QStringList lines = str.split(QLatin1Char('\n'), Qt::KeepEmptyParts); |
| 135 | const QStringList lines = str.split(QLatin1Char('\n'), SPLITPARS); |
128 | 136 | for (int n = 0; n < lines.count(); ++n) |
129 | 137 | fprintf(stderr, "plugin: %s\n", qPrintable(lines[n])); |
130 | 138 | } |
… |
… |
static void output_keystore_diagnostic_text() |
135 | 143 | QCA::KeyStoreManager::clearDiagnosticText(); |
136 | 144 | if (str[str.length() - 1] == QLatin1Char('\n')) |
137 | 145 | str.truncate(str.length() - 1); |
138 | | const QStringList lines = str.split(QLatin1Char('\n'), Qt::KeepEmptyParts); |
| 146 | const QStringList lines = str.split(QLatin1Char('\n'), SPLITPARS); |
139 | 147 | for (int n = 0; n < lines.count(); ++n) |
140 | 148 | fprintf(stderr, "keystore: %s\n", qPrintable(lines[n])); |
141 | 149 | } |
… |
… |
static void output_message_diagnostic_text(QCA::SecureMessage *msg) |
145 | 153 | QString str = msg->diagnosticText(); |
146 | 154 | if (str[str.length() - 1] == QLatin1Char('\n')) |
147 | 155 | str.truncate(str.length() - 1); |
148 | | const QStringList lines = str.split(QLatin1Char('\n'), Qt::KeepEmptyParts); |
| 156 | const QStringList lines = str.split(QLatin1Char('\n'), SPLITPARS); |
149 | 157 | for (int n = 0; n < lines.count(); ++n) |
150 | 158 | fprintf(stderr, "message: %s\n", qPrintable(lines[n])); |
151 | 159 | } |
-
diff --git a/unittest/bigintunittest/bigintunittest.cpp b/unittest/bigintunittest/bigintunittest.cpp
index a94d15cc4db598d42b6d6d884be9a6186d27e76c..c4b6812034f50e6206d83e3d292df60cf315b5b6 100644
a
|
b
|
|
30 | 30 | #include "import_plugins.h" |
31 | 31 | #endif |
32 | 32 | |
| 33 | #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) |
| 34 | # define ENDL Qt::endl |
| 35 | #else |
| 36 | # define ENDL endl |
| 37 | #endif |
| 38 | |
33 | 39 | class BigIntUnitTest : public QObject |
34 | 40 | { |
35 | 41 | Q_OBJECT |
… |
… |
void BigIntUnitTest::allTests() |
87 | 93 | // Check if the stream operator is any good |
88 | 94 | QString testString; |
89 | 95 | QTextStream ts(&testString, QIODevice::WriteOnly); |
90 | | ts << a << b << c << Qt::endl; |
| 96 | ts << a << b << c << ENDL; |
91 | 97 | QCOMPARE(testString, QStringLiteral("4000000000000-40000000000002000000000000\n")); |
92 | 98 | |
93 | 99 | // Botan's addition tests |
-
diff --git a/src/qca_default.cpp b/src/qca_default.cpp
index 294b90565e50c493da36eb6a5ba998fe2cb48645..5c8b7c3e113f7f2f7cb9151f5b4b8464e388b8f0 100644
a
|
b
|
public: |
1250 | 1250 | { |
1251 | 1251 | const QDateTime now = QDateTime::currentDateTime(); |
1252 | 1252 | |
| 1253 | #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) |
1253 | 1254 | uint t = now.toSecsSinceEpoch(); |
| 1255 | #else |
| 1256 | // implementation from v2.2.1: |
| 1257 | uint t = now.toTime_t(); |
| 1258 | #endif |
1254 | 1259 | if (now.time().msec() > 0) |
1255 | 1260 | t /= now.time().msec(); |
1256 | 1261 | std::srand(t); |
-
diff --git a/src/support/logger.cpp b/src/support/logger.cpp
index cda4ee46b8a83c2a341135320c7ea7437c6eba82..bdd22d008664102a2ea0946563572d141e44aa26 100644
a
|
b
|
|
20 | 20 | |
21 | 21 | #include "qca_support.h" |
22 | 22 | |
| 23 | #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) |
| 24 | namespace QtPrivate { |
| 25 | template <typename T> struct QAddConst { typedef const T Type; }; |
| 26 | } |
| 27 | |
| 28 | // this adds const to non-const objects (like std::as_const) |
| 29 | template <typename T> |
| 30 | Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; } |
| 31 | // prevent rvalue arguments: |
| 32 | template <typename T> |
| 33 | void qAsConst(const T &&) Q_DECL_EQ_DELETE; |
| 34 | #endif |
| 35 | |
23 | 36 | namespace QCA { |
24 | 37 | |
25 | 38 | AbstractLogDevice::AbstractLogDevice(const QString &name, QObject *parent) |
-
diff --git a/plugins/qca-botan/qca-botan.cpp b/plugins/qca-botan/qca-botan.cpp
index e335edbff3c4b620885cb0e8a745c98f84c4de73..51187b9b44fb868098c6d7ca9111cf89277b2e1a 100644
a
|
b
|
|
36 | 36 | #include <cstdlib> |
37 | 37 | #include <iostream> |
38 | 38 | |
| 39 | #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) |
| 40 | namespace QtPrivate { |
| 41 | template <typename T> struct QAddConst { typedef const T Type; }; |
| 42 | } |
| 43 | |
| 44 | // this adds const to non-const objects (like std::as_const) |
| 45 | template <typename T> |
| 46 | Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; } |
| 47 | // prevent rvalue arguments: |
| 48 | template <typename T> |
| 49 | void qAsConst(const T &&) Q_DECL_EQ_DELETE; |
| 50 | #endif |
| 51 | |
39 | 52 | //----------------------------------------------------------- |
40 | 53 | class botanRandomContext : public QCA::RandomContext |
41 | 54 | { |
-
diff --git a/plugins/qca-gnupg/gpgproc/gpgproc_p.h b/plugins/qca-gnupg/gpgproc/gpgproc_p.h
index 7c21f251b49b7bdcd141f62608501dcc502d93ff..73ab82aa76e78f037ea928fb38f3a9c9e674a42b 100644
a
|
b
|
public: |
46 | 46 | &QProcessSignalRelay::proc_readyReadStandardError, |
47 | 47 | Qt::QueuedConnection); |
48 | 48 | connect(proc, &QProcess::bytesWritten, this, &QProcessSignalRelay::proc_bytesWritten, Qt::QueuedConnection); |
| 49 | #if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) |
49 | 50 | connect(proc, |
50 | 51 | QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), |
51 | 52 | this, |
52 | 53 | &QProcessSignalRelay::proc_finished, |
53 | 54 | Qt::QueuedConnection); |
| 55 | #else |
| 56 | connect(proc, SIGNAL(finished(int)), SLOT(proc_finished(int)), Qt::QueuedConnection); |
| 57 | #endif |
54 | 58 | connect(proc, &QProcess::errorOccurred, this, &QProcessSignalRelay::proc_error, Qt::QueuedConnection); |
55 | 59 | } |
56 | 60 | |
-
diff --git a/plugins/qca-ossl/qca-ossl.cpp b/plugins/qca-ossl/qca-ossl.cpp
index 9c81746844f9d8543f7e9eff8603662f495d7a1e..74c5f49c6754b0350a3367ac90d404e4e756b2b2 100644
a
|
b
|
public: |
3474 | 3475 | BN_free(bn); |
3475 | 3476 | |
3476 | 3477 | // validity period |
| 3478 | #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) |
3477 | 3479 | ASN1_TIME_set(X509_get_notBefore(x), opts.notValidBefore().toSecsSinceEpoch()); |
3478 | 3480 | ASN1_TIME_set(X509_get_notAfter(x), opts.notValidAfter().toSecsSinceEpoch()); |
| 3481 | ##else |
| 3482 | ASN1_TIME_set(X509_get_notBefore(x), opts.notValidBefore().toTime_t()); |
| 3483 | ASN1_TIME_set(X509_get_notAfter(x), opts.notValidAfter().toTime_t()); |
| 3484 | #endif |
3479 | 3485 | |
3480 | 3486 | // public key |
3481 | 3487 | X509_set_pubkey(x, pk); |
… |
… |
public: |
3878 | 3884 | BN_free(bn); |
3879 | 3885 | |
3880 | 3886 | // validity period |
| 3887 | #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) |
3881 | 3888 | ASN1_TIME_set(X509_get_notBefore(x), QDateTime::currentDateTimeUtc().toSecsSinceEpoch()); |
3882 | 3889 | ASN1_TIME_set(X509_get_notAfter(x), notValidAfter.toSecsSinceEpoch()); |
| 3890 | #else |
| 3891 | ASN1_TIME_set(X509_get_notBefore(x), QDateTime::currentDateTimeUtc().toTime_t()); |
| 3892 | ASN1_TIME_set(X509_get_notAfter(x), notValidAfter.toTime_t()); |
| 3893 | #endif |
3883 | 3894 | |
3884 | 3895 | X509_set_pubkey(x, static_cast<const MyPKeyContext *>(req.subjectPublicKey())->get_pkey()); |
3885 | 3896 | X509_set_subject_name(x, subjectName); |
-
diff --git a/plugins/qca-pkcs11/qca-pkcs11.cpp b/plugins/qca-pkcs11/qca-pkcs11.cpp
index ae13bf0a3c34f87614f446ecebd32fa43976e611..3d707d5b1f1d2f1ff0e81dd9b53d48a818263960 100644
a
|
b
|
private: |
1048 | 1048 | |
1049 | 1049 | Certificate cert = Certificate::fromDER(QByteArray((char *)blob, blob_size)); |
1050 | 1050 | |
| 1051 | #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) |
1051 | 1052 | *expiration = cert.notValidAfter().toSecsSinceEpoch(); |
1052 | | |
| 1053 | #else |
| 1054 | *expiration = cert.notValidAfter().toTime_t(); |
| 1055 | #endif |
1053 | 1056 | return TRUE; // krazy:exclude=captruefalse |
1054 | 1057 | } |
1055 | 1058 | |
-
diff --git a/examples/saslclient/saslclient.cpp b/examples/saslclient/saslclient.cpp
index 99db413c63bdbecc185e468e6357458a614c4eed..7e0613d7be8e175a0800c5b1fddb0bb23f1dc62e 100644
a
|
b
|
public: |
152 | 152 | connect(sock, &QTcpSocket::readyRead, this, &ClientTest::sock_readyRead); |
153 | 153 | #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) |
154 | 154 | connect(sock, &QTcpSocket::errorOccurred, this, &ClientTest::sock_error); |
155 | | #else |
| 155 | #elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) |
156 | 156 | connect(sock, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), this, &ClientTest::sock_error); |
| 157 | #else |
| 158 | connect(sock, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(sock_error(QAbstractSocket::SocketError))); |
157 | 159 | #endif |
158 | 160 | |
159 | 161 | sasl = new QCA::SASL(this); |
-
diff --git a/examples/saslserver/saslserver.cpp b/examples/saslserver/saslserver.cpp
index 0983dc7e82e8b48769a68a9ff9db3c3721dbd26a..4cb5a8806561e6e4300db8857cee559c89519c92 100644
a
|
b
|
public: |
183 | 183 | connect(sock, &QTcpSocket::readyRead, this, &ServerTestHandler::sock_readyRead); |
184 | 184 | #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) |
185 | 185 | connect(sock, &QTcpSocket::errorOccurred, this, &ServerTestHandler::sock_error); |
186 | | #else |
| 186 | #elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) |
187 | 187 | connect(sock, |
188 | 188 | QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), |
189 | 189 | this, |
190 | 190 | &ServerTestHandler::sock_error); |
| 191 | #else |
| 192 | connect(sock, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(sock_error(QAbstractSocket::SocketError))); |
191 | 193 | #endif |
192 | 194 | connect(sock, &QTcpSocket::bytesWritten, this, &ServerTestHandler::sock_bytesWritten); |
193 | 195 | |
-
diff --git a/examples/sslservtest/sslservtest.cpp b/examples/sslservtest/sslservtest.cpp
index 4e4cfd4d3b4bd7c877c442cb5a3f0f759c194823..85f203d5dcdfcd25e461b5ce20a1d55f84b71446 100644
a
|
b
|
private Q_SLOTS: |
162 | 162 | connect(sock, &QTcpSocket::disconnected, this, &SecureServer::sock_disconnected); |
163 | 163 | #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) |
164 | 164 | connect(sock, &QTcpSocket::errorOccurred, this, &SecureServer::sock_error); |
165 | | #else |
| 165 | #elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) |
166 | 166 | connect(sock, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), this, &SecureServer::sock_error); |
| 167 | #else |
| 168 | connect(sock, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(sock_error(QAbstractSocket::SocketError))); |
167 | 169 | #endif |
168 | 170 | connect(sock, &QTcpSocket::bytesWritten, this, &SecureServer::sock_bytesWritten); |
169 | 171 | |
-
diff --git a/examples/ssltest/ssltest.cpp b/examples/ssltest/ssltest.cpp
index 471bd119e1fcd14aff8a1dc20a0d49ee54df770f..166faf6bbe52a515187f9f3cbc676763e9b28588 100644
a
|
b
|
public: |
114 | 114 | connect(sock, &QTcpSocket::readyRead, this, &SecureTest::sock_readyRead); |
115 | 115 | #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) |
116 | 116 | connect(sock, &QTcpSocket::errorOccurred, this, &SecureTest::sock_error); |
117 | | #else |
| 117 | #elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) |
118 | 118 | connect(sock, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), this, &SecureTest::sock_error); |
| 119 | #else |
| 120 | connect(sock, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(sock_error(QAbstractSocket::SocketError))); |
119 | 121 | #endif |
120 | 122 | |
121 | 123 | ssl = new QCA::TLS; |
-
diff --git a/examples/tlssocket/tlssocket.cpp b/examples/tlssocket/tlssocket.cpp
index 9264d8939b00ab82765dae4015108c3ee2f3ee94..e711ba4c34097cce5aab57f4134b759657ebff73 100644
a
|
b
|
public: |
50 | 50 | connect(sock, &QTcpSocket::bytesWritten, this, &TLSSocket::Private::sock_bytesWritten); |
51 | 51 | #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) |
52 | 52 | connect(sock, &QTcpSocket::errorOccurred, this, &TLSSocket::Private::sock_error); |
53 | | #else |
| 53 | #elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) |
54 | 54 | connect(sock, |
55 | 55 | QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), |
56 | 56 | this, |
57 | 57 | &TLSSocket::Private::sock_error); |
| 58 | #else |
| 59 | connect(sock, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(sock_error(QAbstractSocket::SocketError))); |
58 | 60 | #endif |
59 | 61 | |
60 | 62 | tls = new QCA::TLS(this); |