Click to See Complete Forum and Search --> : QT Designer -> KDevelop. How do I convert .ui's to code?


McBalls
04-20-2003, 05:31 PM
Hey,

I've checked out some tutorials on the subject, althought they haven't been very helpfull. I have a .ui GUI that I designed with QT Designer. Now I'm supposed to integrate that into my KDevelop stuff. I read about a User Interface Compiler (UIC) that is supposed help.

Can some one tell me how I'm to do this. I'd really like to get rolling with some KDE development :)

Happy Easter to all!

McBalls ;-)

bwkaz
04-20-2003, 05:56 PM
I think it's a couple of steps to get the .uic compiled into both a .cpp and a .h file. I think you actually need two invocations of uic to do it...

But whenever I've used Qt Designer, I've not bothered with it at all. I just made a .pro file (project), and ran qmake on that file to create a Makefile that knows exactly what to do.

I don't know if that helps or not, though...

PhatBarren
04-21-2003, 05:04 PM
I recently began working with KDevelop and QT Designer as well, and had trouble doing this too. It turns out that uic wasn't in my path, and therefore I'm assuming it's not in yours either.

So, for me, uic is /usr/lib/qt3/bin/uic. So what I did was put the following in my /etc/profile:

export QT_BIN=/usr/lib/qt3/bin
export PATH=$PATH:$QT_BIN

That will take care of things for the next time you login, but for now, just type those two lines into your shell to set the vars like that.

Then, you can get your .ui to a .h and .cpp like this:

uic -o MyGUI.h MyGUI.ui
uic -o MyGUI.cpp -impl MyGUI.h MyGUI.ui

That should do it.... the you can bring that into your KDevelop environment, and just enstantiate your MyGUI class that is created.

I haven't worked with the qmake as bwkaz was suggesting, but I assume it makes a Makefile which does those two commands, and possibly more. Check out the QT Designer tutorial on the QT site: http://doc.trolltech.com/2.3/designer/part1index.html it's pretty good (although only talks about QT - no KDE).

Hope that helps!

RepeatLoop
05-13-2004, 05:35 PM
I myself just spent hours tryin to go thru this other tutorial o___o; tryin to do the same thing...

Now I'm gonna try this method suggested above...but I'm not sure what u mean by "enstantiate"...

I've tried both methods and am abit confused (maybe lack of sleep)...gmake doesn't do anything (any options need to be passed?).....

HELP PLEASE ;____; Need to have some feeling that I've done something before hitting the sack...o____o

I can't even get a dialogue with a simple button going...and have downloaded the sigcreate example from another tutorial and it compiled fine...and ran....

bwkaz
05-13-2004, 07:04 PM
Originally posted by RepeatLoop
not sure what u mean by "enstantiate"... Instantiate, like "create an instance of". It's a C++ thing. ;)

gmake doesn't do anything (any options need to be passed?) gmake, or qmake? gmake is GNU Make (it's not what you want to create a Makefile), qmake is Qt Make -- it takes the .pro file that Qt Designer saves, and processes it to create a Makefile for GNU Make to process to build everything.