[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: KJanusWidget use
From: Martijn Klingens <mklingens () yahoo ! com>
Date: 2001-06-29 17:59:19
[Download RAW message or body]
On Friday 29 June 2001 17:43, Malte Starostik wrote:
> QHBoxLayout *layout = new AHBoxLayout(ptr_priority);
^^^^^^^ Typo
Should be QHBoxLayout, but this is probably obvious ;-)
> layout->setAutoAdd(true);
>
> > page_priority = new KSRPriorityTable(ptr_priority);
> >
> > This adds the widget, but I can only view a small portion of the widget.
> > I cannot figure out how to resize it. When I make this class the main
> > view, it displays fine.
>
> You need a layout for that. The above two lines should do it.
You can even make use of the fact that Qt auto-deletes child objects, so you
don't have to keep the layout in a variable unless you want to use it more
than once:
( new QHBoxLayout( ptr_priority ) )->setAutoAdd( true );
I guess some people consider this ugly coding, though I personally find it
very useful to distinguish between dummy objects that are created and
forgotten (not assigned to a var at all), class members (m_xxxx naming) and
other local objects that are used in a method, but not afterwards ('normal'
var naming). I know from the IRC channel that at least Charles uses this
technique as well.
Martijn
>> Visit http://master.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