Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qoffscreenwindow.h
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#ifndef QOFFSCREENWINDOW_H
5#define QOFFSCREENWINDOW_H
6
7#include <qpa/qplatformbackingstore.h>
8#include <qpa/qplatformwindow.h>
9
10#include <qhash.h>
11
13
15{
16public:
17 QOffscreenWindow(QWindow *window, bool frameMarginsEnabled);
19
20 void setGeometry(const QRect &rect) override;
21 void setWindowState(Qt::WindowStates states) override;
22
23 QMargins frameMargins() const override;
24
25 void setVisible(bool visible) override;
27
28 WId winId() const override;
29 QSurfaceFormat format() const override;
30
31 static QOffscreenWindow *windowForWinId(WId id);
32
33private:
34 void setFrameMarginsEnabled(bool enabled);
35 void setGeometryImpl(const QRect &rect);
36
37 QRect m_normalGeometry;
38 QMargins m_margins;
39 bool m_positionIncludesFrame;
40 bool m_visible;
41 bool m_pendingGeometryChangeOnShow;
42 bool m_frameMarginsRequested;
43 WId m_winId;
44
46};
47
48QT_END_NAMESPACE
49
50#endif
bool scroll(const QRegion &area, int dx, int dy) override
Scrolls the given area dx pixels to the right and dy downward; both dx and dy may be negative.
QImage toImage() const override
Implemented in subclasses to return the content of the backingstore as a QImage.
void beginPaint(const QRegion &) override
This function is called before painting onto the surface begins, with the region in which the paintin...
static QOffscreenBackingStore * backingStoreForWinId(WId id)
void flush(QWindow *window, const QRegion &region, const QPoint &offset) override
Flushes the given region from the specified window.
void resize(const QSize &size, const QRegion &staticContents) override
QOffscreenBackingStore(QWindow *window)
QPaintDevice * paintDevice() override
Implement this function to return the appropriate paint device.
QPixmap grabWindow(WId window, const QRect &rect) const
void setPos(const QPoint &pos) override
QPoint pos() const override
void changeCursor(QCursor *windowCursor, QWindow *window) override
This method is called by Qt whenever the cursor graphic should be changed.
void * nativeResourceForIntegration(const QByteArray &resource) override
QOffscreenPlatformNativeInterface(QOffscreenIntegration *integration)
static QJsonObject configuration(QOffscreenPlatformNativeInterface *iface)
static void setConfiguration(const QJsonObject &configuration, QOffscreenPlatformNativeInterface *iface)
static QPlatformWindow * windowContainingCursor
QOffscreenScreen(const QOffscreenIntegration *integration)
QScopedPointer< QPlatformCursor > m_cursor
int depth() const override
Reimplement in subclass to return current depth of the screen.
QPixmap grabWindow(WId window, int x, int y, int width, int height) const override
This function is called when Qt needs to be able to grab the content of a window.
const QOffscreenIntegration * m_integration
QRect geometry() const override
Reimplement in subclass to return the pixel geometry of the screen.
QOffscreenWindow(QWindow *window, bool frameMarginsEnabled)
QSurfaceFormat format() const override
Returns the actual surface format of the window.
void setWindowState(Qt::WindowStates states) override
Requests setting the window state of this surface to type.
static QOffscreenWindow * windowForWinId(WId id)
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
QMargins frameMargins() const override
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset)