QRasterWindow Class
The QRasterWindow class is a convenience class for using QPainter on a QWindow. More…
| Header | #include <QRasterWindow> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Gui) |
| Module | Nt GUI C++ Classes |
| Inherits | QPaintDeviceWindow |
List of all members, including inherited members
Public Functions
| QRasterWindow(QWindow *parent = nullptr) | |
| ~QRasterWindow() |
Detailed Description
A raster window paints with QPainter into a software backing store. Reimplement paintEvent() and paint on the window:
class Clock : public QRasterWindow {
protected:
void paintEvent(QPaintEvent *) override
{
QPainter painter(this);
painter.fillRect(rect(), Qt::white);
painter.setBrush(Qt::darkBlue);
painter.drawEllipse(20, 20, 100, 100);
}
};
See also QPaintDeviceWindow and QPainter.
Differences from Qt
The class adds nothing to QPaintDeviceWindow, and the parent argument must be nullptr because Nt has no child windows.
Member Function Documentation
QRasterWindow::QRasterWindow(QWindow *parent = nullptr)
Constructs a raster window. parent is accepted for compatibility and must be nullptr.
QRasterWindow::~QRasterWindow()
Destroys the window.