QMLプレビューアの例
QWidget::createWindowContainer() を使って、Qt Quick をQt Widgets アプリケーションと混在させる方法を示します。

この例では、Qt Widgets アプリケーションの中にQt Quick シーンを埋め込む方法と、Qt Widgets とQt Quick で異なる UI を統合する方法を示します。これには以下が含まれます:
- Qt Widgets 。Qt Quick
- Qt Widgets 。Qt Quick
- 埋め込み QML ファイルで定義されたショートカット
- QMLファイル内にQQuickView 。QLayout
例の実行
から例を実行するには Qt Creatorからサンプルを実行するには、Welcome モードを開き、Examples からサンプルを選択します。詳細については、Qt Creator:Tutorialを参照してください:ビルドと実行。
UIウォークスルー
サンプルのメインウィンドウの左側にはファイルブラウザがあり、QMLファイルを選択して プレビューすることができます。右側にはQMLのコンテンツがQQuickWidget 。ボタンをクリックしたり、テキストを入力したり、QMLファイルで定義されたショートカットを使ったりと、QMLのコンテンツを操作することができます。
また、この例では、Qt Widgets とQt Quick コンポーネント間のフォーカスや入力イベントの処理方法を示し、スムーズなユーザー体験を保証しています。
QWidget::createWindowContainer()も参照してください 。
© 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.