如何在 QtCreator 中重命名文件 .h .cpp [英] How rename files .h .cpp in QtCreator

查看:38
本文介绍了如何在 QtCreator 中重命名文件 .h .cpp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 QtCreator 中重命名源文件?我更改了类的名称,但没有看到更改其中包含的文件的选项.我使用的是 2.7.0 版本.

How rename source files in QtCreator? I have changed name of class but I don't see option to change files it containing. I'm using 2.7.0 version.

推荐答案

如果您使用的是 qmake,重命名很容易.在项目"左侧面板中找到您的文件,然后在上下文菜单中选择重命名".Qt Creator 将自动编辑 .pro 文件替换文件名.

If you're using qmake, renaming is easy. Find your files in "Projects" left panel and choose "Rename" in the context menu. Qt Creator will automatically edit .pro file replacing filenames.

此选项不适用于 cmake 项目.如果您使用的是 cmake,则需要在 Qt Creator 之外重命名文件.然后可能需要调整 CMakeLists.txt 文件以在项目中包含新文件名.

This option doesn't work with cmake projects. If you're using cmake, you need to rename files outside of Qt Creator. May be you then need to adjust your CMakeLists.txt file to include new filenames in the project.

这篇关于如何在 QtCreator 中重命名文件 .h .cpp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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