[PyKDE] QScrollView problem

Vio vmilitaru at sympatico.ca
Tue Apr 15 11:06:01 BST 2003


Greetings,
Could someone shead some light on this:

I have a class instance named Page which I want to display inside a 
ScrollView.

Page class is simply a group of a few widgets inside a QGridLayout, 
itself inside a QFrame - or, if you want, Page class inherits from 
QFrame. Nothing too complicated. Running Page by itself goes as 
expected, no problem there.

Now I want to display a Page object inside a ScrollView:

>class myScrollView(QScrollView):
>	def __init__(self,parent = None,name = None,fl = 0):
>		QScrollView.__init__(self,parent,name,fl)
>
>		self.enableClipper(TRUE)
>		self.child1 = page.Page(self.viewport())
>		self.addChild(self.child1)
>

Problem here is that only the first child widget of Page() gets 
displayed (or, to be more specific, the widget at 0,0 in the QGridLayout 
of Page()). I'm sending this to the list because I've tried a few 
variations on this theme, without any luck, so now I'm kind of clueless. 
A simple "lazy" workaround would be to simply 'cut&paste' the 
QGridLayout code from the Page class to myScrollView class, and display 
those widgets individually inside the myScrollView. But logically that 
piece of code belongs to Page() class, and I want to keep that grouped 
together, and work with a single object instead of six (less headaches 
at 5 in the morning :)
Any hints?

Cheers,
Vio





More information about the PyQt mailing list