Results 1 to 5 of 5

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

  1. #1
    Join Date
    Feb 2010
    Posts
    21
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default ui_*.h files not generated after move to different platform/Qt version

    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 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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: ui_*.h files not generated after move to different platform/Qt version

    Did you delete all the intermediate files? Make sure only your source code and the .pro file remains in the project directory.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2010
    Posts
    21
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: ui_*.h files not generated after move to different platform/Qt version

    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: ui_*.h files not generated after move to different platform/Qt version

    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,
    _

  5. #5
    Join Date
    Feb 2010
    Posts
    21
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: ui_*.h files not generated after move to different platform/Qt version

    Quote Originally Posted by anda_skoa View Post
    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.


    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

Similar Threads

  1. How to specify qmake-generated target in a platform independent way
    By dvolosnykh in forum Installation and Deployment
    Replies: 1
    Last Post: 9th March 2013, 10:04
  2. Replies: 1
    Last Post: 23rd February 2013, 18:05
  3. uic: file generated with too old version
    By dacrawler in forum Newbie
    Replies: 4
    Last Post: 22nd January 2011, 13:32
  4. Replies: 2
    Last Post: 28th May 2010, 16:26
  5. No .h or .cpp Files Generated
    By gwb in forum Qt Tools
    Replies: 7
    Last Post: 21st April 2007, 20:26

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.