Guest User

Untitled

a guest
Apr 24th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. import sys
  2. from PyQt5.QtWidgets import (QWidget,
  3. QVBoxLayout, QHBoxLayout, QApplication, QPushButton, QLabel, QLineEdit)
  4. from PyQt5 import*
  5. from PyQt5.QtGui import *
  6. from PyQt5.QtCore import *
  7. from PyQt5.QtWidgets import *
  8.  
  9. class Example(QWidget):
  10.  
  11. def __init__(self):
  12. super().__init__()
  13.  
  14. self.initUI()
  15.  
  16.  
  17. def initUI(self):
  18. font=QtGui.QFont("00コミック7",20)
  19.  
  20. btn1=QPushButton("1")
  21. btn1.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
  22.  
  23. btn2=QPushButton("2")
  24. btn2.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
  25.  
  26. btn3=QPushButton("3")
  27. btn3.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
  28.  
  29. btn4=QPushButton("4")
  30. btn4.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
  31.  
  32.  
  33. layout=QHBoxLayout()
  34.  
  35. layout2=QVBoxLayout()
  36. layout2.addWidget(btn2)
  37. layout2.addWidget(btn3)
  38. qw = QtWidgets.QWidget(self)
  39. qw.setLayout(layout2)
  40.  
  41. layout.addWidget(btn1)
  42. layout.addWidget(qw)
  43. layout.addWidget(btn4)
  44. layout.addLayout(layout2)
  45.  
  46. self.setLayout(layout)
  47.  
  48. self.setWindowTitle('Absolute')
  49. self.show()
  50.  
  51.  
  52. if __name__ == '__main__':
  53.  
  54. app = QApplication(sys.argv)
  55. ex = Example()
  56. sys.exit(app.exec_())
Add Comment
Please, Sign In to add comment