diff --git a/video/playffmpeg/widget.cpp b/video/playffmpeg/widget.cpp
index c293500..bfe028f 100644
--- a/video/playffmpeg/widget.cpp
+++ b/video/playffmpeg/widget.cpp
@@ -1,6 +1,7 @@
#pragma execution_character_set("utf-8")
#include "widget.h"
#include "ui_widget.h"
+#include "qfiledialog.h"
Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget)
{
@@ -20,6 +21,18 @@ Widget::~Widget()
delete ui;
}
+void Widget::on_btnSelect_clicked()
+{
+ QString fileName = QFileDialog::getOpenFileName();
+ if (!fileName.isEmpty()) {
+ ui->cboxUrl->addItem(fileName);
+ ui->cboxUrl->lineEdit()->setText(fileName);
+ if (ui->btnOpen->text() == "打开") {
+ on_btnOpen_clicked();
+ }
+ }
+}
+
void Widget::on_btnOpen_clicked()
{
if (ui->btnOpen->text() == "打开") {
diff --git a/video/playffmpeg/widget.h b/video/playffmpeg/widget.h
index 0d54597..8839d20 100644
--- a/video/playffmpeg/widget.h
+++ b/video/playffmpeg/widget.h
@@ -16,6 +16,7 @@ public:
~Widget();
private slots:
+ void on_btnSelect_clicked();
void on_btnOpen_clicked();
private:
diff --git a/video/playffmpeg/widget.ui b/video/playffmpeg/widget.ui
index 8caf843..6175dc2 100644
--- a/video/playffmpeg/widget.ui
+++ b/video/playffmpeg/widget.ui
@@ -6,7 +6,7 @@
0
0
- 700
+ 800
600
@@ -39,6 +39,13 @@
+ -
+
+
+ 选择
+
+
+
-
diff --git a/video/plaympv/widget.cpp b/video/plaympv/widget.cpp
index aa2b67c..191a241 100644
--- a/video/plaympv/widget.cpp
+++ b/video/plaympv/widget.cpp
@@ -1,6 +1,7 @@
#pragma execution_character_set("utf-8")
#include "widget.h"
#include "ui_widget.h"
+#include "qfiledialog.h"
Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget)
{
@@ -19,6 +20,18 @@ Widget::~Widget()
delete ui;
}
+void Widget::on_btnSelect_clicked()
+{
+ QString fileName = QFileDialog::getOpenFileName();
+ if (!fileName.isEmpty()) {
+ ui->cboxUrl->addItem(fileName);
+ ui->cboxUrl->lineEdit()->setText(fileName);
+ if (ui->btnOpen->text() == "打开") {
+ on_btnOpen_clicked();
+ }
+ }
+}
+
void Widget::on_btnOpen_clicked()
{
if (ui->btnOpen->text() == "打开") {
diff --git a/video/plaympv/widget.h b/video/plaympv/widget.h
index 0d54597..8839d20 100644
--- a/video/plaympv/widget.h
+++ b/video/plaympv/widget.h
@@ -16,6 +16,7 @@ public:
~Widget();
private slots:
+ void on_btnSelect_clicked();
void on_btnOpen_clicked();
private:
diff --git a/video/plaympv/widget.ui b/video/plaympv/widget.ui
index 3419f47..70b7a8f 100644
--- a/video/plaympv/widget.ui
+++ b/video/plaympv/widget.ui
@@ -6,7 +6,7 @@
0
0
- 700
+ 800
600
@@ -39,6 +39,13 @@
+ -
+
+
+ 选择
+
+
+
-
diff --git a/video/playvlc/widget.cpp b/video/playvlc/widget.cpp
index aa2b67c..a928dda 100644
--- a/video/playvlc/widget.cpp
+++ b/video/playvlc/widget.cpp
@@ -19,6 +19,18 @@ Widget::~Widget()
delete ui;
}
+void Widget::on_btnSelect_clicked()
+{
+ QString fileName = QFileDialog::getOpenFileName();
+ if (!fileName.isEmpty()) {
+ ui->cboxUrl->addItem(fileName);
+ ui->cboxUrl->lineEdit()->setText(fileName);
+ if (ui->btnOpen->text() == "打开") {
+ on_btnOpen_clicked();
+ }
+ }
+}
+
void Widget::on_btnOpen_clicked()
{
if (ui->btnOpen->text() == "打开") {
diff --git a/video/playvlc/widget.h b/video/playvlc/widget.h
index 0d54597..8839d20 100644
--- a/video/playvlc/widget.h
+++ b/video/playvlc/widget.h
@@ -16,6 +16,7 @@ public:
~Widget();
private slots:
+ void on_btnSelect_clicked();
void on_btnOpen_clicked();
private:
diff --git a/video/playvlc/widget.ui b/video/playvlc/widget.ui
index b289ab8..78a53a0 100644
--- a/video/playvlc/widget.ui
+++ b/video/playvlc/widget.ui
@@ -6,7 +6,7 @@
0
0
- 700
+ 800
600
@@ -39,6 +39,13 @@
+ -
+
+
+ 选择
+
+
+
-