bang 1 vuosi sitten
vanhempi
commit
3626b4203f
5 muutettua tiedostoa jossa 147 lisäystä ja 0 poistoa
  1. 23 0
      Day3/codes/ex_qt01.py
  2. 10 0
      Day3/codes/notes
  3. 3 0
      Day4/monitor/main.py
  4. 64 0
      Day4/monitor/ui/monitor.ui
  5. 47 0
      Day4/monitor/ui/monitor_ui.py

+ 23 - 0
Day3/codes/ex_qt01.py

@@ -0,0 +1,23 @@
+#引入模块
+from PyQt5.QtWidgets import QApplication
+from PyQt5.QtWidgets import QDialog
+from PyQt5.QtWidgets import QMainWindow
+from PyQt5.QtWidgets import QPushButton
+
+#创建Qt应用
+app = QApplication([])
+
+
+dlg = QDialog()
+#改变对话框
+dlg.resize(1000,1000)
+dlg.move(100,100)
+dlg.setWindowTitle
+#创建一个按钮
+btu = QPushButton
+btu.resize(100,36)
+btu.move(200,200)
+
+btu.show()
+dlg.show()
+app.exe()

+ 10 - 0
Day3/codes/notes

@@ -0,0 +1,10 @@
+1.条件
+> 安装的模块:PyQt5,PyQt-tools
+2.开发一个窗体程序
+>2.1创建一个QApplication
+>2.2创建对话框
+    窗体:主窗体(菜单),对话框(无菜单),闪屏
+3.在窗体添加按钮,文本框,标签,多选按钮,单选按钮
+4.程序开发的结构(模式)
+  main.py  #程序入口
+  根目录

+ 3 - 0
Day4/monitor/main.py

@@ -0,0 +1,3 @@
+
+
+#

+ 64 - 0
Day4/monitor/ui/monitor.ui

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>492</width>
+    <height>440</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>智能交通监控系统</string>
+  </property>
+  <widget class="QLabel" name="label">
+   <property name="geometry">
+    <rect>
+     <x>80</x>
+     <y>50</y>
+     <width>121</width>
+     <height>131</height>
+    </rect>
+   </property>
+   <property name="styleSheet">
+    <string notr="true">border-width:5px;
+border-style:dotted;
+border-color:red;
+border-radius:10px;
+border-top-color:red;
+border-bottom-color:green;
+border-left-color:green;
+border-right-color:pink;</string>
+   </property>
+   <property name="text">
+    <string>视频</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton">
+   <property name="geometry">
+    <rect>
+     <x>210</x>
+     <y>340</y>
+     <width>93</width>
+     <height>28</height>
+    </rect>
+   </property>
+   <property name="styleSheet">
+    <string notr="true">border-width:2px;
+border-style:solid;
+border-radius:7px;
+border-left-color:#ffffff;
+border-top-color:#ffffff;
+border-bottom-color:#888888;
+border-right-color:#bbbbbb;</string>
+   </property>
+   <property name="text">
+    <string>改变监控</string>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 47 - 0
Day4/monitor/ui/monitor_ui.py

@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'monitor.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.9
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again.  Do not edit this file unless you know what you are doing.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+
+
+class Ui_Dialog(object):
+    def setupUi(self, Dialog):
+        Dialog.setObjectName("Dialog")
+        Dialog.resize(492, 440)
+        self.label = QtWidgets.QLabel(Dialog)
+        self.label.setGeometry(QtCore.QRect(80, 50, 121, 131))
+        self.label.setStyleSheet("border-width:5px;\n"
+"border-style:dotted;\n"
+"border-color:red;\n"
+"border-radius:10px;\n"
+"border-top-color:red;\n"
+"border-bottom-color:green;\n"
+"border-left-color:green;\n"
+"border-right-color:pink;")
+        self.label.setObjectName("label")
+        self.pushButton = QtWidgets.QPushButton(Dialog)
+        self.pushButton.setGeometry(QtCore.QRect(210, 340, 93, 28))
+        self.pushButton.setStyleSheet("border-width:2px;\n"
+"border-style:solid;\n"
+"border-radius:7px;\n"
+"border-left-color:#ffffff;\n"
+"border-top-color:#ffffff;\n"
+"border-bottom-color:#888888;\n"
+"border-right-color:#bbbbbb;")
+        self.pushButton.setObjectName("pushButton")
+
+        self.retranslateUi(Dialog)
+        QtCore.QMetaObject.connectSlotsByName(Dialog)
+
+    def retranslateUi(self, Dialog):
+        _translate = QtCore.QCoreApplication.translate
+        Dialog.setWindowTitle(_translate("Dialog", "智能交通监控系统"))
+        self.label.setText(_translate("Dialog", "视频"))
+        self.pushButton.setText(_translate("Dialog", "改变监控"))