QPaintEvent Class
QPaintEvent 클래스에는 페인트 이벤트에 대한 이벤트 매개변수가 포함되어 있습니다. 더 보기...
Header: | #include <QPaintEvent> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
상속합니다: | QEvent |
- 상속된 멤버를 포함한 모든 멤버 목록
- QPaintEvent는 이벤트 클래스의 일부입니다.
공용 함수
QPaintEvent(const QRect &paintRect) | |
QPaintEvent(const QRegion &paintRegion) | |
const QRect & | rect() const |
const QRegion & | region() const |
상세 설명
페인트 이벤트는 커버 위젯이 이동되어 위젯의 일부가 노출된 경우와 같이 자체 업데이트가 필요한 위젯에 전송됩니다.
이벤트에는 업데이트해야 하는 region()와 해당 영역의 경계 사각형인 rect()가 포함됩니다. 많은 위젯이 region()를 많이 사용할 수 없고 rect()가 region().boundingRect()보다 훨씬 빠를 수 있기 때문에 두 가지를 모두 제공합니다.
자동 클리핑
페인트 이벤트를 처리하는 동안 페인팅은 region()로 클리핑됩니다. 이 클리핑은 Qt의 페인트 시스템에 의해 수행되며 페인트 장치에 그리는 데 사용되는 QPainter 에 적용될 수 있는 클리핑과는 독립적입니다.
따라서 새로 구성된 QPainter 에서 QPainter::clipRegion()가 반환하는 값은 페인트 시스템에서 사용하는 클립 영역을 반영하지 않습니다.
QPainter, QWidget::update(), QWidget::repaint() 및 QWidget::paintEvent()도 참조하세요 .
멤버 함수 문서
[explicit]
QPaintEvent::QPaintEvent(const QRect &paintRect)
업데이트해야 하는 사각형으로 페인트 이벤트 객체를 생성합니다. 영역은 paintRect 로 지정됩니다.
[explicit]
QPaintEvent::QPaintEvent(const QRegion &paintRegion)
업데이트가 필요한 지역으로 페인트 이벤트 객체를 생성합니다. 지역은 paintRegion 로 지정됩니다.
const QRect &QPaintEvent::rect() const
업데이트해야 하는 사각형을 반환합니다.
region() 및 QPainter::setClipRect()도 참조하세요 .
const QRegion &QPaintEvent::region() const
업데이트가 필요한 지역을 반환합니다.
rect() 및 QPainter::setClipRegion()도 참조하세요 .
© 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.