changing objectName in design view does not update names in mainwindow.cpp
-
wrote on 26 May 2018, 15:36 last edited by
I just made another project starting from scratch and it now works.
Thanks for the help -
I just made another project starting from scratch and it now works.
Thanks for the helpwrote on 26 May 2018, 18:54 last edited byI had run into one more problem that others looking at this thread might want a solution to.
After building and running the program, I added a checkBox widgit and it was not showing up in code. This was the same thing as was happening before. I deleted the ui_mainwindow.h file and then it started working.
So it looks like the problem was that qmake was not rebuilding the ui_mainwindow.h file after updates to the display unless its old version is deleted. I am not sure if this is the intended behavior or if it is my settings but if it is the normal behavior, this could turn a lot of people away from using Qt and needs to be fixed. -
I had run into one more problem that others looking at this thread might want a solution to.
After building and running the program, I added a checkBox widgit and it was not showing up in code. This was the same thing as was happening before. I deleted the ui_mainwindow.h file and then it started working.
So it looks like the problem was that qmake was not rebuilding the ui_mainwindow.h file after updates to the display unless its old version is deleted. I am not sure if this is the intended behavior or if it is my settings but if it is the normal behavior, this could turn a lot of people away from using Qt and needs to be fixed.@arif_sohaib
Hi
Its not normal at all.
I use Designer all day and renaming anything is available at once
via UI-> with no action on my part.Did you change/use shadow build folder or did anything special with the ui_xxx files ?
Also check that you dont have a virus scanner blocking the files in the build folder.
Especially if you are using Avast. -
I had run into one more problem that others looking at this thread might want a solution to.
After building and running the program, I added a checkBox widgit and it was not showing up in code. This was the same thing as was happening before. I deleted the ui_mainwindow.h file and then it started working.
So it looks like the problem was that qmake was not rebuilding the ui_mainwindow.h file after updates to the display unless its old version is deleted. I am not sure if this is the intended behavior or if it is my settings but if it is the normal behavior, this could turn a lot of people away from using Qt and needs to be fixed.as @mrjj said, this usually works out of the box.
one more idea: usually you don't open the generated ui_*.h files. if you do, you may be hit by a Clang bug that forbids updating the file.
so if you have Clang Code Model enabled, you could check if it works if you don't open the generated files.
-
@arif_sohaib
Hi
Its not normal at all.
I use Designer all day and renaming anything is available at once
via UI-> with no action on my part.Did you change/use shadow build folder or did anything special with the ui_xxx files ?
Also check that you dont have a virus scanner blocking the files in the build folder.
Especially if you are using Avast.wrote on 26 May 2018, 23:58 last edited by@mrjj said in changing objectName in design view does not update names in mainwindow.cpp:
Did you change/use shadow build folder or did anything special with the ui_xxx files ?
Also check that you dont have a virI tried with both Shadow Build on and off. I also changed the build folder because under the default settings, it wasn't able to find the .exe file when I hit run so I changed it to "project folder/build" and it started working.
As for virus scanner, I only have the default Windows Defender. -
as @mrjj said, this usually works out of the box.
one more idea: usually you don't open the generated ui_*.h files. if you do, you may be hit by a Clang bug that forbids updating the file.
so if you have Clang Code Model enabled, you could check if it works if you don't open the generated files.
wrote on 27 May 2018, 00:01 last edited by@aha_1980 said in changing objectName in design view does not update names in mainwindow.cpp:
one more idea: usually you don't open the generated ui_*.h files. if you do, you may be hit by a Clang bug that forbids updating the file.
I know not to touch generated files, and I don't for anything important, but I was just experimenting with getting it to work.
I am not sure about Clang, I am not sure. I am using the Visual Studio 2017 15 C++ compiler. Most things that I didn't mention are on their default settings.
And thanks for the reply. -
sorry for being so unspecific, I had QTCREATORBUG-15449 in mind.
you can check with Help > About Plugins if Clang Code Model is enabled.
Regards
-
Hi
That is very strange.
if you manually delete the ui_ file and compile it works every time ?if you are using qmake, it normally call the UI tool correctly
http://doc.qt.io/qt-5/uic.htmlIts just Creator + visual studio compiler and nothing special extra?
-
wrote on 27 May 2018, 16:31 last edited by
After the application compiled the first time alone with allowing adding more ui widgits, adding more widgits and compiling isn't causing any more problems.
Now any ui elements I add immediately show up in the mainwindow.cpp file without any additional steps. -
After the application compiled the first time alone with allowing adding more ui widgits, adding more widgits and compiling isn't causing any more problems.
Now any ui elements I add immediately show up in the mainwindow.cpp file without any additional steps.@arif_sohaib
Ok super. Not sure what was up with it :)
14/14