Commit 5c95ab20 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some compile error against qt6

parent 812b333f
Pipeline #154568 passed with stage
in 1 minute and 28 seconds
......@@ -57,12 +57,13 @@ private:
int main(int argc, char **argv)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
/**
* enable high dpi support
*/
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
#endif
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); // Required for the webengine part.
QApplication application(argc, argv);
......
......@@ -821,7 +821,11 @@ bool CliInterface::handleLine(const QString& line)
//read the percentage
int pos = line.indexOf(QLatin1Char( '%' ));
if (pos > 1) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
int percentage = line.midRef(pos - 2, 2).toInt();
#else
int percentage = QStringView(line).mid(pos - 2, 2).toInt();
#endif
Q_EMIT progress(float(percentage) / 100);
return true;
}
......
......@@ -115,8 +115,11 @@ void PropertiesDialog::showChecksum(QCryptographicHash::Algorithm algorithm, con
label->setText(futureWatcher->result());
futureWatcher->deleteLater();
});
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
auto future = QtConcurrent::run(this, &PropertiesDialog::calcHash, algorithm, fileName);
#else
auto future = QtConcurrent::run(&PropertiesDialog::calcHash, this, algorithm, fileName);
#endif
futureWatcher->setFuture(future);
}
......
......@@ -14,7 +14,12 @@
QT_BEGIN_NAMESPACE
template <typename, typename> class QStringBuilder;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template <typename> class QVector;
#else
template<typename>
class QList;
#endif
QT_END_NAMESPACE
......@@ -143,7 +148,9 @@ namespace Tok {
template <> struct ViewForImpl<QLatin1String> { using type = QLatin1String; };
template <> struct ViewForImpl<QChar> { using type = QChar; };
template <> struct ViewForImpl<QString> : ViewForImpl<QStringView> {};
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template <> struct ViewForImpl<QStringRef> : ViewForImpl<QStringView> {};
#endif
template <> struct ViewForImpl<QLatin1Char> : ViewForImpl<QChar> {};
template <> struct ViewForImpl<char16_t> : ViewForImpl<QChar> {};
template <> struct ViewForImpl<char16_t*> : ViewForImpl<QStringView> {};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment