\youtube
生成在线文档时,在 HTML 中嵌入 YouTube 视频。生成离线文档(.qch)时,添加视频的外部链接,并显示缩略图。HTML 文档会显示带有播放按钮的视频缩略图。您需要将缩略图保存在项目文件夹中的\images\extraimages\
中。
使用以下 URL 在浏览器中打开缩略图:https://img.youtube.com/vi/<ID>/0.jpg
.<ID>
是 YouTube 上视频的 ID。例如,如果视频的 URL 是https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be
,ID 就是dQw4w9WgXcQ
。将图像文件保存为dQw4w9WgXcQ.jpg
。
您必须在\images\extraimages\extraimages.qdocconf
中添加缩略图文件的文件名。例如
{HTML.extraimages,qhp.qtdesignstudio.extraFiles} += \ images/dQw4w9WgXcQ.jpg
要在文本中添加视频链接,请写下
\youtube dQw4w9WgXcQ
另请参阅 宏。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.