Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change a project's name in QtCreator?

Tags:

c++

qt

qt-creator

Is there a way to change a .pro , .ui and .h names if the project is done? How to do it?

like image 225
sunset Avatar asked Jul 29 '11 13:07

sunset


People also ask

How do you rename a class in Qt?

To change class names you can use the Ctrl + Shift + R feature that changes class names in header files and source files. Show activity on this post. If you also want to rename a form and along with its class, you have to edit your name. ui file and change the widget name and class to the new corresponding value.

What is .pro file in Qt?

pro file is to list the source files that are involved in a project. Since qmake is used for building Qt and its associated tools, it knows Qt very well and can generate rules for invoking moc, uic, and rcc. As a result, the syntax is very concise and easy to learn.

Is Qt Creator necessary?

You certainly don't have to use QtCreator to write a Qt program. You also don't have to use qmake but you are asking for trouble by not using it. To do anything even remotely interesting in Qt you will inevitably end up subclassing QObject .


1 Answers

Names for .ui, .h and .cpp files can just be changed inside Qt Creator.

The name of the .pro file is a bit more involved. The simplest is probably to copy the project, rename the .pro file, and reopen.

Qt Creator also uses its own config file, .pro.user, for changes you do in the project and build settings. You can just delete the .pro.user-file, and it'll generate a new one. If you've made changes to the settings and the build process, you can rename that file as well, but remember to read through it and check build paths etc.

Edit by anonymous: Run qmake to generate a new Makefile with updated references to the project name

like image 189
gnud Avatar answered Sep 28 '22 09:09

gnud