45 Q_PRIVATE_PROPERTY(QQuickWindow::d_func(), QQmlListProperty<QObject> data READ data DESIGNABLE
false)
46 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
47 Q_PROPERTY(QQuickItem* contentItem READ contentItem CONSTANT)
48 Q_PROPERTY(QQuickItem* activeFocusItem READ activeFocusItem NOTIFY activeFocusItemChanged REVISION(2, 1))
49 Q_PRIVATE_PROPERTY(QQuickWindow::d_func(), QQuickPalette *palette READ palette WRITE setPalette
50 RESET resetPalette NOTIFY paletteChanged REVISION(6, 2))
51 QDOC_PROPERTY(QWindow* transientParent READ transientParent WRITE setTransientParent NOTIFY transientParentChanged)
52 Q_PROPERTY(qreal devicePixelRatio READ effectiveDevicePixelRatio NOTIFY devicePixelRatioChanged REVISION(6, 11))
53 Q_CLASSINFO(
"DefaultProperty",
"data")
54 Q_DECLARE_PRIVATE(QQuickWindow)
56 QML_NAMED_ELEMENT(Window)
57 QML_ADDED_IN_VERSION(2, 0)
58 QML_REMOVED_IN_VERSION(2, 1)
60 enum CreateTextureOption {
61 TextureHasAlphaChannel = 0x0001,
62 TextureHasMipmaps = 0x0002,
63 TextureOwnsGLTexture = 0x0004,
64 TextureCanUseAtlas = 0x0008,
65 TextureIsOpaque = 0x0010
69 BeforeSynchronizingStage,
70 AfterSynchronizingStage,
77 Q_DECLARE_FLAGS(CreateTextureOptions, CreateTextureOption)
78 Q_FLAG(CreateTextureOptions)
80 enum SceneGraphError {
81 ContextNotAvailable = 1
83 Q_ENUM(SceneGraphError)
90 Q_ENUM(TextRenderType)
92 explicit QQuickWindow(QWindow *parent =
nullptr);
93 explicit QQuickWindow(QQuickRenderControl *renderControl);
95 ~QQuickWindow() override;
97 QQuickItem *contentItem()
const;
99 QQuickItem *activeFocusItem()
const;
100 QObject *focusObject()
const override;
102 QQuickItem *mouseGrabberItem()
const;
106 void setRenderTarget(
const QQuickRenderTarget &target);
107 QQuickRenderTarget renderTarget()
const;
109 struct GraphicsStateInfo {
110 int currentFrameSlot;
113 const GraphicsStateInfo &graphicsStateInfo();
114 void beginExternalCommands();
115 void endExternalCommands();
116 QQmlIncubationController *incubationController()
const;
118#if QT_CONFIG(accessibility)
119 QAccessibleInterface *accessibleRoot()
const override;
123 QSGTexture *createTextureFromImage(
const QImage &image)
const;
124 QSGTexture *createTextureFromImage(
const QImage &image, CreateTextureOptions options)
const;
125 QSGTexture *createTextureFromRhiTexture(QRhiTexture *texture, CreateTextureOptions options = {})
const;
127 void setColor(
const QColor &color);
128 QColor color()
const;
130 static bool hasDefaultAlphaBuffer();
131 static void setDefaultAlphaBuffer(
bool useAlpha);
133 void setPersistentGraphics(
bool persistent);
134 bool isPersistentGraphics()
const;
136 void setPersistentSceneGraph(
bool persistent);
137 bool isPersistentSceneGraph()
const;
139 bool isSceneGraphInitialized()
const;
141 void scheduleRenderJob(QRunnable *job, RenderStage schedule);
143 qreal effectiveDevicePixelRatio()
const;
145 QSGRendererInterface *rendererInterface()
const;
147 static void setGraphicsApi(QSGRendererInterface::GraphicsApi api);
148 static QSGRendererInterface::GraphicsApi graphicsApi();
150 static void setSceneGraphBackend(
const QString &backend);
151 static QString sceneGraphBackend();
153 void setGraphicsDevice(
const QQuickGraphicsDevice &device);
154 QQuickGraphicsDevice graphicsDevice()
const;
156 void setGraphicsConfiguration(
const QQuickGraphicsConfiguration &config);
157 QQuickGraphicsConfiguration graphicsConfiguration()
const;
159 QSGRectangleNode *createRectangleNode()
const;
160 QSGImageNode *createImageNode()
const;
161 QSGNinePatchNode *createNinePatchNode()
const;
162 QSGTextNode *createTextNode()
const;
164 static TextRenderType textRenderType();
165 static void setTextRenderType(TextRenderType renderType);
168 QRhiSwapChain *swapChain()
const;
172 void sceneGraphInitialized();
173 void sceneGraphInvalidated();
174 void beforeSynchronizing();
175 Q_REVISION(2, 2)
void afterSynchronizing();
176 void beforeRendering();
177 void afterRendering();
178 Q_REVISION(2, 2)
void afterAnimating();
179 Q_REVISION(2, 2)
void sceneGraphAboutToStop();
181 Q_REVISION(2, 1)
void closing(QQuickCloseEvent *close);
182 void colorChanged(
const QColor &);
183 Q_REVISION(2, 1)
void activeFocusItemChanged();
184 Q_REVISION(2, 2)
void sceneGraphError(QQuickWindow::SceneGraphError error,
const QString &message);
186 Q_REVISION(2, 14)
void beforeRenderPassRecording();
187 Q_REVISION(2, 14)
void afterRenderPassRecording();
189 Q_REVISION(6, 0)
void paletteChanged();
190 Q_REVISION(6, 0)
void paletteCreated();
192 Q_REVISION(6, 0)
void beforeFrameBegin();
193 Q_REVISION(6, 0)
void afterFrameEnd();
195 Q_REVISION(6, 11)
void devicePixelRatioChanged();
199 void releaseResources();
202 QQuickWindow(QQuickWindowPrivate &dd, QWindow *parent =
nullptr);
203 QQuickWindow(QQuickWindowPrivate &dd, QQuickRenderControl *control);
205 void exposeEvent(QExposeEvent *) override;
206 void resizeEvent(QResizeEvent *) override;
208 void showEvent(QShowEvent *) override;
209 void hideEvent(QHideEvent *) override;
210 void closeEvent(QCloseEvent *) override;
212 void focusInEvent(QFocusEvent *) override;
213 void focusOutEvent(QFocusEvent *) override;
215 bool event(QEvent *) override;
219 void keyPressEvent(QKeyEvent *) override;
220 void keyReleaseEvent(QKeyEvent *) override;
221 void mousePressEvent(QMouseEvent *) override;
222 void mouseReleaseEvent(QMouseEvent *) override;
223 void mouseDoubleClickEvent(QMouseEvent *) override;
224 void mouseMoveEvent(QMouseEvent *) override;
225#if QT_CONFIG(wheelevent)
226 void wheelEvent(QWheelEvent *) override;
228#if QT_CONFIG(tabletevent)
229 void tabletEvent(QTabletEvent *) override;
234 void cleanupSceneGraph();
235 void physicalDpiChanged();
236 void handleScreenChanged(QScreen *screen);
237 void runJobsAfterSwap();
238 void handleApplicationStateChanged(Qt::ApplicationState state);
239 void handleFontDatabaseChanged();
241#ifndef QT_NO_DEBUG_STREAM
242 inline friend QQmlInfo operator<<(QQmlInfo info,
const QQuickWindow *window)
244 info.QDebug::operator<<(window);
249 friend class QQuickItem;
250 friend class QQuickItemPrivate;
251 friend class QQuickWidget;
252 friend class QQuickRenderControl;
253 friend class QQuickAnimatorController;
254 friend class QQuickWidgetPrivate;
255 friend class QQuickDeliveryAgentPrivate;
256 Q_DISABLE_COPY(QQuickWindow)