QPaintDeviceWindow Class
QPaintDevice QWindow の便利なサブクラス。
ヘッダー | #include <QPaintDeviceWindow> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
を継承する: | QWindow そしてQPaintDevice |
によって継承される: |
パブリック関数
パブリックスロット
void | update() |
再実装された保護された関数
virtual void | paintEvent(QPaintEvent *event) override |
詳細説明
QPaintDeviceWindow は通常のQWindow のようなものですが、ペイント デバイスとしての機能も追加されています。コンテンツを更新する必要があるときはいつでも、仮想関数paintEvent() が呼び出されます。この関数を再実装したサブクラスは、単純にウィンドウ上でQPainter を開くことができます。
注意: このクラスはアプリケーションで直接使用することはできません。むしろ、QOpenGLWindow のようなサブクラスのベースとなります。
QOpenGLWindowも参照してください 。
メンバ関数ドキュメント
[override virtual protected]
void QPaintDeviceWindow::paintEvent(QPaintEvent *event)
再実装:QWindow::paintEvent(QPaintEvent *ev)。
event パラメータで渡されたペイントイベントを処理します。
デフォルトの実装は何もしません。この関数を再実装してペイントを実行します。必要に応じて、ダーティエリアはevent から取得可能です。
[slot]
void QPaintDeviceWindow::update()
ウィンドウ全体をダーティとしてマークし、再描画をスケジュールします。
注意: 次の描画イベントの前にこの関数を呼び出すと、無視されます。
注意 : 非露出ウィンドウの場合、更新はウィンドウが再び露出するまで延期されます。
void QPaintDeviceWindow::update(const QRect &rect)
ウィンドウのrect をダーティとしてマークし、再描画をスケジュールする。
注意: 次の描画イベントの前にこの関数を呼び出すと無視されますが、rect は更新する領域に追加されます。
注意 : 非露出ウィンドウの場合、更新はウィンドウが再び露出するまで延期されます。
void QPaintDeviceWindow::update(const QRegion ®ion)
ウィンドウのregion をダーティとしてマークし、再描画をスケジュールする。
注意: 次の描画イベントの前にこの関数を呼び出すと無視されますが、region は更新する領域に追加されます。
注意 : 非露出ウィンドウの場合、更新はウィンドウが再び露出するまで延期されます。
© 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.