Register at least one Qt version…
-
Every time I add a Qt version it just disappears. I’ve done this over and over and it simply does not save the settings, at all. As soon as I press OK, the Qt version information is simply gone. Restarting Visual Studio immediately after doesn’t help.
As a result, I can’t create a Qt project at all.
I am using Visual Studio 2022 and installed the correct Visual Studio components via qt-vsaddin-msvc2022-2.9.1-rev.06.vsix.
Am I doing something wrong here?L. Spiro
-
Are you entering the path to qmake.exe, or something else, when adding the Qt version?
-
These settings are saved in the registry under
HKEY_CURRENT_USER\Software\Digia\Versions
(funny that it's still under Digia).
Open registry editor and see if your Qt version shows up there after you click OK. If not maybe you're running VS under a user that for some reason doesn't have write access to that registry key? Or maybe you installed the extension as an Administrator or another account and now can't edit these settings as a current user? If the key is not there see if it's underHKEY_LOCAL_MACHINE
instead. Something along these lines maybe going on. Try running VS as an administrator and see if you can add a version then. You shouldn't have to do that, but just to check if it's this type of problem.Also, is
T:\
a regular local drive or some sort of network share? -
Are you entering the path to qmake.exe, or something else, when adding the Qt version?
@ChrisW67 said in Register at least one Qt version…:
Are you entering the path to qmake.exe, or something else, when adding the Qt version?
The path is to “T:\Qt\6.4.0\msvc2019_64\bin\qmake.exe”.
After selecting that file the dialog truncates to “T:\Qt\6.4.0\msvc2019_64” automatically, matching the images in your link.@Chris-Kawa said in Register at least one Qt version…:
These settings are saved in the registry under
HKEY_CURRENT_USER\Software\Digia\Versions
(funny that it's still under Digia).
Open registry editor and see if your Qt version shows up there after you click OK. If not maybe you're running VS under a user that for some reason doesn't have write access to that registry key? Or maybe you installed the extension as an Administrator or another account and now can't edit these settings as a current user? If the key is not there see if it's underHKEY_LOCAL_MACHINE
instead. Something along these lines maybe going on. Try running VS as an administrator and see if you can add a version then. You shouldn't have to do that, but just to check if it's this type of problem.Also, is
T:\
a regular local drive or some sort of network share?T:\ is a regular local hard drive (partition).
It is not under HKEY_LOCAL_MACHINE, but not set to anything in HKEY_CURRENT_USER. If I know how it is supposed to look I should be able to edit the registry directly. Running Visual Studio as admin has not resolved the issue.L. Spiro
-
There should be a sub-entry for each version. Name of the node is the name that shows up in VS and it only has a single
InstallDir
key with the path. Here's one of mine for an example (don't mind the Polish names):It should show up in VS after you reopen the settings dialog.
-
It is still removing the setting inside Visual Studio. This is after editing the registry and then opening a new instance of Visual Studio.
What goes in DefaultQtVersion? I’ve provided my best guess here.
Is Qt5VS2017 causing issues? This was from an old install of a previous version on a different Visual Studio.L. Spiro
-
You added it in the wrong place. Look at my screenshot. It should be under Versions, not under Digia.
In the
DefaultQtVersion
goes the key name of the version you want to be default, but it's not necessary. It's just the one that the wizard will suggest when you create a project in VS, but you can pick it yourself. -
Since you've had Qt installed previously - do you maybe have some Qt related environment variables, like QTDIR set or modified PATH variable to include some Qt directories? This is a common mistake that often leads to various weird tooling problems down the line.
-
Environment looks fine, nothing is missing. Sorry, I don't know what causes these issues. I don't have an idea beyond maybe reinstalling the extension. You could also run VS installer and make sure you have MSBuild installed (look in the individual components tab of the installer).
Beyond that you could maybe ask at the interest mailing list, where the developers of the extension are more likely to see you, or report an issue via the bugtracker and get help that way.