How to Launch Web Browser: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[[Category:snippets]]<br />[[Category:HowTo]]
[[Category:snippets]]
[[Category:HowTo]]


'''English''' | [[How_to_Launch_Web_Browser_German|Deutsch]] | [[How_to_Launch_Web_Browser_Bulgarian|Български]] | [[How_to_Launch_Web_Browser_Russian|Русский]] | [[How_to_Launch_Web_Browser_SimplifiedChinese|简体中文]]
'''English''' | [[How_to_Launch_Web_Browser_German|Deutsch]] | [[How_to_Launch_Web_Browser_Bulgarian|Български]] | [[How_to_Launch_Web_Browser_Russian|Русский]] | [[How_to_Launch_Web_Browser_SimplifiedChinese|简体中文]]
Line 5: Line 6:
= How to Launch Web Browser =
= How to Launch Web Browser =


The class &quot;QDesktopServices&amp;quot;:http://doc.qt.io/qt-5.0/qtgui/qdesktopservices.html provides methods for accessing common desktop services such as opening a URL in the default web browser.
The class "QDesktopServices":http://doc.qt.io/qt-5.0/qtgui/qdesktopservices.html provides methods for accessing common desktop services such as opening a URL in the default web browser.


Please do not forget to include the following header files:<br /><code><br />#include &lt;QDesktopServices&amp;gt;<br />#include &lt;QUrl&amp;gt;<br /></code>
Please do not forget to include the following header files:
<code>
#include <QDesktopServices>
#include <QUrl>
</code>


<code><br />QDesktopServices::openUrl(QUrl(&quot;https://qt.io/&amp;quot;));<br /></code>
<code>
QDesktopServices::openUrl(QUrl("https://qt.io/"));
</code>


== References ==
== References ==

Revision as of 09:49, 25 February 2015


English | Deutsch | Български | Русский | 简体中文

How to Launch Web Browser

The class "QDesktopServices":http://doc.qt.io/qt-5.0/qtgui/qdesktopservices.html provides methods for accessing common desktop services such as opening a URL in the default web browser.

Please do not forget to include the following header files:

#include <QDesktopServices>
#include <QUrl>
QDesktopServices::openUrl(QUrl("https://qt.io/"));

References