Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. Qt Contribution
  4. How to have my .pro depend on qt.pro ?
QtWS25 Last Chance

How to have my .pro depend on qt.pro ?

Scheduled Pinned Locked Moved Unsolved Qt Contribution
10 Posts 5 Posters 2.1k 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.
  • D Offline
    D Offline
    davecotter
    wrote on 1 Jul 2021, 19:00 last edited by
    #1

    So i've finally been able to build the Qt sources (mac).

    Now i'd like to open the "qt.pro" file (or whatever is appropriate), and have MY project "depend" on it, such that, in Qt Creator, i can edit any Qt code, and then just hit the "start debugging of startup project" button, and it will compile any Qt sources i've edited, stage them into place wherever they need to go, then compile and link my project to them, and launch.

    How do i accomplish this?

    attempting to open "qt.pro" results in a hang of my system, with the "issues" panel becoming overloaded with problems.

    J J 2 Replies Last reply 2 Jul 2021, 04:34
    0
    • D davecotter
      1 Jul 2021, 19:00

      So i've finally been able to build the Qt sources (mac).

      Now i'd like to open the "qt.pro" file (or whatever is appropriate), and have MY project "depend" on it, such that, in Qt Creator, i can edit any Qt code, and then just hit the "start debugging of startup project" button, and it will compile any Qt sources i've edited, stage them into place wherever they need to go, then compile and link my project to them, and launch.

      How do i accomplish this?

      attempting to open "qt.pro" results in a hang of my system, with the "issues" panel becoming overloaded with problems.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 2 Jul 2021, 04:34 last edited by
      #2

      @davecotter There is no need to open qt.pro file to debug into Qt sources. You need to add your Qt sources in QtCreator "Options/Debugger/Source Paths Mapping" -> click on "Add Qt Sources". Then build your app using Qt you built from the sources you added.

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

      1 Reply Last reply
      1
      • D Offline
        D Offline
        davecotter
        wrote on 2 Jul 2021, 05:01 last edited by
        #3

        Thank you, but I have that part already figured out.

        The part that I need to answer this question is how do I edit the source code of the QT frameworks, and then just press the run button and have it all compile and link to my app?

        I want to do this all from within QT creator.

        J 1 Reply Last reply 2 Jul 2021, 05:04
        0
        • D davecotter
          2 Jul 2021, 05:01

          Thank you, but I have that part already figured out.

          The part that I need to answer this question is how do I edit the source code of the QT frameworks, and then just press the run button and have it all compile and link to my app?

          I want to do this all from within QT creator.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 2 Jul 2021, 05:04 last edited by
          #4

          @davecotter said in How to have my .pro depend on qt.pro ?:

          The part that I need to answer this question is how do I edit the source code of the QT frameworks, and then just press the run button and have it all compile and link to my app?

          It does not work that easy. If you want to change Qt code then you need to rebuild the modules you change.
          There is no need to open top qt.pro file. Build only the modules you change.

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

          1 Reply Last reply
          0
          • D Offline
            D Offline
            davecotter
            wrote on 2 Jul 2021, 06:36 last edited by davecotter 7 Feb 2021, 06:37
            #5

            Are you saying that it is impossible to do this within QT creator? If it is possible, then how?

            Say for example that I know that I want to be editing things within the multimedia module. Is there a way to add that into my QT creator project as a dependency?

            J K 2 Replies Last reply 2 Jul 2021, 07:27
            0
            • D davecotter
              2 Jul 2021, 06:36

              Are you saying that it is impossible to do this within QT creator? If it is possible, then how?

              Say for example that I know that I want to be editing things within the multimedia module. Is there a way to add that into my QT creator project as a dependency?

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 2 Jul 2021, 07:27 last edited by
              #6

              @davecotter said in How to have my .pro depend on qt.pro ?:

              Are you saying that it is impossible to do this within QT creator?

              No. I never tried to load top level qt.pro file. It might be simply too much for QtCreator.
              And as I said: there is no need to do so. Open the pro file from the module you want to change.

              "Is there a way to add that into my QT creator project as a dependency?" - yes, the usual way "QT += multimedia multimediawidgets". But I guess it is not what you mean? I don't see what the point of adding the QtMultimedia aproject at source code level (the pro file from the multimedia project) to your project is.
              As I said: build the Qt module you change, that's all.

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

              1 Reply Last reply
              0
              • D davecotter
                1 Jul 2021, 19:00

                So i've finally been able to build the Qt sources (mac).

                Now i'd like to open the "qt.pro" file (or whatever is appropriate), and have MY project "depend" on it, such that, in Qt Creator, i can edit any Qt code, and then just hit the "start debugging of startup project" button, and it will compile any Qt sources i've edited, stage them into place wherever they need to go, then compile and link my project to them, and launch.

                How do i accomplish this?

                attempting to open "qt.pro" results in a hang of my system, with the "issues" panel becoming overloaded with problems.

                J Offline
                J Offline
                JKSH
                Moderators
                wrote on 2 Jul 2021, 08:15 last edited by JKSH 7 Feb 2021, 08:16
                #7

                @davecotter said in How to have my .pro depend on qt.pro ?:

                attempting to open "qt.pro" results in a hang of my system, with the "issues" panel becoming overloaded with problems.

                When Qt Creator loads a .pro file, it expects you to specify one or more existing versions of Qt to use to build that .pro file.

                However, you don't want to use an existing version of Qt to build Qt. That's the core issue.

                Now i'd like to open the "qt.pro" file (or whatever is appropriate), and have MY project "depend" on it, such that, in Qt Creator, i can edit any Qt code, and then just hit the "start debugging of startup project" button, and it will compile any Qt sources i've edited, stage them into place wherever they need to go, then compile and link my project to them, and launch.

                I doubt that's possible. Instead,

                1. Use your console to build Qt from source (you've done this already)
                2. In Qt Creator, set up a new Kit to use your custom build.
                3. In Qt Creator, set up your project to use your custom Kit.

                Now, every time you edit the Qt sources,

                1. Use your console to run make and update the Qt binaries in your custom Kit.
                2. In Qt Creator, hit the "start debugging of startup project" button. This will launch your app, linked to your updated Qt binaries.

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply
                3
                • D davecotter
                  2 Jul 2021, 06:36

                  Are you saying that it is impossible to do this within QT creator? If it is possible, then how?

                  Say for example that I know that I want to be editing things within the multimedia module. Is there a way to add that into my QT creator project as a dependency?

                  K Offline
                  K Offline
                  kshegunov
                  Moderators
                  wrote on 2 Jul 2021, 16:11 last edited by kshegunov 7 Feb 2021, 16:15
                  #8

                  @davecotter said in How to have my .pro depend on qt.pro ?:

                  Are you saying that it is impossible to do this within QT creator? If it is possible, then how?

                  Build Qt on the command line. Open the relevant project(s) from the source tree, but for the love of god don't open the root one it's going to take forever. When you're prompted to configure the project "Import build" from the directory where the Makefile is generated.

                  Note 1: Dependencies for subprojects are not imported, so you need to do that manually from the creator's interface.
                  Note 2: You may need to point creator to the sources if it's an out of source build (e.g. not a -developer-build)

                  For the user project - what @JKSH wrote - configure your kit with the qmake you'd created. It knows the paths to Qt, so it's a breeze. Then you can build it with your own Qt build and if you wish you can make it depend (again from creator's UI) on the module you're hacking into.

                  Read and abide by the Qt Code of Conduct

                  1 Reply Last reply
                  1
                  • D Offline
                    D Offline
                    davecotter
                    wrote on 3 Jul 2021, 20:09 last edited by
                    #9

                    Okay, i've done as everyone suggested, and this is where i am now:

                    so for example, i wish to edit things in the QtMultimedia ... what is it called? package? project? module? Anyway so at the point after i have opened the project "qtmultimedia.pro", it asks to configure the project. so i UN-check the default kit, and then next to "import build from", i click "details" then "choose", and i pick the folder in the build dir called qtmultimedia, the one containing the MakeFile, then click "configure project".

                    configure_proj.png

                    Seems legit. However, there seems to be a couple of problems:

                    First problem: as you can see, doing the above creates a new kit, but suddenly all my kits now have warnings:

                    kits-kits.png

                    Here is the warning:

                    kits-kits-helptext.png

                    It says CMake 3.19 (the one that comes with Qt Creator) is unsupported, that i must upgrade to CMake 3.14. (??!?). I imagine i can PROBABLY ignore this.

                    But it also says that since CMake is unconfigured, that the CMake generator will be ignored. That seems like something I will not be able to get away with. Note i'm using Qt5, not Qt6, so is it true i'm still using Qmake and not CMake? so maybe i CAN ignore this?

                    Second: a problem comes along after I get the multimedia project opened: it seems to have loaded both examples and tests, which i do not care about or want. Does this mean that i should NOT be opening .../Src/qtmultimedia/qtmultimedia.pro and instead should be opening .../Src/qtmultimedia/src/src.pro ? If so, when i attempt to build that within Qt Creator, i get identical errors of "error: library pulseaudio not defined"

                    Third: what's the recommendation about -developer-build ? I understand that regardless of "-prefix" setting, it will build within the Src tree, which is exactly what you do NOT want assuming you're using Git to submit your changes?

                    Fourth: the .pro.user file is created within the Src tree, which is not okay with Git. How do i force Qt Creator to put that somewhere else?

                    Fifth: assuming all the above gets straightened out, when i build in Qt Creator, note i do not do "make install". does that happen automatically? do i need a "post build step" on the "qtmultimedia/src" project to stage that into place for debug builds?

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 6 Jul 2021, 20:10 last edited by
                      #10

                      Hi,

                      @davecotter said in How to have my .pro depend on qt.pro ?:

                      Third: what's the recommendation about -developer-build ? I understand that regardless of "-prefix" setting, it will build within the Src tree, which is exactly what you do NOT want assuming you're using Git to submit your changes?

                      Out of source builds are the key.

                      @davecotter said in How to have my .pro depend on qt.pro ?:

                      Fourth: the .pro.user file is created within the Src tree, which is not okay with Git. How do i force Qt Creator to put that somewhere else?

                      Usually ignored by the .gitignore file.

                      @davecotter said in How to have my .pro depend on qt.pro ?:

                      Fifth: assuming all the above gets straightened out, when i build in Qt Creator, note i do not do "make install". does that happen automatically? do i need a "post build step" on the "qtmultimedia/src" project to stage that into place for debug builds?

                      You need a custom build step indeed.

                      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
                      1

                      1/10

                      1 Jul 2021, 19:00

                      • Login

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