diff options
author | David Boddie <dboddie@trolltech.com> | 2009-03-30 16:11:04 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-03-30 16:11:04 (GMT) |
commit | 577853b93dd4cf848abbd95abfed7e5a9d48688b (patch) | |
tree | 3aa5752a29c7ed41bc2abd772a9b0bb67fab698a | |
parent | 87f1ea14ae7e245dd7589b1d992f67b0058ae1b5 (diff) | |
download | Qt-577853b93dd4cf848abbd95abfed7e5a9d48688b.zip Qt-577853b93dd4cf848abbd95abfed7e5a9d48688b.tar.gz Qt-577853b93dd4cf848abbd95abfed7e5a9d48688b.tar.bz2 |
Doc: Added a code snippet to illustrate the opening of local files.
Task-number: 223087
Reviewed-by: TrustMe
-rw-r--r-- | doc/src/snippets/code/src_gui_util_qdesktopservices.cpp | 5 | ||||
-rw-r--r-- | src/gui/util/qdesktopservices.cpp | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp b/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp index a9c630b..5001984 100644 --- a/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp +++ b/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp @@ -11,7 +11,10 @@ public slots: QDesktopServices::setUrlHandler("help", helpInstance, "showHelp"); //! [0] - //! [1] mailto:user@foo.com?subject=Test&body=Just a test //! [1] + +//! [2] +QDesktopServices::openUrl(QUrl("file:///C:/Documents and Settings/All Users/Desktop", QUrl::TolerantMode)); +//! [2] diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index 0fe1d69..84aa16e 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -157,6 +157,11 @@ void QOpenUrlHandlerRegistry::handlerDestroyed(QObject *handler) If the URL is a reference to a local file (i.e., the URL scheme is "file") then it will be opened with a suitable application instead of a Web browser. + The following example opens a file on the Windows file system residing on a path + that contains spaces: + + \snippet doc/src/snippets/code/src_gui_util_qdesktopservices.cpp 2 + If a \c mailto URL is specified, the user's e-mail client will be used to open a composer window containing the options specified in the URL, similar to the way \c mailto links are handled by a Web browser. |