QT application development in Xcode?

My IDE for Mac (at least for C ++ and Objective-C development) is Xcode. I have a 64-bit Intel Mac with OS X Lion, and Xcode version 4.2 is downloaded from the Mac App Store.
My problem is that Qt is apparently not compatible with Xcode 4 (it crashes when starting qmake generated projects), so I basically ask how I can integrate Qt with Xcode. I do not need to run and debug the project from Xcode, just create it.
So I thought it might be a solution to use qmake as an external build system in Xcode, the problem is that I have no idea how to configure qmake as my build system so that I can develop my Qt applications in Xcode 4. <br / "> Please help me! :)

+8
c ++ qt xcode qmake
source share
2 answers

Google shows many pages, but this Qt4 page with Xcode appeared at first glance as a pretty final resource. However, the last time it was changed in 2006.

Please check: http://qt-project.org/doc/qt-5/macosx.html

There is a much later post from the Qt Developer Forum , which seems to contain good information. In particular, this answer of August 19, 2011 gives a complete recipe.


05/25/2016 update:

The first two links are now dead and not archived due to robots.txt .

However, I updated the link to the forum post.

And here is a copy of the answer to emiguel. Now 5 years old, so I do not know how much he is still.

Hi,

To solve my problem, I did the following.

First I will have a subproject in Qt that supports a 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 many configurations).

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

Thirdly, having both projects in Xcode, I can add a library (in Qt) to the main project. To do this, right-click in the xcode project and select the option "existing file ...", select the xcodeproj file from the Qt project. Finally, add the library to the binding phase, this is done by dragging and dropping the lib file located under the xcodeproj file into the "Goals" section of "Linking to Libraries".

Fourth, import Qt framewoks into the main project, do it, right-click in the main project, click add existing structure, select the Qt functions used by the project (for example, QtSDK / lib / QtCore.framework)

Finally, add the header and library paths to the main project. Click on the project menu-> project parameters, set the parameter for the search path for the header with the headers Qt (ex QtSDK / include //) and the library search path (ex QtSDK / lib // **).

That's all, now I can create an instance of my own Qt widgets from a C ++ project.

Note. I need to take an extra step because my goal is i386 and the downloaded version of Qt is 64 bits, so I downloaded the sources and compiled them for i386.

Now I have other problems with drawing the internal plugin ... but I think it will be for another post.

Many thanks for your help

Finally, the current information on building Qt in Xcode is available in Qt for OS X - it is too long to copy here, and Qt will be supported and updated ...

+7
source share

I think this link can answer your question or provide good information for those who are looking for an answer to this question:

http://qt-project.org/doc/qtcreator-3.0/creator-developing-ios.html

0
source share

All Articles