Unsolved Delay in code section when I change the widget name in Object explorer?
-
Hi,
I put any widget on the window in GUI design section. For instance I change the Object name from ComboBox to ComboCountryName.
Then I go to code section and try to write;
ui->ComboCountryName->currentText()
But I got error! Because the object name is still
ui->ComboBox->currentText()
When I try to RUN first than Object name changed to ComboCountryName?!By the way when I try to create slot of this object. it's name is still ComboBox?!...
I mean it need to be run first to recognize changed name?!
Why?...Regards,
Mucip:) -
Hi @Mucip,
do you have the Clange Code Model activated? (In Help > About Plugins)
Changes in the GUI are stored in the
window.ui
files, which cannot be compiled. Therefore, a tool calleduic
creates a "ui_window.h" file that contains your dialogs logic and is then compiled with your app.With the classic code model, Creator does this compiling already in RAM, so the code model can provide the completions before you actually compile. With Clang, it seems this is not working as well, so I most often compile my code to get the completion back.
I know, that's rather a workaround then a solution, but maybe it helps you.
Edit: I just tested it again, and for the small example it worked well, even with Clang (Creator 4.9). So it seems things have improved :)
-
Hi @aha_1980 ,
Yes, it's active...I use 4.9 too. But I need to run first still?!... :(
Regards,
Mucip:) -
On which operating system are you? I tested a minimal Qt Widgets project on Linux.
-
Hi @aha_1980 ,
Unfortunatelly I must use Windows... :(Regards,
Mucip:) -
Hi
Same for me in Windows with Creator 4.9
i have to press shift+ctrl+b to have it pick up
any newly added widgets/renames and show in auto complete dropdown.
Else the old are still shown.With clang off, switching back to code with shift +f4, it's
already updated in autocomplete. -
@mrjj that confirms my observation, that Clang works better on Linux.
Anyone wanting to create a bugreport?
-
@aha_1980
But is it a bug ?
On linux, it will be ready for auto-completion as soon as switching back to code?
(i have older Creator on linux so could not test it ) -
On linux, it will be ready for auto-completion as soon as switching back to code?
Yup. Same way as in former times with classic code model. I was impressed too :)
-
Dear @mrjj ,
So what else? It works on Linux but doesn't work on windows?!...Regards,
Mucip:) -
@Mucip
thats why i asked. :)
If it also did not work like old times in Linux, it might be intended but seems not.
(and i sorely missed even build file is fast)
I will create a bug report. -
@mrjj said in Delay in code section when I change the widget name in Object explorer?:
I will create a bug report.
Hi,
Thanks a lot...Regards,
Mucip:) -
Hi
we need to talk a bit about this.To be sure i used the same version in both Linux and windows, i removed my windows Qt versions and
installed the newest from the online installer. And now autocompletion works as in Linux.??@Mucip
Could you please try
Make new default GUI project. ( with the wizard)
Click on MainWindow.ui to see form
Drop pushbutton on the form
press shift+f4 to switch to code
start type ui-> and then see if the button is listed ?
For me that works now in Windows with Creator 4.9
No need to run or compile.
It also picks up renames now. And i cannot reproduce it. :( -
@mrjj,
I shocked! I did what you write.
I put one lineEdit on the form and change name to lineEditName.
Then press Shift+F4 to code section. And I start to see ui->lineEditName.So what is the problem now?! Why old created project works bad then?!...
Edit: I tryed old code and still same problem?! I need to run code first to see code compşlation of new added object?!
Very strange!!! :(Regards,
Mucip:) -
@Mucip
Hi
Tested some more.
Can you try something?
In your real project. Add a new button, name it "there"
shift to code
And then WAIT. count at least slowly to 30.
then type
ui->I found out that in the larger projects, if you do it fast, it is not there
but then i went for coffee. and when i came back, it was in autocomplete.
I did not compile!
So Im starting to think its maybe just slower than we think. -
Hi @mrjj,
I did what you advice and it's been 4 minutes and still nothing about ui->there?!... :(Regards,
Mucip:) -
@Mucip
Thank you for testing :)
Ok, so yours clearly have another issue.
Can i ask how BIG your project is ?
is any of the files over 5MB?Still trying to find a really large Qt project to try on.
Maybe Creators own source. -
Hi @mrjj,
There is still nothing! :(I have 86 cpp file in project and max size is 41 KB...
Regards,
Mucip:) -
Hi
Well that is nothing. or far from 5 mb.I did notice while testing if there is anything it complains about with the
red circles, sometimes it won't autocomplete.
Im wondering if there is something in your project that stalls it.
But i assume its for all UI files so that seems unlikely.However, if you are willing
we could try
https://wiki.qt.io/Qt_Creator_Clang_Code_Model
(the windows part in the top. ) and then see if anything shows up in the log.
DebugView is ultra small download so its not very time consuming.
You do not have to read all of it. just the log part in top :) -
Hi @mrjj ,
Well, I downloaded DebugView. But where is the log file to view in Debug View?...Regards,
Mucip:)