[Kde-perl] no addItem in Layouts?

Thomas Fjellstrom tfjellstrom at shaw.ca
Sun Jan 4 07:20:05 CET 2004


On January 3, 2004 09:29 pm, Ashley Winters wrote:
> --- Thomas Fjellstrom <tfjellstrom at shaw.ca> wrote:
> > On January 3, 2004 08:17 pm, Germain Garand wrote:
> > > Here I got:
> > >  pqtapi -r addItem
> > >         void QBoxLayout::addItem(QLayoutItem*)
> > >         void QCanvas::addItem(QCanvasItem*)
> > >         void QCanvas::addItemToChunk(QCanvasItem*, int, int)
> > >         void QCanvas::addItemToChunkContaining(QCanvasItem*, int,
> >
> > int)
> >
> > >         void QDockAreaLayout::addItem(QLayoutItem*)
> > >         void QGridLayout::addItem(QLayoutItem*)
> > >         void QGridLayout::addItem(QLayoutItem*, int, int)
> > >
> > > Germain
> >
> > I suppose maybe its not correct to use the ->layout() result from a
> > Qt::HBox
> > as the layout?
>
> Bingo.
>
> > I tried:
> > my $spacer = Qt::SpacerItem(1, 1, &Qt::SizePolicy::Maximum,
> > &Qt::SizePolicy::Maximum);
> > $ok_box->layout()->addItem($spacer);
>
> $ok_box->addItem($spacer);

huh? Why was that done? the Qt docs mention nothing of a addItem method in the 
HBox/VBox widgets, yet is in the base Layout classes... Also didn't see any 
mention of it in the PerlQt docs ;)

> > I also have another question.. is it possible to access the
> > attributes of your
> > own subclasses, from outside those objects, besides through making
> > your own
> > accessor methods?
>
> If you want to break encapsulation, go for it; it's one of the joys of
> Perl. The attributes aren't hidden: $your_object->{foo} accesses the
> 'foo' attribute declared in $your_object's class.

Very nice :) though, now that I think about it.. Its not that "brilliant" of 
an idea... I just hope I never change the name of any accessed attributes ;)

> Ashley Winters
>
> __________________________________
> Do you Yahoo!?
> Find out what made the Top Yahoo! Searches of 2003
> http://search.yahoo.com/top2003
> _______________________________________________
> Kde-perl mailing list
> Kde-perl at kde.org
> https://mail.kde.org/mailman/listinfo/kde-perl

-- 
Thomas Fjellstrom
tfjellstrom at strangesoft.net
http://strangesoft.net



More information about the Kde-perl mailing list