From kde-devel Fri Jun 29 17:59:19 2001 From: Martijn Klingens Date: Fri, 29 Jun 2001 17:59:19 +0000 To: kde-devel Subject: Re: KJanusWidget use X-MARC-Message: https://marc.info/?l=kde-devel&m=99383742425246 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 <<