QtFuture not found
-
according to docs, I only need to add following in my cmake file:-
find_package(Qt6 COMPONENTS Core REQUIRED) target_link_libraries(mytarget PRIVATE Qt6::Core)
to include QtFuture. But i'm getting compiltation error
/home/fire/untitled1/main.cpp:3: error: QtFuture: No such file or directory /home/fire/untitled1/main.cpp:3:10: fatal error: QtFuture: No such file or directory 3 | #include <QtFuture> | ^~~~~~~~~~
here is my complete cmake file:-
cmake_minimum_required(VERSION 3.15) project(untitled1 LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt6 COMPONENTS Core Quick REQUIRED) set(PROJECT_SOURCES main.cpp qml.qrc ) qt_add_executable(untitled1 ${PROJECT_SOURCES}) target_link_libraries(untitled1 PRIVATE Qt6::Core Qt6::Quick)
I have installed qt6 from pacman from manjaro repositories
-
-
@noone said in QtFuture not found:
QtFuture
There is and was no such include in Qt. You most likley want to include
QFuture
-
@noone said in QtFuture not found:
QtFuture
There is and was no such include in Qt. You most likley want to include
QFuture
@Christian-Ehrlicher
I thought that too. But the OP gave this link: https://doc-snapshots.qt.io/qt6-dev/qtfuture.html#connectAnd at the top of that page it has:
QtFuture Namespace
Header: #include <QtFuture>
Contains miscellaneous identifiers used by the
QFuture
classAnd a lot of the methods there say
This function was introduced in Qt 6.1.
so I think it's from the future ;-)
So what's that about? :)
-
@JonB said in QtFuture not found:
So what's that about? :)
When the OP is using qt6.dev then all is fine, yeshttps://doc.qt.io/qt-6/qfuture.htmlOk, the link is also valid for Qt6. Looks like a doc error.
-
@JonB said in QtFuture not found:
So what's that about? :)
When the OP is using qt6.dev then all is fine, yeshttps://doc.qt.io/qt-6/qfuture.htmlOk, the link is also valid for Qt6. Looks like a doc error.
@Christian-Ehrlicher
Thanks. I have no idea whether he is or isn't, I just looked at the link, I don't know where he got it from :) -
Ok here the bug report: https://bugreports.qt.io/browse/QTBUG-89766
-
@Christian-Ehrlicher
Thanks. I have no idea whether he is or isn't, I just looked at the link, I don't know where he got it from :)@JonB said in QtFuture not found:
I don't know where he got it from :)
I read it hear https://www.qt.io/blog/asynchronous-apis-in-qt-6 then searched qtfuture in docs
-
Ok here the bug report: https://bugreports.qt.io/browse/QTBUG-89766
@Christian-Ehrlicher said in QtFuture not found:
Ok here the bug report: https://bugreports.qt.io/browse/QTBUG-89766
i want to convert signal into QFuture as told in docs. if this is doc error do you know how can I do it ? workaround ?
-