[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: modifying Qt Designer generated code
From:       Thomas Baumgart <ipwizard () users ! sourceforge ! net>
Date:       2006-07-22 7:23:11
Message-ID: 200607220923.17777 () net-bembel ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Hi all,

on Saturday 22 July 2006 02:33, Nasser wrote:

> what if i want to modify the ui file through Qt Designer?.. whenever i
> modify the file, such as change a pushbutton's name, then can i
> automatically get this updated through to the class i subclassed?..

Yes, you won't have to do anything.

> or will i have to subclass the ui form once again?

No.

> .. because i want to modify the UI form using Qt Designer, but it
> doesnt make sense if i then have to subclass it again in KDevelop...

If you have setup your classes and build environment correctly 
(Makefile.am) then all this automagically happens in the background. You 
just modify the ui file and rerun make and got the result. At least it's 
what I do in the KMyMoney project and I have seen this in many other 
projects as well.

> the tutorial didnt seem to mention this anywhere
>
> On 7/21/06, Aaron J. Seigo <aseigo@kde.org> wrote:
> > On Thursday 20 July 2006 4:40, Ahmed Aït Mouss wrote:
> > > Basically what you have to do is subclass the UI class created by
> > > Designer and put any additionnal functionality in the subclass.
> > > Say you create baseform.ui in Designer, then uic will generate
> > > baseform.h and baseform.cpp. What you should do is create a class
> > > named Form that inherits BaseForm, and add you functionnality to
> > > Form. It's explained in the Qt docs.
> >
> > ... and in Qt4 you can simply use the uic generated code as a UI
> > factory with setupUI() like this:
> >
> > MyWidget::MyWidget(QWidget* parent)
> >
> >   : QWidget(parent)
> >
> > {
> >         Ui::ImageDialog ui;
> >         ui.setupUi(this);
> >         // my custom code
> > }
> >
> > there is really no reason to ever modify the generated code directly.
> > Nasser: what are you trying to achieve?
> >
> > --
> > Aaron J. Seigo
> > Undulate Your Wantonness
> > GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43
> >
> > Full time KDE developer sponsored by Trolltech
> > (http://www.trolltech.com)
> >
> > >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> > >> unsubscribe <<
> >>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> >> unsubscribe <<

-- 

Regards

Thomas Baumgart

thb@net-bembel.de               Check the KMyMoney open source
http://www.net-bembel.de/       project at http://kmymoney2.sf.net/

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
New processes are created by other processes, just like new humans.
New humans are created by other humans, of course, not by processes.
(Unix System Administrator Handbook)
-------------------------------------------------------------

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic