Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to use Qt libraries in a non-Qt project
Forum Updated to NodeBB v4.3 + New Features

How to use Qt libraries in a non-Qt project

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
9 Posts 4 Posters 1.2k Views 1 Watching
  • 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.
  • W Offline
    W Offline
    wasawi2
    wrote on last edited by
    #1

    Dear all,

    I have a C++ project in QtCreator that uses a qbs file to setup all libraries included in the project. The project works well as it is.
    I am working on MacOS Ventura and I would like to use Qt widgets and Qt windowing system as an interface but I don't know how to link Qt headers and frameworks to the project.

    Could anyone provide any hints?

    Thank you very much,
    w

    Christian EhrlicherC 1 Reply Last reply
    0
    • W wasawi2

      Dear all,

      I have a C++ project in QtCreator that uses a qbs file to setup all libraries included in the project. The project works well as it is.
      I am working on MacOS Ventura and I would like to use Qt widgets and Qt windowing system as an interface but I don't know how to link Qt headers and frameworks to the project.

      Could anyone provide any hints?

      Thank you very much,
      w

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @wasawi2 said in How to use Qt libraries in a non-Qt project:

      Could anyone provide any hints?

      Use a proper build system like qbs, qmake or cmake and let those apps do the work for you finding and linking the correct libs.

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

      jsulmJ 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        @wasawi2 said in How to use Qt libraries in a non-Qt project:

        Could anyone provide any hints?

        Use a proper build system like qbs, qmake or cmake and let those apps do the work for you finding and linking the correct libs.

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @Christian-Ehrlicher "I have a C++ project in QtCreator that uses a qbs"

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        Christian EhrlicherC 1 Reply Last reply
        0
        • jsulmJ jsulm

          @Christian-Ehrlicher "I have a C++ project in QtCreator that uses a qbs"

          Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @jsulm So where is the problem then?

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

          jsulmJ 1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            @jsulm So where is the problem then?

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Christian-Ehrlicher How to add Qt libs to the project (I never used QBS, so don't have an answer).

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              Did you already went through the Qbs introduction ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              W 1 Reply Last reply
              0
              • SGaistS SGaist

                Hi,

                Did you already went through the Qbs introduction ?

                W Offline
                W Offline
                wasawi2
                wrote on last edited by
                #7

                @SGaist thank you very much for the suggestion.

                I had a look at it but it seems to have an overwhelming amount of information.
                It would be great if someone could give a bit of guidance. My guess is that including Qt libraries must be a matter of 5 to 10 lines of QBS code, am I right?

                If anyone can give a little help it would be very much appreciated.

                Thank you,
                w

                SGaistS 1 Reply Last reply
                0
                • W wasawi2

                  @SGaist thank you very much for the suggestion.

                  I had a look at it but it seems to have an overwhelming amount of information.
                  It would be great if someone could give a bit of guidance. My guess is that including Qt libraries must be a matter of 5 to 10 lines of QBS code, am I right?

                  If anyone can give a little help it would be very much appreciated.

                  Thank you,
                  w

                  SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @wasawi2 did you try the minimal hello world hinted on that page linked ?

                  Application {
                      name: "helloworld"
                      files: ["main.cpp"]
                      Depends { name: "Qt.core" }
                      Depends { name: "cpp" }
                      cpp.optimization: "ludicrousSpeed"
                  }
                  

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • W Offline
                    W Offline
                    wasawi2
                    wrote on last edited by
                    #9

                    thank you,
                    At the end It was just including these few lines what made the trick.
                    I don't understand at all how QtCreator finds the header files and frameworks but it seems to work out.

                    Thanks again,
                    w

                            Depends { name: "Qt.core" }
                            Depends { name: "Qt.widgets" }
                            Depends { name: "Qt.gui" }
                            Depends { name: "Qt.opengl" }
                    
                    
                    1 Reply Last reply
                    0

                    • Login

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