Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. import sys
  2. from PyQt5.QtWidgets import *
  3. from PyQt5 import QtGui, QtWidgets
  4. from PyQt5.QtCore import *
  5.  
  6. class Button(QPushButton):
  7. def __init__(self, text, parent):
  8. super().__init__(text, parent=parent or None)
  9. self.setSizePolicy ( QSizePolicy.Expanding, QSizePolicy.Expanding)
  10.  
  11. class App(QMainWindow):
  12.  
  13. def __init__(self):
  14. super().__init__()
  15. self.initUI()
  16.  
  17. def initUI(self):
  18. leftpanel = QTreeView()
  19. rightpanel = QTreeView()
  20.  
  21. boxes = QGridLayout()
  22. boxes.addWidget(leftpanel, 0,0)
  23. boxes.addWidget(rightpanel, 0,1)
  24.  
  25. mainlayout = QVBoxLayout()
  26. mainlayout.addLayout(boxes)
  27. mainlayout.addWidget(QComboBox())
  28. mainlayout.addWidget(QPushButton('Kopiuj'))
  29.  
  30. buttons = QGridLayout()
  31. for i, t in enumerate (['F3 - Podgląd', 'F4 - Edycja']):
  32. buttons.addWidget(QPushButton(t), 0,i)
  33.  
  34. mainlayout.addLayout(buttons)
  35.  
  36. window = QWidget()
  37. window.setLayout(mainlayout)
  38.  
  39. self.setCentralWidget(window)
  40. self.setWindowTitle('Total Commander')
  41. self.setGeometry(300, 300, 350, 250)
  42. self.statusBar().showMessage('Podaj cyfrę/liczbę')
  43. self.show()
  44.  
  45. if __name__ == '__main__':
  46.  
  47. app = QApplication(sys.argv)
  48. ex = App()
  49. sys.exit(app.exec_())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement