I'd like to use QStackedLayout to put some QLineEdit widgets in, with only one visible at a time. For some reason, whenever I put a widget inside a QStackedLayout, it displays much taller than it normally would. Below is a small example to demonstrate this -- compare the height of the QLineEdit outside the QStackedLayout vs. the one inside.
Screenshot here: http://www.netdepot.org/personal/qstackedlayout_demo.png Why does this happen? How can I prevent it? ################################################################# from PyQt4 import QtCore, QtGui import sys class MyDialog(QtGui.QDialog): def __init__(self, parent=None): super(MyDialog, self).__init__(parent) lineEdit1 = QtGui.QLineEdit("lineEdit1") lineEdit2 = QtGui.QLineEdit("lineEdit2") stackedLayout = QtGui.QStackedLayout() stackedLayout.addWidget(lineEdit2) mainLayout = QtGui.QHBoxLayout() mainLayout.addWidget(lineEdit1) mainLayout.addLayout(stackedLayout) self.setLayout(mainLayout) self.setWindowTitle("QStackedLayout demo") if __name__ == "__main__": app = QtGui.QApplication(sys.argv) dialog = MyDialog() dialog.show() app.exec_()
_______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt