guozihong 1 an în urmă
părinte
comite
299316cac1
5 a modificat fișierele cu 149 adăugiri și 5 ștergeri
  1. 14 5
      day3/codes/ex_qt01.py
  2. 4 0
      day4/monitor/main.py
  3. 67 0
      day4/monitor/ui/monitor.ui
  4. 48 0
      day4/monitor/ui/monitor_ui.py
  5. 16 0
      readme.md

+ 14 - 5
day3/codes/ex_qt01.py

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

+ 4 - 0
day4/monitor/main.py

@@ -0,0 +1,4 @@
+# pyuic5 -o monitor_ui.py monitor.ui
+# -o表示输出
+#monitor.ui我们设计的界面文件,这个文件只能翻译以后使用。
+#pyuic5是一个把ui文件翻译成py文件的工具

+ 67 - 0
day4/monitor/ui/monitor.ui

@@ -0,0 +1,67 @@
+<?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>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>智能交通监控系统</string>
+  </property>
+  <property name="styleSheet">
+   <string notr="true">border-width:1px;
+border-style:solid;
+border-color:white;
+border-radius:10px;</string>
+  </property>
+  <widget class="QLabel" name="label">
+   <property name="geometry">
+    <rect>
+     <x>90</x>
+     <y>20</y>
+     <width>191</width>
+     <height>171</height>
+    </rect>
+   </property>
+   <property name="styleSheet">
+    <string notr="true">border-width:1px;
+border-style:solid;
+border-color:blue;
+border-radius:10px;</string>
+   </property>
+   <property name="text">
+    <string>视频显示区</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton">
+   <property name="geometry">
+    <rect>
+     <x>80</x>
+     <y>202</y>
+     <width>75</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="styleSheet">
+    <string notr="true">border-width:1px;
+border-style:solid;
+border-radius:10px;
+border-top-color:#ffffff;
+border-left-color:#ffffff;
+border-bottom-color:#888888;
+border-right-color:#bbbbbb;
+</string>
+   </property>
+   <property name="text">
+    <string>处理视频</string>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 48 - 0
day4/monitor/ui/monitor_ui.py

@@ -0,0 +1,48 @@
+# -*- 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(400, 300)
+        Dialog.setStyleSheet("border-width:1px;\n"
+"border-style:solid;\n"
+"border-color:white;\n"
+"border-radius:10px;")
+        self.label = QtWidgets.QLabel(Dialog)
+        self.label.setGeometry(QtCore.QRect(90, 20, 191, 171))
+        self.label.setStyleSheet("border-width:1px;\n"
+"border-style:solid;\n"
+"border-color:blue;\n"
+"border-radius:10px;")
+        self.label.setObjectName("label")
+        self.pushButton = QtWidgets.QPushButton(Dialog)
+        self.pushButton.setGeometry(QtCore.QRect(80, 202, 75, 41))
+        self.pushButton.setStyleSheet("border-width:1px;\n"
+"border-style:solid;\n"
+"border-radius:10px;\n"
+"border-top-color:#ffffff;\n"
+"border-left-color:#ffffff;\n"
+"border-bottom-color:#888888;\n"
+"border-right-color:#bbbbbb;\n"
+"")
+        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", "处理视频"))

+ 16 - 0
readme.md

@@ -0,0 +1,16 @@
+第三天
+**1.任务**
+    任务1:
+        -完成UI设计
+        -翻译成py文件
+    任务2:
+        -拍一个照片
+        -利用我们今天讲的Sobel算子,输出一个浮雕效果的图像照片
+**2.内容**
+- 图像处理
+- 卷积特征
+-Qt的应用编程模式
+-Qt的UI设计与翻译
+**3.要求**
+-理解卷积特征
+-写Qt程序