简体   繁体   English

如何在qt中调试xcode项目?

[英]How to debug xcode project in qt?

I want to embed some UI written using Qt and QML via QMacNativeWidget.我想通过 QMacNativeWidget 嵌入一些使用 Qt 和 QML 编写的 UI。 And I want to debug QML using Qt Creator, cause I can't debug QML with XCode.我想使用 Qt Creator 调试 QML,因为我无法使用 XCode 调试 QML。 Do you know if it's possible?你知道这可能吗?

You can debug Qt/QML in Xcode since it's essentially just a regular C/C++ project.可以在 Xcode 中调试 Qt/QML,因为它本质上只是一个常规的 C/C++ 项目。 The only thing you need is a proper Xcode project ( .xcodeproj ).您唯一需要的是一个合适的 Xcode 项目 ( .xcodeproj )。

You could use CMake for project configuration/generation instead of relying on QtCreator's .pro format.您可以使用CMake进行项目配置/生成,而不是依赖 QtCreator 的.pro格式。 With CMake you could switch between IDEs (project generators is the better term) on demand and try things out when it gets OS specific.使用 CMake,您可以根据需要在 IDE(项目生成器是更好的术语)之间切换,并在特定于操作系统时进行尝试。

If that's not an option (there might be several reasons), you still can generate an Xcode project from an existing .pro solution via qmake in the command line:如果这不是一个选项(可能有多种原因),您仍然可以通过命令行中的qmake从现有的.pro解决方案生成一个 Xcode 项目:

qmake -spec macx-xcode project.pro

This can be found in the Qt for macOS section of the docs.这可以在文档的Qt for macOS部分找到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM