diff options
author | ConfuSomu | 2023-11-27 20:40:33 -0500 |
---|---|---|
committer | ConfuSomu | 2023-11-27 20:47:55 -0500 |
commit | 00cea51b0b9431b1952cd9f771dc59f7b5de99a0 (patch) | |
tree | 184d92c30a725a3efd10813b95a3ff317cf8e16c | |
parent | f890dd8c22cae9e90d55b763f1d896b25975aeab (diff) | |
download | ActorViewer-00cea51b0b9431b1952cd9f771dc59f7b5de99a0.tar ActorViewer-00cea51b0b9431b1952cd9f771dc59f7b5de99a0.tar.gz ActorViewer-00cea51b0b9431b1952cd9f771dc59f7b5de99a0.zip |
Fix Qt 6 compilation
Compilation would fail due to QtConcurrent changes in Qt 6. See the
following on Qt's website:
https://doc.qt.io/qt-6/concurrent-changes-qt6.html#qtconcurrent-run
-rw-r--r-- | src/mainwindow.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 12a71b8..04182ec 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -252,7 +252,11 @@ void MainWindow::open_file(const QString &filename) { data_archive = Archive::create_archive(ArchiveType::MASTODON, filename); if (not data_archive) return; - QFuture<std::variant<QString, Archive::InitError>> parse_error = QtConcurrent::run(data_archive, &Archive::init); +#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) + QFuture<Archive::InitError> parse_error = QtConcurrent::run(&Archive::init, data_archive); +#else + QFuture<Archive::InitError> parse_error = QtConcurrent::run(data_archive, &Archive::init); +#endif archive_thread_watcher.setFuture(parse_error); } |