How to change a project's name in QtCreator?

Viewed 40945

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

4 Answers

This worked for me I am on Fedora 35 running QT5. Close QT then run this script. I didn't find any .pro files. and I didn't get any error messages after running this and doing the rebuild.

  #/bin/bash
  #Wed Aug 10 10:30:12 AM EDT 2022
  # how to copy a QT project to a new name
  set -x

  echo -n enter oldname
  read oldName

  echo -n enter newname
  read newName

  cp -a "$oldName" "$newName"

  mv "$newName/$oldName.pro" "$newName/$newName.pro"
  mv "$newName/$oldName.pro.user" "$newName/$newName.pro.user"

  sed -i "s/$oldName/$newName/g" "$newName/$newName.pro.user"

  echo "Now startup Qt and open existing file    $newName/$newName.pro"
  echo "and run a build all configurations"

------end of bash script------------

Related