[Qt-interest] Newbie question about making .UI files into C files

Andreas Pakulat apaku at gmx.de
Wed Feb 11 23:25:08 CET 2009


On 11.02.09 22:53:12, Knapp wrote:
> On Wed, Feb 11, 2009 at 9:58 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> > On 11.02.09 21:49:59, Knapp wrote:
> >> Hello, I am totally new to using QT with C++. I have been working with
> >> pyQT and loving it but need to use the C form now.
> >> My question is how do you go from the .ui file to C code? All the
> >> tutors I have found don't seem to work. I think the problem being that
> >> they are for qt3 and not qt4.4, that I am using.
> >> I would be happy with just a good link that goes from a simple qt
> >> designer gui to a finished running program with a hand made slot of 2.
> >
> > The process hasn't changed between Qt3 and Qt4, just how you use the
> > generated file. Its also all explained in the designer manual available
> > under http://doc.trolltech.com/4.4/. Basically you need your buildsystem
> > to run uic on the .ui file to generate the header.
> >
> > Oh and its C++ thats generated, not C.
> 
> Yes C++, just forgot to type that.
> 
> I have yet to find a simple explanation in assistant about this.
> 
> So you make your gui with designer and it makes a ui file.
> You then make a .pro file and tell it to include the .ui file
> next call gmake??
> 
> For the moment lets say you are not doing anything to mod the gui.
> 
> Sorry about being a dunce but I am having a hard time moving to C++
> after python.

This has nothing to do with C++ actually. It only has something to do
with having "something" run uic on the .ui file and thats not different
from how PyQt4 works. There you need "something" to run pyuic on your
.ui file. That "something" is called a buildsystem, qmake is a very easy
one to start with for Qt development as it allows to generate a
qmake-project file from a directory of source+ui files (and resources
too, IIRC), by simply running qmake -project. 

> A very simple process that shows taking a design ui to a finished
> product without anything being added would be very helpful; including
> the resources file too.

Then I suggest to look at the tutorial in the docs, its a step-by-step
intro to Qt/C++ and then continue by looking at the various.
Specifically for using ui files look at the Calculator Form example (its
under the Designer headline or in examples/designer/)

Andreas

-- 
You are as I am with You.



More information about the Qt-interest-old mailing list