tags:

views:

192

answers:

2

I am a fresher in qt,i don't have much knowledge on qt, but i created some of file in qt for my application (regaurding to GUI format).I was created some .ui files in qt,but i wanted these files into .exe format.I think u had unerstand my problem,so please help me

+4  A: 

uic (sometimes installed as uic-4) takes the .ui files and generates a C++ header file that you can inherit from. There are a few different ways you can work with the .ui files. See the manual for more information. Feel free to come back with specific questions.

Kaleb Pederson
A: 

Hallo Ram,

I think you are asking about the inclusion of .ui files within your .exe file. If I am not wrong, then you need to include you .ui file within your projects specific resource file. It will be usually named .qrc in Qt projects.

The contents of .qrc file will look something like this:

<RCC>
    <qresource prefix="/ui">
        <file>ui/command/spiwidget.ui</file>
        <file>ui/command/SPIMicroCommandWidget.ui</file>
        <file>ui/command/utility/externdatawidget.ui</file>
        <file>ui/sequencerwidget.ui</file>
        <file>ui/command/watchdogwidget.ui</file>
        <file>ui/command/utility/repdatawidget.ui</file>
    <file>ui/command/core.png</file> 
    <file>ui/command/LastOpenedFiles.ui</file>
    </qresource>
</RCC>

In the code above, you can see the inclusions for .ui and .png(image file) too. After including it in .qrc file, you can use this resource in your .cpp code as follows:

QFile file(":ui/ui/command/LastOpenedFiles.ui");

Where :ui/ui/command is the path of to the .ui file being used.

Hope this explanation is useful to you!

Hari Kishan