[PyKDE] splitter problem in child window (newbee) The solution

William Famy william.famy at laposte.net
Sat Apr 26 11:08:01 BST 2003


The answer.

thank for peaple who answer me.

******************

I'm not sure what you're trying to do exactly, but you can try using
layouts
to arrange your widgets. Take the QHBoxLayout for example. Create this a
child of your widget and then use methods like QHBoxLayout::addWidget
and
QHBoxLayout::addLayout to add stuff to it. Is something like this what
you
had in mind?

from qt import *
import sys

class MainWin(QWidget):
        def __init__(self, *args):
                apply(QWidget.__init__, (self,)+args)
                layout = QHBoxLayout(self)
                self.s1 = win(self)     
                layout.addWidget(self.s1)
                self.setCaption('test de splitter')

class win(QFrame):
        def __init__(self, *args):
                apply(QFrame.__init__, (self,)+args)
                layout = QHBoxLayout(self)
                self.box = QSplitter(QSplitter.Vertical, self)
                layout.addWidget(self.box)
                s1 = QSplitter(self.box)
                s2 = QSplitter(self.box)
                b1 = QPushButton('b1', s1)
                b2 = QPushButton('b2', s1)
                b3 = QPushButton('b3', s2)
-- 
William.famy at laposte.net 
"Nothing would please me more than being able to hire ten
programmers and deluge the hobby market with good software."
  --Bill Gates 1976--	 Nous attendons toujours...   
          
	     		



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030426/5b149b88/attachment.bin


More information about the PyQt mailing list