my brain is burning and i'm neurotic(need some help with ui)

Ask for help here if you want to contribute to the project.

my brain is burning and i'm neurotic(need some help with ui)

Postby wushu » December 19th, 2009, 4:46 pm

Hi! I am going to tell you my story but you can ignore most of it. There is a quesiton at the end.

#ifdef ICAREABOUTSTORY

So basically here is my story,I'm a programmer. I've done alot of work with C and python and Java
I'm not really your GUI sort of guy although I have a `i'd say` competent knowedge of gtk and a very
good one of swing.

Normally I don't give a shit about gui's but one day after getting pissed off at having my gentoo installation
messed up by having like 5 cross compilers installed (i remebered i had a gcc for mips, ppc, microblaze and
some other shit left over from university) and having wrong headers included etc I decided to reinstall
my whole system and i was looking for kopete while i was rebuilding the gentoo base system but there was
none!!!!!!! Instead it had this very sexy kmess instant messenger and i fell in love with it.!!!!!!!!

So anyways kmess has a bunch of bugs (I'll report them when I'm not lazy) but I also want to help work on them
(cause kmess is lovely and i <3 it) like maybe submit some patches and you can merge them or whatnot I don't
care (as they will be applied on my computer anyways).

#endif

But here is my question. I always __knew__ C++ (syntax, features etc) but I never used it before (very seriously).
And I never used Qt (but it's time for that to change so I can maybe help this sexy messenger). I checkedout the
svn trunk and I see there are UI files that go with the corresponding cpp and h files. My investigation lead me to
learning that you use Qtdesigner to produce a .ui file and then you use a program called uic to compile the UI into
a header. i also saw in older guides that you used to be able to create both a .cpp and a .h for your .ui but that
feature seems to be removed. What I was thinking was that personally I would use the generated code in a .cpp
and then create a corresponding .h. What has kmess done about this? Did you edit the output from uic to create
your classes? Is there something i'm missing? If i make any sense i think you will be able to guess what the question
is.


SUMMARY: foo.ud -> foo.h + foo.cpp how has kmess done this?
wushu
 

Postby wushu » December 19th, 2009, 6:43 pm

sorry i missed things like #include "ui_contactframe.h"
in my original optical parse :o so basically you use the
header from uic and extend it here ->
class ContactFrame : public QWidget, private Ui::ContactFrame

sorry for wasting diskspace on your forum it's all ok now <3
wushu
 

Re: my brain is burning and i'm neurotic(need some help with ui)

Postby Valerio » December 24th, 2009, 12:06 pm

Exactly, we inherit the compile-time-generated classes made from the Designer .UI files, then use the widgets as private class members. Which is also why we name them with trailing underscores in Designer, like private class properties :)
Image
User avatar
Valerio
Developer (*)
 
Posts: 1698
Joined: February 20th, 2007, 1:25 am
Location: Italy - Sardinia

Re: my brain is burning and i'm neurotic(need some help with ui)

Postby fontknocker » December 24th, 2009, 10:58 pm

This page will be helpful I think:

Using a Designer .ui File in Your Application

We use the multiple inheritance approach since we like to have simple access to the widgets on the form.

As for the bugs, report them on the forum and we'll look at taking care of them.
ISF-Qt - Ink Drawing Library for Qt 4.x (TODO: pressure sensitivity, pixel-by-pixel erase, highlighter support)
Trunk status: Builds and runs. Slowly improving. Not fit for use over 2.0.x.
User avatar
fontknocker
Developer (*)
 
Posts: 370
Joined: July 28th, 2008, 11:33 am

Re: my brain is burning and i'm neurotic(need some help with ui)

Postby wushu » January 2nd, 2010, 3:25 am

Ah thanks for the clarifications and the link I seem to have a solid grasp of how it's done now.
Been working alot for normal job so never got to check back eariler and say thanks... so THANKS :)
wushu
 


Return to Developer support



Who is online

Users browsing this forum: No registered users and 1 guest