PDA

View Full Version : Problem converting .ui files from Qt3 to 4



Amanda
27th October 2006, 22:00
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

jpn
27th October 2006, 22:12
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..

wysota
27th October 2006, 22:18
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 (http://doc.trolltech.com/4.2/porting4-designer.html) for details.

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

jpn
27th October 2006, 22:32
Grr... jpn, you're faster for the second time today :)
If it only was about being faster - my girlfriend would worship me... ;)

wysota
27th October 2006, 22:55
If it only was about being faster - my girlfriend would worship me... ;)
ROTFL.....

Amanda
28th October 2006, 02:41
Great, thanks for the suggestions, I'll try them out.

Amanda

Amanda
28th October 2006, 04:34
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