qfedu-qt-level/DialogTest/widget.cpp

27 lines
517 B
C++
Raw Permalink Normal View History

2023-08-08 14:39:49 +08:00
#include "widget.h"
2023-08-13 11:47:17 +08:00
#include <QFileDialog>
#include <QString>
#include <QDebug>
2023-08-08 14:39:49 +08:00
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
2023-08-13 11:47:17 +08:00
this->resize(600,400);
button = new QPushButton("选择文件",this);
button->resize(100,100);
button->move(250,100);
connect(button,&QPushButton::clicked,[](){
// QString str = QFileDialog::getOpenFileName();
// qDebug()<<str;
QStringList str = QFileDialog::getOpenFileNames();
qDebug()<<str;
});
2023-08-08 14:39:49 +08:00
}
Widget::~Widget()
{
}