書籍
Qt SQL クラスをモデル/ビューフレームワークと組み合わせて使用する方法について説明します。
「Books」の例では、データベースに格納された情報に対してリッチなユーザーインターフェースを作成するために、Qt SQLクラスをモデル/ビューフレームワークと組み合わせて使用する方法を紹介しています。

書籍のコレクションに関する情報はデータベースに格納されています。書籍は著者、タイトル、ジャンル、出版年ごとに分類されています。これらの各フィールドは標準のウィジェットを使用して表示・編集できますが、書籍に対する任意の評価を表す追加のフィールドには、特別な処理が必要です。
書籍の評価は、各書籍に星の数を割り当てるシステムで行われます。星の数が多ければ多いほど、その書籍は評価が高いとみなされます。評価が格納されているセルをクリックすることで、星の数を変更でき、データベース内の評価も更新されます。
© 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.