QPaintDeviceWindow Class
Convenience subclass of QWindow that is also a QPaintDevice. More...
Header: | #include <QPaintDeviceWindow> |
Inherits: | QWindow and QPaintDevice |
Inherited By: |
Public Functions
Public Slots
void | update() |
Protected Functions
QPaintDeviceWindow(QPaintDeviceWindowPrivate &dd, QWindow *parent) |
Reimplemented Protected Functions
virtual bool | event(QEvent *event) override |
virtual void | exposeEvent(QExposeEvent *exposeEvent) override |
virtual int | metric(PaintDeviceMetric metric) const override |
virtual void | paintEvent(QPaintEvent *event) override |
Detailed Description
\inmodule
QtGui \since
5.4
QPaintDeviceWindow is like a regular QWindow, with the added functionality of being a paint device too. Whenever the content needs to be updated, the virtual paintEvent() function is called. Subclasses, that reimplement this function, can then simply open a QPainter on the window.
Note: This class cannot directly be used in applications. It rather serves as a base for subclasses like QOpenGLWindow.
See also QOpenGLWindow.
Member Function Documentation
[protected]
QPaintDeviceWindow::QPaintDeviceWindow(QPaintDeviceWindowPrivate &dd, QWindow *parent)
\internal
[override virtual protected]
bool QPaintDeviceWindow::event(QEvent *event)
Reimplements: QWindow::event(QEvent *ev).
\internal
[override virtual protected]
void QPaintDeviceWindow::exposeEvent(QExposeEvent *exposeEvent)
Reimplements: QWindow::exposeEvent(QExposeEvent *ev).
\internal
[override virtual protected]
int QPaintDeviceWindow::metric(PaintDeviceMetric metric) const
Reimplements: QPaintDevice::metric(PaintDeviceMetric metric) const.
\internal
[override virtual protected]
void QPaintDeviceWindow::paintEvent(QPaintEvent *event)
Reimplements: QWindow::paintEvent(QPaintEvent *ev).
Handles paint events passed in the event parameter.
The default implementation does nothing. Reimplement this function to perform painting. If necessary, the dirty area is retrievable from the event.
void QPaintDeviceWindow::update(const QRect &rect)
Marks the rect of the window as dirty and schedules a repaint.
Note: Subsequent calls to this function before the next paint event will get ignored, but rect is added to the region to update.
Note: For non-exposed windows the update is deferred until the window becomes exposed again.
void QPaintDeviceWindow::update(const QRegion ®ion)
Marks the region of the window as dirty and schedules a repaint.
Note: Subsequent calls to this function before the next paint event will get ignored, but region is added to the region to update.
Note: For non-exposed windows the update is deferred until the window becomes exposed again.
[slot]
void QPaintDeviceWindow::update()
Marks the entire window as dirty and schedules a repaint.
Note: Subsequent calls to this function before the next paint event will get ignored.
Note: For non-exposed windows the update is deferred until the window becomes exposed again.