Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved]Using Qt from a Xcode project
Forum Updated to NodeBB v4.3 + New Features

[Solved]Using Qt from a Xcode project

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 28.9k 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.
  • E Offline
    E Offline
    emiguel
    wrote on 15 Aug 2011, 20:12 last edited by
    #1

    Hi People,
    Currently I'm working on the development of a plugin for ProTools (a software for audio processing), which have a couple o Xcode templates to start a new plugin. Since Qt offers tools for GUI development, I would like to include Qt in the Xcode project to develop our user interface.

    Since the original template (for xcode) have a lot of configurations I was thinking that it is easier to import Qt ui source into the current xcode project, but I'm not sure how can I do that.

    I have tested porting new a Qt project to Xcode, and it is working, but the problem is that I wanted to use Qt in a existing Xcode project.

    Have somebody any hint?

    Thanks in advance for your help!

    Miguel

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on 15 Aug 2011, 21:15 last edited by
      #2

      I did not try that myself, but basically it boils down to:

      • add your Qt installation to the list of include paths (something like
      • add the QtXXX frameworks from "/usr/local/Trolltech/Qt-4.7.3/libs" to the list of linked frameworks

      It may be sufficient to add the frameworks, as they contain the headers too.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • E Offline
        E Offline
        emiguel
        wrote on 15 Aug 2011, 22:37 last edited by
        #3

        Hi Volker,
        thanks for your response.
        I added the core and gui frameworks, but the problem is the preprocessing staff, where moc objects are created, etc...
        Since I want to use widgets, i create some clases with the QT_OBJECT macro, but i got errors durinf building because some directives are not directly supported.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on 16 Aug 2011, 13:32 last edited by
          #4

          The xcode template of qmake generates a separate makefile for the moc and uic steps and calls that before the actual run.

          You might look at the output of

          @
          qmake -spec macx-xcode project.pro
          @

          It's in the directory project.xcodeproj, there are two files qt_makeqmake.mak and qt_preprocess.mak in it that handle this stuff.

          You may want to add your own rules though.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • E Offline
            E Offline
            emiguel
            wrote on 16 Aug 2011, 16:57 last edited by
            #5

            Hi Volker,
            I`m going to check that and then I post results or doubts...

            Thanks a lot!

            1 Reply Last reply
            0
            • E Offline
              E Offline
              emiguel
              wrote on 19 Aug 2011, 19:24 last edited by
              #6

              Hi,
              To solve my problem I did the following.
              First I`m going to have a subproject in Qt that mantains the graphical interface, I created this project as a C++ library, so I could include this in the main project.
              The main project is a C++ project in Xcode (which is a plugin template with a lot of configurations).

              Second, I ported the Qt project to Xcode using the spec macx-xcode parameter.

              Third, having both projects in Xcode, I can attatch the library (in Qt) to the main project. To do this, right click in the xcode project and click in the "existing file..." option, select the xcodeproj file from the Qt project. Finally add the library to the linkage phase, this is done by dragging the lib file, wich is under the xcodeproj file, to the "Targets" section in the "Link binary with Libraries".

              Fourth, import the Qt framewoks to the main project, to do that, right click in the main project, click in add a existing framework, select the Qt features used by the project (ex. QtSDK/lib/QtCore.framework)

              And finally, add the header and library paths in the main project. Click in project menu->project settings, set the header search paths option with the Qt headers (ex QtSDK/include//**) and the library search paths (ex QtSDK/lib//**).

              That's all, now I can instantiate my own Qt widgets from the C++ project.

              Note: I have to do an additional step because my target was i386 and the downloaded Qt version were 64 bit, so I downloaded the sources and compiled it for i386.

              Now I have another problems about drawing inner the plugin... but I think that will be for another post.

              Thanks a lot for your help

              1 Reply Last reply
              0
              • D Offline
                D Offline
                ddunham
                wrote on 19 Jan 2012, 23:14 last edited by
                #7

                @qmake -spec macx-xcode@

                creates a project I can open with Xcode 3.2 but not 4.2 (with the latter, it either crashes, or seems to be entirely empty)…

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on 19 Jan 2012, 23:29 last edited by
                  #8

                  There's a known incompatibility between Qt/qmake and XCode 4. Digia (Qt Commercial) has a patch, but as far as I know it didn't make it into 4.8.0. With Qt 4 in open governance, chances are better that is integrated soon.

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SonicTheHedgehog
                    wrote on 10 Jun 2013, 10:30 last edited by
                    #9

                    Hi,
                    I followed the instructions to get a Qt 32 Bit version to work together with the Pro Tools Plugin SDK in Xcode 3. Now I have problems with drawing into the Plugin window, too. I tried to use the QMacNativeWidget class but that does only work with an individual carbon window like in the example code. The special plugin window which is created by Pro Tools has always some buttons on the top and I couldn't create a Qt Widget below or display some text with carbon in it.
                    How did you reach your goal to use Qt in an RTAS Plugin?

                    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