QQuickRenderControl OpenGL サンプル
Qt Quick のシーンをテクスチャにレンダリングし、そのテクスチャをQuickベースではないOpenGLレンダラーで使用する方法について説明します。

Qt Quick のシーンは、画面上に表示されないQQuickWindow によって管理されます。代わりに、レンダリングはOpenGLテクスチャを対象とし、QQuickRenderControl を通じて制御されます。
立方体は、QWindow 、QOpenGLContext 、QOpenGLShaderProgram 、QOpenGLFunctions といったQt GUIイネーブラーを使用して、OpenGLで直接レンダリングされます。立方体には、Qt Quick のレンダリングパスが出力するテクスチャが適用されます。
さらに、基本的な入力イベントの転送も実演されています。マウスの左ボタンを押したままにすると、QMLバインディングを介して背景のRectangle の色が変更されます。 同様に、キーボードのキーを押し続けると、色も変化します。これは、アプリケーションから送信される「擬似」イベント(画面上のQWindow からのイベントに基づいて生成されたもの)が、Qt Quick シーン内で転送され、処理されることを実証しています。
© 2026 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.