Ticket #63983: patch-support-older-qt5.diff

File patch-support-older-qt5.diff, 20.0 KB (added by RJVB (René Bertin), 3 years ago)
  • CMakeLists.txt

    diff --git a/CMakeLists.txt b/CMakeLists.txt
    index 6e290245cb9d4c7b6a208dbe245aab3105f4fd0a..ffaeaf43d6d8da08084dabe9a649827427946537 100644
    a b if(QT6) 
    5050else()
    5151  message(STATUS "Building Qt 5 version")
    5252  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)
    5455endif()
    5556
    5657set(CMAKE_AUTOMOC ON)
  • plugins/qca-gnupg/gpgaction.cpp

    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) 
    3535    if (s.contains(QLatin1Char('T'))) {
    3636        return QDateTime::fromString(s, Qt::ISODate);
    3737    } else {
     38#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
    3839        return QDateTime::fromSecsSinceEpoch(s.toInt());
     40#else
     41        QDateTime dt;
     42        dt.setTime_t(s.toInt());
     43        return dt;
     44#endif
    3945    }
    4046}
    4147
    void GpgAction::processStatusLine(const QString &line) 
    586592    QString s, rest;
    587593    s = nextArg(line, &rest);
    588594
     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
    589601    if (s == QLatin1String("NODATA")) {
    590602        // only set this if it'll make it better
    591603        if (curError == GpgOp::ErrorUnknown)
    void GpgAction::processStatusLine(const QString &line) 
    665677        output.verifyResult = GpgOp::VerifyBad;
    666678    } else if (s == QLatin1String("ERRSIG")) {
    667679        output.wasSigned       = true;
    668         const QStringList list = rest.split(QLatin1Char(' '), Qt::SkipEmptyParts);
     680        const QStringList list = rest.split(QLatin1Char(' '), splitPars);
    669681        output.signerId        = list[0];
    670682        output.timestamp       = getTimestamp(list[4]);
    671683        output.verifyResult    = GpgOp::VerifyNoKey;
    672684    } else if (s == QLatin1String("VALIDSIG")) {
    673         const QStringList list = rest.split(QLatin1Char(' '), Qt::SkipEmptyParts);
     685        const QStringList list = rest.split(QLatin1Char(' '), splitPars);
    674686        output.timestamp       = getTimestamp(list[2]);
    675687    }
    676688}
  • plugins/qca-gnupg/utils.cpp

    diff --git a/plugins/qca-gnupg/utils.cpp b/plugins/qca-gnupg/utils.cpp
    index f4ecffa013e51d505938b9393a8196edff252583..8ee4fc3fb987b3dea78f910ef995c16487b65158 100644
    a b QString find_bin() 
    130130    const QString pathSep = QStringLiteral(":");
    131131#endif
    132132
    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);
    134139
    135140#ifdef Q_OS_MAC
    136141    // On Mac OS bundled always uses system default PATH
  • plugins/qca-logger/qca-logger.cpp

    diff --git a/plugins/qca-logger/qca-logger.cpp b/plugins/qca-logger/qca-logger.cpp
    index a80cc365e268f5d88a8eed988ee8cfc61008a6b6..e77afdf9a4fd3c5160224e8facb422815c872fdd 100644
    a b  
    2525
    2626#include <cstdlib>
    2727
     28#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
     29#   define ENDL Qt::endl
     30#else
     31#   define ENDL endl
     32#endif
     33
    2834using namespace QCA;
    2935
    3036namespace loggerQCAPlugin {
    public: 
    4753
    4854    void logTextMessage(const QString &message, enum QCA::Logger::Severity severity) override
    4955    {
    50         _stream << now() << " " << severityName(severity) << " " << message << Qt::endl;
     56        _stream << now() << " " << severityName(severity) << " " << message << ENDL;
    5157    }
    5258
    5359    void logBinaryMessage(const QByteArray &blob, enum QCA::Logger::Severity severity) override
    5460    {
    5561        Q_UNUSED(blob);
    5662        _stream << now() << " " << severityName(severity) << " "
    57                 << "Binary blob not implemented yet" << Qt::endl;
     63                << "Binary blob not implemented yet" << ENDL;
    5864    }
    5965
    6066private:
  • src/qca_cert.cpp

    diff --git a/src/qca_cert.cpp b/src/qca_cert.cpp
    index 610cd1f1a66c9b793274678786b64f480b48516a..12b4663c1a113865923001d5bc851471c826405c 100644
    a b  
    3232
    3333#include <cstdlib>
    3434
     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
    3541namespace QCA {
    3642
    3743Provider::Context *getContext(const QString &type, const QString &provider);
    static QByteArray ipaddr_str2bin(const QString &str) 
    12501256{
    12511257    // ipv6
    12521258    if (str.contains(QLatin1Char(':'))) {
    1253         const QStringList parts = str.split(QLatin1Char(':'), Qt::KeepEmptyParts);
     1259        const QStringList parts = str.split(QLatin1Char(':'), SPLITPARS);
    12541260        if (parts.count() < 3 || parts.count() > 8)
    12551261            return QByteArray();
    12561262
    static QByteArray ipaddr_str2bin(const QString &str) 
    13071313
    13081314        return ipv6;
    13091315    } else if (str.contains(QLatin1Char('.'))) {
    1310         const QStringList parts = str.split(QLatin1Char('.'), Qt::KeepEmptyParts);
     1316        const QStringList parts = str.split(QLatin1Char('.'), SPLITPARS);
    13111317        if (parts.count() != 4)
    13121318            return QByteArray();
    13131319
    static bool cert_match_domain(const QString &certname, const QString &acedomain) 
    13491355        return false;
    13501356
    13511357    // 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);
    13531359    if (parts_name.isEmpty())
    13541360        return false;
    13551361
    static bool cert_match_domain(const QString &certname, const QString &acedomain) 
    13611367    if (parts_name.count() >= 2 && parts_name[parts_name.count() - 2].contains(QLatin1Char('*')))
    13621368        return false;
    13631369
    1364     const QStringList parts_compare = acedomain.split(QLatin1Char('.'), Qt::KeepEmptyParts);
     1370    const QStringList parts_compare = acedomain.split(QLatin1Char('.'), SPLITPARS);
    13651371    if (parts_compare.isEmpty())
    13661372        return false;
    13671373
  • src/qca_core.cpp

    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) 
    353353
    354354bool isSupported(const char *features, const QString &provider)
    355355{
    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);
    357362}
    358363
    359364QStringList supportedFeatures()
  • tools/qcatool/main.cpp

    diff --git a/tools/qcatool/main.cpp b/tools/qcatool/main.cpp
    index b9ad99742df241d95745d362898b52675a22e3d6..ba009b9832ecf8e862bf89263ffcec5362f59b06 100644
    a b  
    3131#include "import_plugins.h"
    3232#endif
    3333
     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
    3442const char *const APPNAME = "qcatool";
    3543const char *const EXENAME = "qcatool";
    3644const char *const VERSION = QCA_VERSION_STR;
    public: 
    8593
    8694    void logTextMessage(const QString &message, enum QCA::Logger::Severity severity) override
    8795    {
    88         _stream << now() << " " << severityName(severity) << " " << message << Qt::endl;
     96        _stream << now() << " " << severityName(severity) << " " << message << endl;
    8997    }
    9098
    9199    void logBinaryMessage(const QByteArray &blob, enum QCA::Logger::Severity severity) override
    92100    {
    93101        Q_UNUSED(blob);
    94102        _stream << now() << " " << severityName(severity) << " "
    95                 << "Binary blob not implemented yet" << Qt::endl;
     103                << "Binary blob not implemented yet" << endl;
    96104    }
    97105
    98106private:
    static void output_plugin_diagnostic_text() 
    124132    QCA::clearPluginDiagnosticText();
    125133    if (str[str.length() - 1] == QLatin1Char('\n'))
    126134        str.truncate(str.length() - 1);
    127     const QStringList lines = str.split(QLatin1Char('\n'), Qt::KeepEmptyParts);
     135    const QStringList lines = str.split(QLatin1Char('\n'), SPLITPARS);
    128136    for (int n = 0; n < lines.count(); ++n)
    129137        fprintf(stderr, "plugin: %s\n", qPrintable(lines[n]));
    130138}
    static void output_keystore_diagnostic_text() 
    135143    QCA::KeyStoreManager::clearDiagnosticText();
    136144    if (str[str.length() - 1] == QLatin1Char('\n'))
    137145        str.truncate(str.length() - 1);
    138     const QStringList lines = str.split(QLatin1Char('\n'), Qt::KeepEmptyParts);
     146    const QStringList lines = str.split(QLatin1Char('\n'), SPLITPARS);
    139147    for (int n = 0; n < lines.count(); ++n)
    140148        fprintf(stderr, "keystore: %s\n", qPrintable(lines[n]));
    141149}
    static void output_message_diagnostic_text(QCA::SecureMessage *msg) 
    145153    QString str = msg->diagnosticText();
    146154    if (str[str.length() - 1] == QLatin1Char('\n'))
    147155        str.truncate(str.length() - 1);
    148     const QStringList lines = str.split(QLatin1Char('\n'), Qt::KeepEmptyParts);
     156    const QStringList lines = str.split(QLatin1Char('\n'), SPLITPARS);
    149157    for (int n = 0; n < lines.count(); ++n)
    150158        fprintf(stderr, "message: %s\n", qPrintable(lines[n]));
    151159}
  • unittest/bigintunittest/bigintunittest.cpp

    diff --git a/unittest/bigintunittest/bigintunittest.cpp b/unittest/bigintunittest/bigintunittest.cpp
    index a94d15cc4db598d42b6d6d884be9a6186d27e76c..c4b6812034f50e6206d83e3d292df60cf315b5b6 100644
    a b  
    3030#include "import_plugins.h"
    3131#endif
    3232
     33#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
     34#   define ENDL Qt::endl
     35#else
     36#   define ENDL endl
     37#endif
     38
    3339class BigIntUnitTest : public QObject
    3440{
    3541    Q_OBJECT
    void BigIntUnitTest::allTests() 
    8793    // Check if the stream operator is any good
    8894    QString     testString;
    8995    QTextStream ts(&testString, QIODevice::WriteOnly);
    90     ts << a << b << c << Qt::endl;
     96    ts << a << b << c << ENDL;
    9197    QCOMPARE(testString, QStringLiteral("4000000000000-40000000000002000000000000\n"));
    9298
    9399    // Botan's addition tests
  • src/qca_default.cpp

    diff --git a/src/qca_default.cpp b/src/qca_default.cpp
    index 294b90565e50c493da36eb6a5ba998fe2cb48645..5c8b7c3e113f7f2f7cb9151f5b4b8464e388b8f0 100644
    a b public: 
    12501250    {
    12511251        const QDateTime now = QDateTime::currentDateTime();
    12521252
     1253#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
    12531254        uint t = now.toSecsSinceEpoch();
     1255#else
     1256        // implementation from v2.2.1:
     1257        uint t = now.toTime_t();
     1258#endif
    12541259        if (now.time().msec() > 0)
    12551260            t /= now.time().msec();
    12561261        std::srand(t);
  • src/support/logger.cpp

    diff --git a/src/support/logger.cpp b/src/support/logger.cpp
    index cda4ee46b8a83c2a341135320c7ea7437c6eba82..bdd22d008664102a2ea0946563572d141e44aa26 100644
    a b  
    2020
    2121#include "qca_support.h"
    2222
     23#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
     24namespace QtPrivate {
     25template <typename T> struct QAddConst { typedef const T Type; };
     26}
     27
     28// this adds const to non-const objects (like std::as_const)
     29template <typename T>
     30Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
     31// prevent rvalue arguments:
     32template <typename T>
     33void qAsConst(const T &&) Q_DECL_EQ_DELETE;
     34#endif
     35
    2336namespace QCA {
    2437
    2538AbstractLogDevice::AbstractLogDevice(const QString &name, QObject *parent)
  • plugins/qca-botan/qca-botan.cpp

    diff --git a/plugins/qca-botan/qca-botan.cpp b/plugins/qca-botan/qca-botan.cpp
    index e335edbff3c4b620885cb0e8a745c98f84c4de73..51187b9b44fb868098c6d7ca9111cf89277b2e1a 100644
    a b  
    3636#include <cstdlib>
    3737#include <iostream>
    3838
     39#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
     40namespace QtPrivate {
     41template <typename T> struct QAddConst { typedef const T Type; };
     42}
     43
     44// this adds const to non-const objects (like std::as_const)
     45template <typename T>
     46Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
     47// prevent rvalue arguments:
     48template <typename T>
     49void qAsConst(const T &&) Q_DECL_EQ_DELETE;
     50#endif
     51
    3952//-----------------------------------------------------------
    4053class botanRandomContext : public QCA::RandomContext
    4154{
  • plugins/qca-gnupg/gpgproc/gpgproc_p.h

    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: 
    4646                &QProcessSignalRelay::proc_readyReadStandardError,
    4747                Qt::QueuedConnection);
    4848        connect(proc, &QProcess::bytesWritten, this, &QProcessSignalRelay::proc_bytesWritten, Qt::QueuedConnection);
     49#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
    4950        connect(proc,
    5051                QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
    5152                this,
    5253                &QProcessSignalRelay::proc_finished,
    5354                Qt::QueuedConnection);
     55#else
     56        connect(proc, SIGNAL(finished(int)), SLOT(proc_finished(int)), Qt::QueuedConnection);
     57#endif
    5458        connect(proc, &QProcess::errorOccurred, this, &QProcessSignalRelay::proc_error, Qt::QueuedConnection);
    5559    }
    5660
  • plugins/qca-ossl/qca-ossl.cpp

    diff --git a/plugins/qca-ossl/qca-ossl.cpp b/plugins/qca-ossl/qca-ossl.cpp
    index 9c81746844f9d8543f7e9eff8603662f495d7a1e..74c5f49c6754b0350a3367ac90d404e4e756b2b2 100644
    a b public: 
    34743475        BN_free(bn);
    34753476
    34763477        // validity period
     3478#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
    34773479        ASN1_TIME_set(X509_get_notBefore(x), opts.notValidBefore().toSecsSinceEpoch());
    34783480        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
    34793485
    34803486        // public key
    34813487        X509_set_pubkey(x, pk);
    public: 
    38783884        BN_free(bn);
    38793885
    38803886        // validity period
     3887#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
    38813888        ASN1_TIME_set(X509_get_notBefore(x), QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
    38823889        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
    38833894
    38843895        X509_set_pubkey(x, static_cast<const MyPKeyContext *>(req.subjectPublicKey())->get_pkey());
    38853896        X509_set_subject_name(x, subjectName);
  • plugins/qca-pkcs11/qca-pkcs11.cpp

    diff --git a/plugins/qca-pkcs11/qca-pkcs11.cpp b/plugins/qca-pkcs11/qca-pkcs11.cpp
    index ae13bf0a3c34f87614f446ecebd32fa43976e611..3d707d5b1f1d2f1ff0e81dd9b53d48a818263960 100644
    a b private: 
    10481048
    10491049        Certificate cert = Certificate::fromDER(QByteArray((char *)blob, blob_size));
    10501050
     1051#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
    10511052        *expiration = cert.notValidAfter().toSecsSinceEpoch();
    1052 
     1053#else
     1054        *expiration = cert.notValidAfter().toTime_t();
     1055#endif
    10531056        return TRUE; // krazy:exclude=captruefalse
    10541057    }
    10551058
  • examples/saslclient/saslclient.cpp

    diff --git a/examples/saslclient/saslclient.cpp b/examples/saslclient/saslclient.cpp
    index 99db413c63bdbecc185e468e6357458a614c4eed..7e0613d7be8e175a0800c5b1fddb0bb23f1dc62e 100644
    a b public: 
    152152        connect(sock, &QTcpSocket::readyRead, this, &ClientTest::sock_readyRead);
    153153#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
    154154        connect(sock, &QTcpSocket::errorOccurred, this, &ClientTest::sock_error);
    155 #else
     155#elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
    156156        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)));
    157159#endif
    158160
    159161        sasl = new QCA::SASL(this);
  • examples/saslserver/saslserver.cpp

    diff --git a/examples/saslserver/saslserver.cpp b/examples/saslserver/saslserver.cpp
    index 0983dc7e82e8b48769a68a9ff9db3c3721dbd26a..4cb5a8806561e6e4300db8857cee559c89519c92 100644
    a b public: 
    183183        connect(sock, &QTcpSocket::readyRead, this, &ServerTestHandler::sock_readyRead);
    184184#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
    185185        connect(sock, &QTcpSocket::errorOccurred, this, &ServerTestHandler::sock_error);
    186 #else
     186#elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
    187187        connect(sock,
    188188                QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error),
    189189                this,
    190190                &ServerTestHandler::sock_error);
     191#else
     192        connect(sock, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(sock_error(QAbstractSocket::SocketError)));
    191193#endif
    192194        connect(sock, &QTcpSocket::bytesWritten, this, &ServerTestHandler::sock_bytesWritten);
    193195
  • examples/sslservtest/sslservtest.cpp

    diff --git a/examples/sslservtest/sslservtest.cpp b/examples/sslservtest/sslservtest.cpp
    index 4e4cfd4d3b4bd7c877c442cb5a3f0f759c194823..85f203d5dcdfcd25e461b5ce20a1d55f84b71446 100644
    a b private Q_SLOTS: 
    162162        connect(sock, &QTcpSocket::disconnected, this, &SecureServer::sock_disconnected);
    163163#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
    164164        connect(sock, &QTcpSocket::errorOccurred, this, &SecureServer::sock_error);
    165 #else
     165#elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
    166166        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)));
    167169#endif
    168170        connect(sock, &QTcpSocket::bytesWritten, this, &SecureServer::sock_bytesWritten);
    169171
  • examples/ssltest/ssltest.cpp

    diff --git a/examples/ssltest/ssltest.cpp b/examples/ssltest/ssltest.cpp
    index 471bd119e1fcd14aff8a1dc20a0d49ee54df770f..166faf6bbe52a515187f9f3cbc676763e9b28588 100644
    a b public: 
    114114        connect(sock, &QTcpSocket::readyRead, this, &SecureTest::sock_readyRead);
    115115#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
    116116        connect(sock, &QTcpSocket::errorOccurred, this, &SecureTest::sock_error);
    117 #else
     117#elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
    118118        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)));
    119121#endif
    120122
    121123        ssl = new QCA::TLS;
  • examples/tlssocket/tlssocket.cpp

    diff --git a/examples/tlssocket/tlssocket.cpp b/examples/tlssocket/tlssocket.cpp
    index 9264d8939b00ab82765dae4015108c3ee2f3ee94..e711ba4c34097cce5aab57f4134b759657ebff73 100644
    a b public: 
    5050        connect(sock, &QTcpSocket::bytesWritten, this, &TLSSocket::Private::sock_bytesWritten);
    5151#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
    5252        connect(sock, &QTcpSocket::errorOccurred, this, &TLSSocket::Private::sock_error);
    53 #else
     53#elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
    5454        connect(sock,
    5555                QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error),
    5656                this,
    5757                &TLSSocket::Private::sock_error);
     58#else
     59        connect(sock, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(sock_error(QAbstractSocket::SocketError)));
    5860#endif
    5961
    6062        tls = new QCA::TLS(this);