October 31, 2011

freecamellia freecamellia
Lab Rat
57 posts

Auto-completion is disable

 

Hi,

This is my situation :

In my project I added an Qt designer graphic interface class which generates form.h form.cpp and form.ui files.
I added some widgets (buttons, labels..) visually in my interface (form.ui).
I edited visually the “objectName” for each widget.
In my form.cpp I want use widget variable by calling them by her objectName .

My question is : when I start writing the objectName of an widget, why the auto-completion is disabled ?

thank you in advance!

4 replies

October 31, 2011

Tobias Hunger Tobias Hunger
Mad Scientist
3135 posts

I guess you are talking about auto-completion in Qt Creator?

October 31, 2011

Andre Andre
Area 51 Engineer
6031 posts

Moved to tools forum as it seems to be related to creator. Feel free to move again if I proof to be wrong :-)

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

November 1, 2011

Volker Volker
Robot Herder
5428 posts

The form.ui file is compiled into an ui_form.h file that must be included in your cpp. The autocompletion needs that .h file to work, so you should build your project after saving the changes to the .ui file in order to regenerate ui_form.h. After that autocompletion usually works again.

November 1, 2011

freecamellia freecamellia
Lab Rat
57 posts

Although ui_form.h is included automatically on the header of form.cpp it not works !

But I added “ui->” before each variable and it works.

thanks a lot !

 
  ‹‹ MSVC2008 and qmake : build release with debug info      Simulator dos not have N9 skin, SDK 1.1.3 ››

You must log in to post a reply. Not a member yet? Register here!