- Proves de python per al editor
This commit is contained in:
42
editor/test.py
Normal file
42
editor/test.py
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import sys
|
||||||
|
from PyQt5 import QtCore, QtWidgets
|
||||||
|
|
||||||
|
class Example(QtWidgets.QWidget):
|
||||||
|
def __init__(self):
|
||||||
|
super(Example, self).__init__()
|
||||||
|
self.initUI()
|
||||||
|
|
||||||
|
def initUI(self):
|
||||||
|
hbox = QtWidgets.QHBoxLayout(self)
|
||||||
|
|
||||||
|
left = QtWidgets.QFrame(self)
|
||||||
|
left.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
|
||||||
|
mid = QtWidgets.QFrame(self)
|
||||||
|
mid.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
|
||||||
|
right = QtWidgets.QFrame(self)
|
||||||
|
right.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
|
||||||
|
splitter = QtWidgets.QSplitter(QtCore.Qt.Horizontal)
|
||||||
|
splitter.addWidget(left)
|
||||||
|
splitter.addWidget(mid)
|
||||||
|
splitter.addWidget(right)
|
||||||
|
splitter.setStretchFactor(1, 1)
|
||||||
|
splitter.setSizes([250, 640, 250])
|
||||||
|
|
||||||
|
hbox.addWidget(splitter)
|
||||||
|
self.setLayout(hbox)
|
||||||
|
|
||||||
|
QtWidgets.QApplication.setStyle(QtWidgets.QStyleFactory.create('Cleanlooks'))
|
||||||
|
self.resize(500+640, 700)
|
||||||
|
self.setWindowTitle('QtGui.QSplitter')
|
||||||
|
self.show()
|
||||||
|
|
||||||
|
def main():
|
||||||
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
|
ex = Example()
|
||||||
|
sys.exit(app.exec_())
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
Reference in New Issue
Block a user