From 27a9bfb88c7b5db17489d4847c004bd01626326e Mon Sep 17 00:00:00 2001
From: lvs <3354650692@qq.com>
Date: Sat, 18 Jun 2022 10:51:03 +0800
Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=9D=A1=E5=92=8C=E8=A7=86?=
=?UTF-8?q?=E9=A2=91=E8=AE=A1=E6=97=B6=E5=8A=9F=E8=83=BD=E7=9A=84=E5=AE=9E?=
=?UTF-8?q?=E7=8E=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/qt/.idea/.gitignore | 8 ++++++
.../inspectionProfiles/profiles_settings.xml | 6 ++++
src/qt/.idea/misc.xml | 4 +++
src/qt/.idea/modules.xml | 8 ++++++
src/qt/.idea/qt.iml | 12 ++++++++
src/qt/.idea/vcs.xml | 6 ++++
src/qt/findpath_UI.py | 28 ++++++++++++-------
7 files changed, 62 insertions(+), 10 deletions(-)
create mode 100644 src/qt/.idea/.gitignore
create mode 100644 src/qt/.idea/inspectionProfiles/profiles_settings.xml
create mode 100644 src/qt/.idea/misc.xml
create mode 100644 src/qt/.idea/modules.xml
create mode 100644 src/qt/.idea/qt.iml
create mode 100644 src/qt/.idea/vcs.xml
diff --git a/src/qt/.idea/.gitignore b/src/qt/.idea/.gitignore
new file mode 100644
index 0000000..35410ca
--- /dev/null
+++ b/src/qt/.idea/.gitignore
@@ -0,0 +1,8 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/src/qt/.idea/inspectionProfiles/profiles_settings.xml b/src/qt/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/src/qt/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/qt/.idea/misc.xml b/src/qt/.idea/misc.xml
new file mode 100644
index 0000000..d6c20c7
--- /dev/null
+++ b/src/qt/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/qt/.idea/modules.xml b/src/qt/.idea/modules.xml
new file mode 100644
index 0000000..45b9f23
--- /dev/null
+++ b/src/qt/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/qt/.idea/qt.iml b/src/qt/.idea/qt.iml
new file mode 100644
index 0000000..a8a0ef9
--- /dev/null
+++ b/src/qt/.idea/qt.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/qt/.idea/vcs.xml b/src/qt/.idea/vcs.xml
new file mode 100644
index 0000000..b2bdec2
--- /dev/null
+++ b/src/qt/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/qt/findpath_UI.py b/src/qt/findpath_UI.py
index 8cb4358..596ef8b 100644
--- a/src/qt/findpath_UI.py
+++ b/src/qt/findpath_UI.py
@@ -9,6 +9,7 @@
from PyQt5 import QtCore, QtGui, QtWidgets
+from PyQt5.QtCore import QTimer
from PyQt5.QtMultimediaWidgets import QVideoWidget
from PyQt5.QtMultimedia import QMediaContent, QMediaPlayer
from PyQt5.QtWidgets import QFileDialog
@@ -71,6 +72,7 @@ class Ui_MainWindow1(object):
self.sld_duration.setGeometry(QtCore.QRect(20, 20, 1051, 22))
self.sld_duration.setOrientation(QtCore.Qt.Horizontal)
self.sld_duration.setObjectName("sld_duration")
+ self.sld_duration.setEnabled(True)
self.lab_duration = QtWidgets.QLabel(self.frame_2)
self.lab_duration.setGeometry(QtCore.QRect(1100, 20, 81, 21))
font = QtGui.QFont()
@@ -111,12 +113,17 @@ class Ui_MainWindow1(object):
self.player = QMediaPlayer()
self.player.setVideoOutput(self.widget)
+ self.maxValue = 1000
+ self.timer = QTimer()
+ self.timer.start(1000)
+ self.timer.timeout.connect(lambda: self.onTimerOut())
self.actionl1.triggered.connect(lambda: self.openfile())
- self.displayTime()
self.pushButton_2.clicked.connect(lambda: self.playpause())
+
def openfile(self):
- self.player.setMedia(QMediaContent(QFileDialog.getOpenFileUrl()[0]))
+ media_list = QMediaContent(QFileDialog.getOpenFileUrl()[0])
+ self.player.setMedia(media_list)
self.player.play()
self.player.pause()
@@ -133,16 +140,17 @@ class Ui_MainWindow1(object):
icon9.addPixmap(QtGui.QPixmap("window_png/暂停.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton_2.setIcon(icon9)
self.pushButton_2.setIconSize(QtCore.QSize(50, 50))
- def getms(self):
- a = self.player.duration()
- self.sld_duration.setRange(0, a)
- self.sld_duration.setEnabled(True)
- return a
- def displayTime(self):
- ms = self.getms()
+
+ def onTimerOut(self):
+ alltime = self.player.duration()
+ ms = self.player.position()
minutes = int(ms / 60000)
seconds = int((ms - minutes * 60000) / 1000)
- self.lab_duration.setText('{}:{}'.format(minutes, seconds))
+ minute = int(alltime / 60000)
+ sec = int((alltime - minute * 60000) / 1000)
+ self.lab_duration.setText('{}:{}/{}:{}'.format(minutes, seconds, minute, sec))
+ self.sld_duration.setMaximum(alltime)
+ self.sld_duration.setValue(ms)
def retranslateUi(self, MainWindow):