fix: fix slots for Qt 6

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu
2022-05-16 20:34:07 +02:00
parent c363423718
commit 15c5bbcf22
18 changed files with 71 additions and 62 deletions

View File

@ -129,10 +129,13 @@ void PasteUpload::executeTask()
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
connect(rep, &QNetworkReply::finished, this, &PasteUpload::downloadFinished);
// This function call would be a lot shorter if we were using the latest Qt
connect(rep,
static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error),
this, &PasteUpload::downloadError);
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(rep, &QNetworkReply::errorOccurred, this, &PasteUpload::downloadError);
#else
connect(rep, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error), this, &PasteUpload::downloadError);
#endif
m_reply = std::shared_ptr<QNetworkReply>(rep);