summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/filedialogurls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/filedialogurls.cpp')
-rw-r--r--doc/src/snippets/filedialogurls.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/src/snippets/filedialogurls.cpp b/doc/src/snippets/filedialogurls.cpp
new file mode 100644
index 0000000..4b59590
--- /dev/null
+++ b/doc/src/snippets/filedialogurls.cpp
@@ -0,0 +1,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();
+}