Results 1 to 3 of 3

Thread: uic not creating seperate .h and .cpp files

  1. #1
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default uic not creating seperate .h and .cpp files

    Hi,

    For long i am trying to create seperate '.h' and '.cpp' files for the respective '.ui' files but it is not creating it..

    I have consulted lot many documents on uic and it is just able to create the .h file for the corresponding .ui file using the following command

    uic filename.ui -o ui_filename.h

    but when i try to give

    uic filename.ui -i filename.h -o filename.cpp

    it gives error saying that -i option not found and does not create the corresponding .cpp file..

    Please tell me how to create the seperate .h and .cpp files for a .ui file.

    (OS used is Windows 2000 and QT is 4.1 opensource with MinGW)

    Thanking you

    Kapil

  2. #2
    Join Date
    Feb 2006
    Location
    Kirovohrad, Ukraine
    Posts
    72
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: uic not creating seperate .h and .cpp files

    Let's take a look at docs:
    uic Output
    In Qt 3, uic generated a header file and an implementation for a class, which inherited from one of Qt's widgets. To use the form, the programmer included the generated sources into the application and created an instance of the class.
    In Qt 4, uic creates a header file containing a POD class. The name of this class is the object name of the main container, qualified with the Ui namespace (e.g., Ui::MyForm). The class is implemented using inline functions, removing the need of a separate .cpp file. Just as in Qt 3, this class contains pointers to all the widgets inside the form as public members. In addition, the generated class provides the public method setupUi().

  3. #3
    Join Date
    Feb 2006
    Location
    Österreich
    Posts
    35
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: uic not creating seperate .h and .cpp files

    I think you are definitely reading the docs for Qt3 and not Qt4. I just installed it this weekend, so trust me, it's weird getting used to the changes and the Qt3 reference won't really help you. Anyway, why do you need to make these yourself? My makefiles always generate the ui_formname.h automatically at build-time. I just have to remember to include them correctly in main.cpp
    My philosophy is: If you can use a free, open-source alternative: do it. And if you can't, pretend it's free and open-source and hope you don't get caught.

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.