summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/filedialogurls.cpp
blob: 4b59590fc9ad7637a4b0614dbf0a406d7233f222 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

#include <QtGui>

int main(int argv, char **args)
{
    QApplication app(argv, args);
    
//![0]
    QList<QUrl> urls;
    urls << QUrl::fromLocalFile("/home/gvatteka/dev/qt-45")
         << QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::MusicLocation));

    QFileDialog dialog;
    dialog.setSidebarUrls(urls);
    dialog.setFileMode(QFileDialog::AnyFile);
    if(dialog.exec()) {
        // ...
    }
//![0]

    return app.exec();
}