Hi!

Why all QGroupBoxs are stretchables when i rise size window in file1.txt 
without QStackWidget and not in file2.txt with QStackWidget?

How have all QGroupBoxs stretchables with QStackWidget?

-- 
alteo_gange
#!/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"))
                vbox.addWidget(group)
                
                group=QGroupBox("groupbox2")
                hbox=QHBoxLayout(group)
                hbox.addWidget(QLabel("label2"))
                vbox.addWidget(group)
                
                group=QGroupBox("groupbox3")
                hbox=QHBoxLayout(group)
                hbox.addWidget(QLabel("label3"))
                vbox.addWidget(group)
                
                self.setLayout(vbox)

if __name__ == "__main__":
        app = QApplication(sys.argv)
        main = Gui()
        main.show()
        sys.exit(app.exec_())
#!/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"))
                vbox.addWidget(group)
                
                stacked=QStackedWidget()
                
                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_())
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to