Difference between revisions of "How to Launch Web Browser"

From Qt Wiki
Jump to: navigation, search
(Convert ExpressionEngine links)
(Cleanup)
Line 1: Line 1:
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}
+
{{LangSwitch}}
 
 
 
[[Category:snippets]]
 
[[Category:snippets]]
 
[[Category:HowTo]]
 
[[Category:HowTo]]
 
+
The class {{DocLink|QDesktopServices}} provides methods for accessing common desktop services such as opening a URL in the default web browser.
'''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|简体中文]]
 
 
 
= How to Launch Web Browser =
 
 
 
The class [http://doc.qt.io/qt-5.0/qtgui/qdesktopservices.html QDesktopServices] 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:
 
Please do not forget to include the following header files:
Line 14: Line 8:
 
#include <QDesktopServices>
 
#include <QDesktopServices>
 
#include <QUrl>
 
#include <QUrl>
</code>
 
  
<code>
 
 
QDesktopServices::openUrl(QUrl("https://qt.io/"));
 
QDesktopServices::openUrl(QUrl("https://qt.io/"));
 
</code>
 
</code>
 
== References ==
 

Revision as of 19:02, 28 June 2015

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

The class QDesktopServices 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:

  1. include <QDesktopServices>
  2. include <QUrl>

QDesktopServices::openUrl(QUrl("https://qt.io/"));