Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qrasterwindow.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qrasterwindow.h"
5
6#include <QtGui/private/qpaintdevicewindow_p.h>
7
8#include <QtGui/QBackingStore>
9#include <QtGui/QPainter>
10
12
34{
35 Q_DECLARE_PUBLIC(QRasterWindow)
36public:
37 void beginPaint(const QRegion &region) override
38 {
39 Q_Q(QRasterWindow);
40 const QSize size = q->size();
41 if (backingstore->size() != size) {
44 }
45 backingstore->beginPaint(region);
46 }
47
48 void endPaint() override
49 {
51 }
52
53 void flush(const QRegion &region) override
54 {
55 Q_Q(QRasterWindow);
56 backingstore->flush(region, q);
57 }
58
60};
61
67{
68 setSurfaceType(QSurface::RasterSurface);
69 d_func()->backingstore.reset(new QBackingStore(this));
70}
71
73{
74 Q_D(QRasterWindow);
75 // Delete backingstore while window is still alive, as it
76 // might need to reference the window in the process
77 d->backingstore.reset(nullptr);
78}
79
84{
85 Q_D(const QRasterWindow);
86
87 switch (metric) {
88 case PdmDepth:
89 return d->backingstore->paintDevice()->depth();
90 default:
91 break;
92 }
94}
95
100{
101 Q_D(const QRasterWindow);
102 return d->backingstore->paintDevice();
103}
104
106
107#include "moc_qrasterwindow.cpp"
The QBackingStore class provides a drawing area for QWindow.
void beginPaint(const QRegion &)
Begins painting on the backing store surface in the given region.
void flush(const QRegion &region, QWindow *window=nullptr, const QPoint &offset=QPoint())
Flushes the given region from the specified window onto the screen.
void resize(const QSize &size)
Sets the size of the window surface to size.
QSize size() const
Returns the current size of the window surface.
void endPaint()
Ends painting.
int metric(PaintDeviceMetric metric) const override
\inmodule QtCore\reentrant
Definition qpoint.h:23
void endPaint() override
QScopedPointer< QBackingStore > backingstore
void flush(const QRegion &region) override
void beginPaint(const QRegion &region) override
\inmodule QtGui
QRasterWindow(QWindow *parent=nullptr)
Constructs a new QRasterWindow with parent.
int metric(PaintDeviceMetric metric) const override
QPaintDevice * redirected(QPoint *) const override
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
\inmodule QtCore
\inmodule QtCore
Definition qsize.h:25
@ RasterSurface
Definition qsurface.h:31
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent