[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] All QGroupBoxs stretchables with a QStackWidget?
From: alteo_gange <romanocaldoni () free ! fr>
Date: 2007-10-30 16:00:52
Message-ID: 200710301700.52327.romanocaldoni () free ! fr
[Download RAW message or body]
I'm sorry for the delay.
> Do you want them all to stretch as you resize the window?
Yes, i do.
It works with your method. Thanks!
An another method is:
I have added the method...
setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding))
... on the first QGroupBox and the QStackedWidget, in file2.txt:
#!/usr/bin/python
# -*- coding: Utf-8 -*-
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class Gui(QWidget):
def __init__(self):
QWidget.__init__(self)
vbox=QVBoxLayout(self)
group=QGroupBox("groupbox1")
hbox=QHBoxLayout(group)
hbox.addWidget(QLabel("label1"))
group.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,
QSizePolicy.Expanding))
vbox.addWidget(group)
stacked=QStackedWidget()
stacked.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,
QSizePolicy.Expanding))
group=QGroupBox("groupbox2")
hbox=QHBoxLayout(group)
hbox.addWidget(QLabel("label2"))
stacked.addWidget(group)
group=QGroupBox("groupbox3")
hbox=QHBoxLayout(group)
hbox.addWidget(QLabel("label3"))
stacked.addWidget(group)
vbox.addWidget(stacked)
self.setLayout(vbox)
if __name__ == "__main__":
app = QApplication(sys.argv)
main = Gui()
main.show()
sys.exit(app.exec_())
--
alteo_gange
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic