- Qt 6.9
- QDoc Manual
- Macros
- \youtube
- Qt 6.9.0 Reference Documentation

Tabbed Content ◦ Miscellaneous Macros

# \youtube

When generating online documentation, embeds a YouTube video in the HTML. When generating offline documentation (.qch), adds an external link to the video with a thumbnail image. The HTML docs show a thumbnail of the video with a play button. You need to save the thumbnail in `\images\extraimages\` in your project folder.

Use the following URL to open the thumbnail image in a browser: `https://img.youtube.com/vi/<ID>/0.jpg`. The `<ID>` is the ID of the video on YouTube. For example, if the URL to the video is `https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be`, the ID is `dQw4w9WgXcQ`. Save the image file as `dQw4w9WgXcQ.jpg`.

You must add the filename of the thumbnail file to `\images\extraimages\extraimages.qdocconf`. For example:

     {HTML.extraimages,qhp.qtdesignstudio.extraFiles} += \
         images/dQw4w9WgXcQ.jpg

To add a link to the video in text, write:

     \youtube dQw4w9WgXcQ

See also Macros.

Tabbed Content ◦ Miscellaneous Macros