如何为项目 QtCreator 创建子目录? [英] How to create a subdirectory for a project QtCreator?

查看:57
本文介绍了如何为项目 QtCreator 创建子目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的 Qt 项目分成几个目录,因为它变得非常大.但是,当我在 QtCreator 中单击浏览时,没有添加目录",也没有添加新目录"这样的东西.这可以以某种方式完成吗?

I would like to divide my Qt project into several directories because it is growing pretty large. However, when I click on browse in QtCreator, there is no 'Add directory' and no such thing in 'Add new'. Can this be done somehow?

推荐答案

您可以使用的一种方法是为每个子目录添加一个项目包含文件.

One method you could use is to add a project include file for each sub directory.

Qt Creator 以嵌套方式在 GUI 中显示这些内容,并允许您向其中添加文件.

Qt Creator displays these in the GUI in a nested fashion, and allows you to add files to them.

例如

在 project.pro 中

in project.pro

include(folder1/include.pri)

在 folder1/include.pri

in folder1/include.pri

HEADERS += MyClass.h
SOURCES += MyClass.cpp

这篇关于如何为项目 QtCreator 创建子目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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