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

List:       kde-devel
Subject:    Re: QLayout
From:       tech () bishop ! dhs ! org
Date:       2002-08-04 22:54:15
[Download RAW message or body]

On Sat, Aug 03, 2002 at 06:18:22PM +0200, Anders Lund wrote:
> On Saturday 03 August 2002 12:00, kde-devel-request@mail.kde.org wrote:
> > Date: Fri, 2 Aug 2002 23:41:01 -0600
> > From: tech@bishop.dhs.org
> > To: kde-devel@kde.org
> > Subject: QLayout
> > Reply-To: kde-devel@kde.org
> >
> >
> > --lrZ03NoBR/3+SXJZ
> > Content-Type: text/plain; charset=us-ascii
> > Content-Disposition: inline
> > Content-Transfer-Encoding: quoted-printable
> >
> > Well, here I am, actually improving the app, instead of just porting it.
> > Who'd a thunk?  My question is: how do you guys handle using the QLayout
> > stuff, when the code that builds the gui is spread out over several
> > files and a few different classes?  The way the code is currently set
> > up, is that the main class calls four or five "initFoo" functions, to do
> > the menubar, statusbar, etc, then initView, which creates an object of a
> > second class, which, as it's constructor, creates an object of a third
> > class, which as *its* constructor, fills in the rest of gui.  So I'm
> > confused as to how to have all the various widgets "under" one QLayout
> > manager.  Make a pointer and pass around like mad? Completely
> > restructure the code to put them all in one class?  Am I missing something=
> > =20
> > that makes the QLayout global, and this is all the proverbial molehill?=20
> >
> > On this, I don't think I'll need quite as much "example" code (read:
> > code that I can cut and paste ;-), just a hint or two on how you guys
> > have handled this in the past.
> >
> > Oh, and this markes the first time I've done anything with the gui that
> > *didn't* involve extensive use of QT-Designer. Yeah!=20
> >
> > Thanks, and have a great weekend.
> >
> > D.A.Bishop
> 
> Well, first of all most ppl use kaction and the XML GUI framework to handle 
> menubars and toolbars.
> 
> The statusbar is available from a K/QMainwindow, use 
> MyKMainWindow->statusBar() for a pointer.
> 
> For layouts, QWidget::layout() is public, assuming you have a layout as a 
> child of the main widget, so any class needing access just needs a pointer to 
> the layout itself, or the main widget. It will quite often be the parent, so 
> the QWidget *parent pointer used by QWidget and derived classes will often be 
> the one.
> 
> Usually, the constructor of the main widget for a window just adds whatever 
> child widgets it wants to its layout, but there are no limitations there.
> 
> -anders

Thank you, this is exactly the sort of reply I was looking for.  Have a
great day!

D.A.Bishop


[Attachment #3 (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