How to launch a file browser in a Qt application ?

How to launch a file browser in a Qt application ?

Asked on January 9, 2019 in Qt.
Add Comment


  • 2 Answer(s)

    Launch a file browser in a Qt application:

        Just click this link .  QFileDialog::getOpenFileName

     

    Answered on January 9, 2019.
    Add Comment

    The alternative answer is:

    QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Open File"),"/path/to/file/",tr("Mp3 Files (*.mp3)"));
    ui->listWidget->addItems(fileNames);
    

    The *.mp3  displayed  only on  mp3 files  and  extract  the tr(“Mp3 Files (*.mp3)”)  to  clean  all files.

    Answered on January 9, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.