Unable to open .ui file in Qt Designer from Visual Studio
-
In VS solution explorer, I used to be able to just double-click on .ui file and it will open it in Qt Designer. After upgrading to latest 5.15.12 - in which Qt Designer got updated as well. It's not working anymore.
Now when I double-click a .ui file, I get an error message in Visual Studio "Cannot open file". I can open the file if I manually launch Qt Designer and then open that same .ui file from File menu though.
In VS, I've tried right-clicking a .ui file and click "Open With..." the dialog afterwards does show Qt Designer as the default option. I suspect the path to Designer.exe needs to be updated but can't figure out how?
-
@Taytoo Where did you put it? It should be in a platform folder next to the exe.
-
From what I can tell the plugin tries to get the designer from the Qt installation dir of the Qt version assigned to the project and if that fails goes through other Qt versions set up in the addin options.
So a few questions:
How did you install 5.15.12?
Is it added to the Qt versions list in the plugin options?
If you go to project options does it have the correct Qt version set?
What happens if you try to start the designer form the plugin menu Qt VS Tools -> Launch Qt Designer?
What is the version of your Qt plugin? Current version is 2.9.1.6
Which Visual Studio version are you using? -
@Chris-Kawa said in Unable to open .ui file in Qt Designer from Visual Studio:
From what I can tell the plugin tries to get the designer from the Qt installation dir of the Qt version assigned to the project and if that fails goes through other Qt versions set up in the addin options.
So a few questions:
How did you install 5.15.12?Two different ones: 1st one using Qt Maintenace tool, 2nd is static build (without tools)
Is it added to the Qt versions list in the plugin options?
Yes, both are in the list
If you go to project options does it have the correct Qt version set?
Project uses the static build (and compiles successfully)
What happens if you try to start the designer form the plugin menu Qt VS Tools -> Launch Qt Designer?
It launches
What is the version of your Qt plugin? Current version is 2.9.1.6
2.9.1.6
Which Visual Studio version are you using?
2022
-
@Taytoo said:
2nd is static build (without tools)
That's probably the problem. Best would be to build the tools, but if you don't want to you can probably just copy over the designer from the other build (with dependant dlls) to the bin directory of your static Qt. Or maybe you can try to just put a shortcut there? I don't know if that would work but worth a try.
-
Seems like thats it, but manually copying exe and releated dlls isn't working
I used to be able to open .ui files earlier, so why is it not working after upgrade though? There has to be a way to just get the VS to open designer.exe in non-static qt folder?
-
@Taytoo said:
but manually copying exe and releated dlls isn't working
It does. You just didn't copy all of them. Copy the platform plugin too (
platform/qwindows.dll
). -
@Taytoo Where did you put it? It should be in a platform folder next to the exe.
-
I had copied it to same folder as exe, but creating a sub-folder "platforms" and copying it there resolved the issue.
@Chris-Kawa said in Unable to open .ui file in Qt Designer from Visual Studio:
From what I can tell the plugin tries to get the designer from the Qt installation dir of the Qt version assigned to the project and if that fails goes through other Qt versions set up in the addin options.
In my case why isn't Qt VS plugin going through the Qt versions that I've set up and launching designer.exe from non-static version? I'm able to Launch Designer from Extension menu, so it should be possible?
-
@Taytoo I don't know. You can look at the plugin's source if you want.