Results 1 to 7 of 7

Thread: Problem converting .ui files from Qt3 to 4

  1. #1
    Join Date
    Oct 2006
    Location
    San Francisco, USA
    Posts
    14
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem converting .ui files from Qt3 to 4

    Hi,

    Working on porting Kivio from Qt3 to Qt 4 on win32. Now stuck on converting the .ui files. My steps so far:

    - Ran "uic3.exe -convert" on ui files
    - Removed "CONFIG += uic3" from my .pro file (so doesn't build with Qt Designer 3)

    Error output:
    exportdialogbase.h: No such file or directory kiviomp_proj/ui/exportdialog
    kiviooptionsdialogbase.h: No such file or directory kiviomp_proj/ui/optionsdialog

    The header files for the .ui files are not being generated (i.e. for exportdialogbase.ui and kiviooptionsdialogbase.ui) . Any ideas?

    Thanks,
    Amanda

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Problem converting .ui files from Qt3 to 4

    Quote Originally Posted by Amanda View Post
    The header files for the .ui files are not being generated (i.e. for exportdialogbase.ui and kiviooptionsdialogbase.ui) . Any ideas?
    Are they listed in the FORMS variable in the .pro file?
    FORMS += exportdialogbase.ui kiviooptionsdialogbase.ui
    If this was the case, remember to re-run qmake after adding them and qmake will automatically generate rules to create them..
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    Amanda (28th October 2006)

  4. #3
    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: Problem converting .ui files from Qt3 to 4

    Qt4 uses a different concept for ui files. Header and implementation files are no longer generated from ui files. Instead a small class is constructed, which you then have to inherit from a "proper" class along with the class which is the base class for your form (like QWidget or QDialog). It is all explained in the manual.
    Look at the porting page for details.

    Grr... jpn, you're faster for the second time today

  5. The following user says thank you to wysota for this useful post:

    Amanda (28th October 2006)

  6. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Problem converting .ui files from Qt3 to 4

    Quote Originally Posted by wysota View Post
    Grr... jpn, you're faster for the second time today
    If it only was about being faster - my girlfriend would worship me...
    J-P Nurmi

  7. #5
    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: Problem converting .ui files from Qt3 to 4

    Quote Originally Posted by jpn View Post
    If it only was about being faster - my girlfriend would worship me...
    ROTFL.....

  8. #6
    Join Date
    Oct 2006
    Location
    San Francisco, USA
    Posts
    14
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem converting .ui files from Qt3 to 4

    Great, thanks for the suggestions, I'll try them out.

    Amanda

  9. #7
    Join Date
    Oct 2006
    Location
    San Francisco, USA
    Posts
    14
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem converting .ui files from Qt3 to 4

    It's working given both your suggestions - thanks. For future ref:

    - If you run uic3.exe -convert to convert ui files from Qt 3 to Qt 4, in the .pro file:
    - Undo rename of "INTERFACES" to "FORMS3"
    - Remove "CONFIG += uic3"
    (And, of course, run qmake to generate a new Makefile.)

    - In the ui files:
    - Include the Qt 4 generated header (e.g. ui_<class name>.h)
    - Subclass an appropriate base class such as QDialog

    Amanda

Similar Threads

  1. Problem regarding DLL
    By vermarajeev in forum General Programming
    Replies: 3
    Last Post: 5th October 2006, 04:57
  2. Replies: 16
    Last Post: 7th March 2006, 16:57
  3. [Win32/VC++ 8.0] Strange problems with qrc_*.cpp files
    By mloskot in forum Installation and Deployment
    Replies: 6
    Last Post: 6th March 2006, 11:28
  4. Replies: 10
    Last Post: 1st February 2006, 11:08
  5. Visual Studio 2003 and .vcproj files
    By mbjerkne in forum General Discussion
    Replies: 2
    Last Post: 1st February 2006, 01:51

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.