Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

How to Launch Web Browser: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
(Sub-categorize)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:snippets]]<br />[[Category:HowTo]]
{{LangSwitch}}
[[Category:Snippets::Misc]]
[[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|简体中文]]
Please do not forget to include the following header files:
<code>
#include <QDesktopServices>
#include <QUrl>


= How to Launch Web Browser =
QDesktopServices::openUrl(QUrl("https://qt.io/"));
 
</code>
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.
 
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>
 
<code><br />QDesktopServices::openUrl(QUrl(&quot;https://qt.io/&amp;quot;));<br /></code>
 
== References ==

Latest revision as of 11:59, 28 November 2016

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:

#include <QDesktopServices>
#include <QUrl>

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