PDA

View Full Version : No refresh .ui



ariad
22nd September 2014, 14:45
Hello,
I change the .ui file for example I add a label with design but in the .cpp file I can't add a value because this label isn't recognize.
And when I run the application the result is previous. I try the forder to debug but I have the same problem.
What can I do? thanks

anda_skoa
22nd September 2014, 16:27
Check that you have modified the file you assume you have modified.
Check that the .ui file is correctly listed in your project's FORM variable.

Cheers,
_

ariad
23rd September 2014, 09:06
That's ok, if I check the xml I can see the correct source:



<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>190</x>
<y>150</y>
<width>57</width>
<height>14</height>
</rect>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</widget>


And in the .cpp file it is put:

#include "ui_mainwindow.h"

But in the terminal if I do qmake, make, ./nameproyect I can see the correct changes.
This problem don't happen in all my proyects.

Thanks

aamer4yu
23rd September 2014, 09:14
After you modify ui file, you should run qmake to generate latest headers.
Or atleast clean and build your application. That should take the latest updated files.

anda_skoa
23rd September 2014, 11:17
That shouldn't be necessary.
qmake generates uic rules for all .ui files it finds listed in the FORMS variable.

QtCreator even parses the .ui files on change for code completion.

Cheers,
_