Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. QtFuture not found
Forum Updated to NodeBB v4.3 + New Features

QtFuture not found

Scheduled Pinned Locked Moved Solved Qt 6
cmakeqt6qtfuture
9 Posts 3 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • nooneN Offline
    nooneN Offline
    noone
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #9

      @noone said in QtFuture not found:

      workaround ?

      #include <QFuture>

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @noone said in QtFuture not found:

        QtFuture

        There is and was no such include in Qt. You most likley want to include QFuture

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        JonBJ 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @noone said in QtFuture not found:

          QtFuture

          There is and was no such include in Qt. You most likley want to include QFuture

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #3

          @Christian-Ehrlicher
          I thought that too. But the OP gave this link: https://doc-snapshots.qt.io/qt6-dev/qtfuture.html#connect

          And at the top of that page it has:

          QtFuture Namespace

          Header: #include <QtFuture>

          Contains miscellaneous identifiers used by the QFuture class

          And 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? :)

          1 Reply Last reply
          1
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by Christian Ehrlicher
            #4

            @JonB said in QtFuture not found:

            So what's that about? :)

            When the OP is using qt6.dev then all is fine, yes

            https://doc.qt.io/qt-6/qfuture.html

            Ok, the link is also valid for Qt6. Looks like a doc error.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            JonBJ 1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @JonB said in QtFuture not found:

              So what's that about? :)

              When the OP is using qt6.dev then all is fine, yes

              https://doc.qt.io/qt-6/qfuture.html

              Ok, the link is also valid for Qt6. Looks like a doc error.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #5

              @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 :)

              nooneN 1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #6

                Ok here the bug report: https://bugreports.qt.io/browse/QTBUG-89766

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                nooneN 1 Reply Last reply
                5
                • JonBJ JonB

                  @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 :)

                  nooneN Offline
                  nooneN Offline
                  noone
                  wrote on last edited by
                  #7

                  @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

                  1 Reply Last reply
                  0
                  • Christian EhrlicherC Christian Ehrlicher

                    Ok here the bug report: https://bugreports.qt.io/browse/QTBUG-89766

                    nooneN Offline
                    nooneN Offline
                    noone
                    wrote on last edited by
                    #8

                    @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 ?

                    1 Reply Last reply
                    0
                    • Christian EhrlicherC Offline
                      Christian EhrlicherC Offline
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on last edited by
                      #9

                      @noone said in QtFuture not found:

                      workaround ?

                      #include <QFuture>

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      1 Reply Last reply
                      2

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved