from PyQt5 import QtCore,QtGui
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import sys
class Csplitter(QtGui.QMainWindow):
def __init__(self,parent=None):
super(Csplitter,self).__init__(parent)
self.resize(400,400)
self.setWindowTitle('Pyqt Qsplitter')
self.textedit = QTextEdit()
self.textedit.setText("This is a TextEdit!")
self.listwidget = QListWidget()
self.listwidget.addItem("This is a \nListWidget!")
self.listwidget.addItem("aaaaaaaaaaaaaaa")
self.treewidget = QTreeWidget()
self.treewidget.setHeaderLabels(['This','is','a','TreeWidgets!'])
splitter = QSplitter(self)
splitter.addWidget(self.textedit)
splitter.addWidget(self.listwidget)
splitter.addWidget(self.treewidget)
splitter.setOrientation(Qt.Vertical)
self.setCentralWidget(splitter)
if __name__ == '__main__':
app= QtGui.QApplication(sys.argv)
main = Csplitter()
main.show()
sys.exit(app.exec_())