在 QtCreator 中使用 .pro 和 .pri 正确(树)显示 Qt 项目 [英] Proper (tree) display of Qt project using .pro and .pri in QtCreator

查看:96
本文介绍了在 QtCreator 中使用 .pro 和 .pri 正确(树)显示 Qt 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用项目包含文件 (.pri) 显示不止一个额外级别.例如,如果 .pro 文件包含 .pri 文件,该文件包含两个 .pri 文件.

Is it possible to display more then only one extra level using project include files (.pri). For example if .pro file includes .pri file which includes two .pri files.

  • .pro
    • .pri
      • .pri
      • .pri

      在 QtCreator (Projects) 中的显示具有误导性:

      In QtCreator (Projects) display is misleading:

      • .pro
        • .pri
        • .pri
        • .pri

        它根本不考虑 .pri 文件在文件系统中的位置,而是将它们显示为相同的 .pro 级别.还是我做错了什么或只是期望太多?我正在使用 Qt 4.7.4QtCreator 2.2.1.

        It simply doesn't respect where the .pri file is in the file system and displays them as a at the same .pro level. Or am I doing something wrong or just expecting to much? I am using Qt 4.7.4 and QtCreator 2.2.1.

        推荐答案

        如果您忽略第二级 .pri 文件并仅使用新目录并将所有包含移动到根 .pri 文件,似乎有某种解决方法.例如:

        Seems like there is some kind of workaround if you ignore the second level of .pri files and just use a new directory and move all includes to root .pri file. For example:

        • .pro
          • .pri
            • 新目录 A(而不是另一个 .pri)
            • 新目录 B(而不是另一个 .pri)

            QtCreator(项目)显示:

            QtCreator (Projects) display:

            • .pro
              • .pri
                • 标题
                  • 新目录A
                  • 新目录 B
                  • 新目录A
                  • 新目录 B

                  这样做的好处是您可以保持相同的文件结构.我仍然希望他们能够检测 .pri 的新级别.但是,如果您发现更多我不知道的东西,请告诉我.

                  Good thing about it is that you get to keep the same file structure. I am still hoping they implement detection of new level(s) of .pri. But please let me know if you find out something more that I heaven't.

                  这篇关于在 QtCreator 中使用 .pro 和 .pri 正确(树)显示 Qt 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆