在 MSVC 中构建项目时未找到 QTDIR 错误

发布于 2024-08-19 01:32:14 字数 465 浏览 3 评论 0原文

使用MSVC 2008 SP1和qt-vs-addin-1.1.2

我在MSVC中有一个预先存在的项目,我已经QT'化了:在main中我添加了一个QApplciation,我的窗口现在都是QWidgets。 我为 .qrc 和 .ui 文件添加了自定义构建步骤,并添加了“moc”作为任何 Q_OBJECT 头文件上的自定义构建步骤。

所有这些都起作用 - 项目构建并运行,XCode 上的变体也可以工作。

但是,我的项目的行为仍然与使用 Qt 向导创建的项目不同:- 即 Qt 插件不设置 QTDIR 构建变量。它也不在项目上下文菜单上提供任何 Qt 配置选项 - 它们都是灰色的。

我可以通过在我的环境中设置默认 QTDIR 来解决 QTDIR 问题。但我想解决 Qt 插件对项目做了什么 - 目视 Qt 生成的项目与 Visual Studio 项目的 (xml) vcproj 文件并没有揭示 Qt 插件正在寻找处理的任何明显迹象项目正常进行。

Using MSVC 2008 SP1, and qt-vs-addin-1.1.2

I have a pre-existing project in MSVC that I have QT'ified: In main I added a QApplciation, and my windows are now all QWidgets.
I added custom build steps for my .qrc and .ui files and "moc" as a custom build step on any Q_OBJECT header files.

This all functions - the project builds and runs, and the variant on XCode works too.

However my project still behaves differently to a project created using the Qt wizard :- Namely the Qt addin does NOT set the QTDIR build variable. Nor does it offer any of the Qt configuration options on the project context menu - they're all greyed out.

I can work around the QTDIR issue by setting the default QTDIR in my environment. But I would like to resolve what the Qt addin has done to the project - eyeballing the (xml) vcproj file of a Qt generated project vs a Visual Studio project does not reveal any obvious signs of what the Qt-addin is looking for to treat the project properly.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

行雁书 2024-08-26 01:32:14

QTDIR 作为 属性 添加到项目的 Visual Studio 项目用户选项文件。该文件的扩展名为 .vcxproj.user,与项目文件位于同一目录中并且具有相同的基本名称。据我所知,除了直接编辑文件之外,没有办法修改、添加或删除 QTDIR 属性。

请注意,此属性可以放入除用户选项文件之外的其他文件中。我将它放在属性表中,因此设置 Qt 项目所需要做的就是添加属性表。

QTDIR is added as a Property in the Visual Studio Project User Option file for your project. The file has the extension .vcxproj.user, and is in the same directory and has the same base name as your project file. As far as I can tell there is no way to modify, add or delete the QTDIR property besides directly editing the file.

Note, this property can be put in other files besides the User Option file. I placed it in a property sheet, so all I have to do to setup a Qt project is to add a property sheet.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文