PDA

View Full Version : ui_*.h files not generated after move to different platform/Qt version



nomadscarecrow
18th September 2013, 17:37
Hi

I recently move my project from Qt 4.8 (Linux) to Qt 5.1.x (Windows 7, lastest download version this days).

In my .pro I have something like this:
FORMS += form_main.ui \
form_about.ui

next to the corresponding HEADERS (h files) and SOURCES (cpp files)

And in my .pri (just 1 by now), I follow the same way...

I copy all the project. even the .pro.user files. Qt Creator, now in Windows, make the "magic", converting ~settings. qmake apprently is running with no errors.
I followed and correct the The Transition from Qt 4.x to Qt 5 (http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5) to adapt my project to the new Qt version.
After this modifications, everything looks good, except the automatic generation of ui_*.h files.

I open the Makefile file and note the line(s) like:


ui_form_about.h: form_about.ui
/home/xxx/QtSDK/Desktop/Qt/4.8.1/gcc/bin/uic form_about.ui -o ui_form_about.h

from the Linux version of the project, just disappeared in the corresponding Windows side.

I know, I can run uic manually or make a .bat file to include all my "forms" and generate the ui_*.h files, but it get me a bad feeling, something is maybe wrong.

Somebody knows why, is common, what can I do (not forcing) to fix this?

Thanks in advance...

Lex

wysota
18th September 2013, 18:13
Did you delete all the intermediate files? Make sure only your source code and the .pro file remains in the project directory.

nomadscarecrow
18th September 2013, 18:18
Yes... I make a clean from Qt Creatror, it only removes the moc and .o files, the ui_*.h files remain, so I manually deleted.
Run qmake, with no errors and try to build the project, it gave me errors because the no generation of the ui header files.

I even copy again the project, only left code, images, resource files generated from Qt. Same thing.

anda_skoa
19th September 2013, 08:09
Make sure you remove the Makefile and that the qmake of the new Qt version is run.
Your Makefile seems to still have Qt4 uic rules and those paths might no longer be valid.

Cheers,
_

nomadscarecrow
19th September 2013, 16:26
Make sure you remove the Makefile and that the qmake of the new Qt version is run.
Your Makefile seems to still have Qt4 uic rules and those paths might no longer be valid.

Cheers,
_


Hi

The line with the unix path, was just a example of what is missing in the windows version of the Makefile.

It's strange, while I figure out what to do with this situation, I continue working on code migration from Qt 4 to 5; using
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) in code (cpp and h files)
and
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets in the pri file

Suddenly, still a mistery for me, the ui header files were included in the Makefile, after running qmake.
:rolleyes:

My theory: When I get the QT section in pri file working for Qt 5, it allow to qmake to generate the ui headers, so, no problems to ~compile the project.

Right now, I'm dealing with the migration of some QUrl code to the new way, but apparently, it will continue working (compiling).

Question: the precompiler directives and qmake instructions I'm using, are the right way to include a conditional because the version change? Or, are there a better way?

Thanks