public:
    QString fileName;
public slots:
    void showImage();

1、添加两个头文件

#include<qfiledialog.h>
#include<qstring.h>

2、QFileDialog::getOpenFileName

槽函数中加入:

    QString lastPath="D:\Englishpath\QTprojects\DATA\videoData";
    QString fileName = QFileDialog::getOpenFileName(this, tr("打开文件"), lastPath);

 

connect:

    connect(ui->m_openFile,SIGNAL(clicked(bool)),this,SLOT(showImage()));

 

相关文章:

  • 2022-01-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-01-31
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-04-01
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案