×
Namespaces

Variants
Actions

Watching a YouTube video in Qt

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 3rd Edition, FP1, FP2
S60 5th Edition
Symbian
Article
Keywords: QDesktopServices
Created: tepaa (04 Jun 2009)
Last edited: hamishwillee (11 Oct 2012)

Contents

Overview

This code snippet demonstrates how to use QDesktopServices for showing a video from the http://www.youtube.com/ website.

Note: In order to use this code, you need to have Qt installed on your platform.


Header

#include <QDesktopServices>
#include <QUrl>

Source

Set the YouTube video link in QUrl and give it as a parameter in QDesktopServices::openUrl():

QUrl videoUrl("http://www.youtube.com/watch?v=GhTtsZATwBQ");
QDesktopServices::openUrl(videoUrl);


See also

Using common desktop services in Qt


Postconditions

QDesktopServices shows a video from YouTube.

This page was last modified on 11 October 2012, at 04:19.
56 page views in the last 30 days.
×