このページでは

Qt Graphs ウィジェット

QML アプリケーションのみをビルドする際に、QtWidgets への強固な依存関係を避けるため、ウィジェットのサポートは専用のモジュールに含まれています。

モジュールの使用

Qt モジュールの C++ API を使用するには、直接、あるいは他の依存関係を通じて、モジュールライブラリに対してリンクを行う必要があります。CMakeやqmake など、いくつかのビルドツールには、これを専用の機能としてサポートするものが含まれています。

CMake を使用したビルド

`find_package() ` コマンドを使用して、Qt6 パッケージ内の必要なモジュールコンポーネントを指定します。

find_package(Qt6 REQUIRED COMPONENTS GraphsWidgets)
target_link_libraries(mytarget PRIVATE Qt6::GraphsWidgets)

詳細については、「CMake を使用したビルド」の概要を参照してください。

qmake を使用したビルド

qmake を使用してモジュールをビルドするように設定するには、プロジェクトの .pro ファイル内で、QT 変数の値としてモジュールを追加します:

QT += graphswidgets

APIリファレンス

ライセンスおよび帰属表示

Qt Graphs Qt Widgets は、The Qt Company から商用ライセンスで提供されています。また、GNU General Public License バージョン 3 のもとでも利用可能です。詳細については、「Qt ライセンス」を参照してください。

© 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.