Ver Fonte

20200404307fengjunhao

15235997262 há 1 ano atrás
pai
commit
13208bf025
2 ficheiros alterados com 28 adições e 0 exclusões
  1. 28 0
      day04/monitor/main.py
  2. 0 0
      day04/monitor/ui/monitor.ui

+ 28 - 0
day04/monitor/main.py

@@ -0,0 +1,28 @@
+# 引入模块
+from PyQt5.QtWidgets import QApplication
+from PyQt5.QtWidgets import QDialog
+from PyQt5.QtWidgets import QMainWindow
+from PyQt5.QtWidgets import QPushButton
+
+# 创建Qt应用
+app = QApplication([])  # 参数:命令行参数
+"""
+    Qt的应用必须在App之间    
+"""
+# dlg = QDialog()
+dlg = QMainWindow()
+# 改变对话框的大小
+dlg.resize(1000,1000) # 设置窗体大小
+dlg.move(100,100)  # 设置窗体的位置
+dlg.setWindowTitle("我的窗体")
+
+# 创建一个按钮
+btn = QPushButton("登录", dlg)
+btn.resize(100, 36)
+btn.move(200,200)
+
+btn.show()
+
+dlg.show()
+
+app.exec()   # 让应用程序进入消息循环

+ 0 - 0
day04/monitor/ui/untitled.ui → day04/monitor/ui/monitor.ui