QStyleOptionGraphicsItem Class

QStyleOptionGraphicsItemクラスは、QGraphicsItem... 続きを読む

ヘッダー #include <QStyleOptionGraphicsItem>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
継承: QStyleOption

パブリックな型

enum StyleOptionType { Type }
enum StyleOptionVersion { Version }

パブリック関数

QStyleOptionGraphicsItem()
QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other)

パブリック変数

QRectF exposedRect

静的パブリックメンバ

qreal levelOfDetailFromTransform(const QTransform &worldTransform)

詳細説明

パフォーマンス上の理由から、メンバ関数はほとんどなく、メンバ変数へのアクセスは直接(つまり、. または-> 演算子を使用)です。これにより、構造体を簡単に使用できるようになり、これらは単にスタイル関数で使用されるパラメータであることが強調されます。

QStyleOption およびQGraphicsItem::paint()も参照の こと。

メンバ型ドキュメント

enum QStyleOptionGraphicsItem::StyleOptionType

この列挙型は、スタイル・オプションのタイプに関する情報を保持するために使われ、QStyleOption のサブクラスごとに定義される。

定数説明
QStyleOptionGraphicsItem::TypeSO_GraphicsItem提供されるスタイル・オプションの型 ( このクラスではSO_GraphicsItem )。

この型は、QStyleOption 、そのサブクラス、およびqstyleoption_cast() によって内部的に使用され、スタイル・オプションの型を決定します。一般に、独自のQStyleOption サブクラスと独自のスタイルを作成するのでなければ、これを気にする必要はありません。

StyleOptionVersionも参照してください

enum QStyleOptionGraphicsItem::StyleOptionVersion

この列挙型は、スタイルオプションのバージョンに関する情報を保持するために使用され、QStyleOption のサブクラスごとに定義されます。

定数説明
QStyleOptionGraphicsItem::Version11

このバージョンは、QStyleOption サブクラスが互換性を壊すことなく拡張を実装するために使用されます。qstyleoption_cast() を使用する場合、通常は確認する必要はありません。

StyleOptionTypeも参照

メンバ関数ドキュメント

QStyleOptionGraphicsItem::QStyleOptionGraphicsItem()

QStyleOptionGraphicsItem を構築します。

QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other)

other のコピーを作成する。

[static] qreal QStyleOptionGraphicsItem::levelOfDetailFromTransform(const QTransform &worldTransform)

worldTransform から詳細度を返します。

その値は、アイテムの描画に使用されたペインターのworldTransform を使用してマッピングされた、統一長方形の高さと幅の最大値を表します。デフォルトでは、変換が適用されていない場合、その値は 1 です。1:2 にズームアウトされた場合、詳細レベルは 0.5 になり、2:1 にズームインされた場合、その値は 2 になります。

QGraphicsScene::minimumRenderSize()も参照

メンバ変数のドキュメント

QRectF QStyleOptionGraphicsItem::exposedRect

この変数は、アイテムの座標で、露出した矩形を保持する。

アイテムの一部だけが露出している場合、この矩形を使用してアイテムの描画を高速化する。アイテム全体が露出している場合、この矩形はQGraphicsItem::boundingRect() と同じになる。

このメンバは、QGraphicsItem::ItemUsesExtendedStyleOption フラグが設定されているアイテムに対してのみ初期化される。

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