Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to change default C++ version for Creator projects
Forum Updated to NodeBB v4.3 + New Features

How to change default C++ version for Creator projects

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JonB
    wrote on 5 Feb 2024, 14:19 last edited by
    #1

    Was an idle curiosity, now irritating me that I can't spot answer.

    Using Qt 5.15, Qt Creator 6, as supplied for Ubuntu 22.04.

    I use qmake. When Creator creates a new project for me the project.pro contains CONFIG += c++11.

    Where does that C++ version choice for new projects come from? Googling qt change default c++ version has not showed me where it's stored or how to alter it. Don't know whether Creator might put this in or have a setting (can't see one, tried looking all over) or whether it's some default from qmake?

    My gcc version is 11.4. I believe I can go to c++14 or c++17 fine. I create lots of tiny test projects frequently, I don't want to have to think to change the .pro each time. Preferably a solution which is for end-user, I don't want to alter a system-installed Qt file.

    J 1 Reply Last reply 5 Feb 2024, 14:31
    0
    • J JonB
      5 Feb 2024, 14:19

      Was an idle curiosity, now irritating me that I can't spot answer.

      Using Qt 5.15, Qt Creator 6, as supplied for Ubuntu 22.04.

      I use qmake. When Creator creates a new project for me the project.pro contains CONFIG += c++11.

      Where does that C++ version choice for new projects come from? Googling qt change default c++ version has not showed me where it's stored or how to alter it. Don't know whether Creator might put this in or have a setting (can't see one, tried looking all over) or whether it's some default from qmake?

      My gcc version is 11.4. I believe I can go to c++14 or c++17 fine. I create lots of tiny test projects frequently, I don't want to have to think to change the .pro each time. Preferably a solution which is for end-user, I don't want to alter a system-installed Qt file.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 5 Feb 2024, 14:31 last edited by
      #2

      @JonB You can search for the templates used by QtCreator.
      For example I found /usr/share/qtcreator/templates/wizards/projects/consoleapp/file.pro for QtCreator packaged by Ubuntu.
      It could also be that QtCreator sets the min C++ version required by the used Qt version to support as many compilers/versions as possible.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 2 Replies Last reply 5 Feb 2024, 14:37
      2
      • J jsulm
        5 Feb 2024, 14:31

        @JonB You can search for the templates used by QtCreator.
        For example I found /usr/share/qtcreator/templates/wizards/projects/consoleapp/file.pro for QtCreator packaged by Ubuntu.
        It could also be that QtCreator sets the min C++ version required by the used Qt version to support as many compilers/versions as possible.

        J Offline
        J Offline
        JonB
        wrote on 5 Feb 2024, 14:37 last edited by JonB 2 May 2024, 14:37
        #3

        @jsulm said in How to change default C++ version for Creator projects:

        For example I found /usr/share/qtcreator/templates/wizards/projects/consoleapp/file.pro for QtCreator packaged by Ubuntu.

        Will do. I was hoping not to have to alter a system file, for example maybe Creator initially creates something in ~/whatever where I could find the c++11, but not having much luck. @J-Hilk suggested ~/.config/QtProject ~/.local/share/data/QtProject/qtcreator1, found some files in former, not spotted if that has anything for this issue.

        It's kind of strange nobody has ever asked this. Wanting to up the default C++ for projects is not unreasonable.

        1 Reply Last reply
        0
        • J jsulm
          5 Feb 2024, 14:31

          @JonB You can search for the templates used by QtCreator.
          For example I found /usr/share/qtcreator/templates/wizards/projects/consoleapp/file.pro for QtCreator packaged by Ubuntu.
          It could also be that QtCreator sets the min C++ version required by the used Qt version to support as many compilers/versions as possible.

          J Offline
          J Offline
          JonB
          wrote on 5 Feb 2024, 14:45 last edited by JonB 2 May 2024, 14:45
          #4

          @jsulm said in How to change default C++ version for Creator projects:

          For example I found /usr/share/qtcreator/templates/wizards/projects/consoleapp/file.pro for QtCreator packaged by Ubuntu.

          OK, since that's clearly a literal .pro file and it has hard-coded CONFIG += c++11 console that is clearly the correct answer! I had thought the c++11 would be "generated" from somewhere during project creation, but looks like it was set in whenever Qt was generated/released. Ho hum. Prefer not to alter the system files, will live with having to alter it in generated .pro file. At least I know!

          1 Reply Last reply
          0
          • J JonB has marked this topic as solved on 5 Feb 2024, 14:49
          • J JonB has marked this topic as solved on 5 Feb 2024, 14:49

          1/4

          5 Feb 2024, 14:19

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved