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_CLASSINFO(
"DefaultProperty",
"data")
53 Q_DECLARE_PRIVATE(QQuickWindow)
55 QML_NAMED_ELEMENT(Window)
56 QML_ADDED_IN_VERSION(2, 0)
57 QML_REMOVED_IN_VERSION(2, 1)
59 enum CreateTextureOption {
60 TextureHasAlphaChannel = 0x0001,
61 TextureHasMipmaps = 0x0002,
62 TextureOwnsGLTexture = 0x0004,
63 TextureCanUseAtlas = 0x0008,
64 TextureIsOpaque = 0x0010
68 BeforeSynchronizingStage,
69 AfterSynchronizingStage,
76 Q_DECLARE_FLAGS(CreateTextureOptions, CreateTextureOption)
77 Q_FLAG(CreateTextureOptions)
79 enum SceneGraphError {
80 ContextNotAvailable = 1
82 Q_ENUM(SceneGraphError)
89 Q_ENUM(TextRenderType)
91 explicit QQuickWindow(QWindow *parent =
nullptr);
92 explicit QQuickWindow(QQuickRenderControl *renderControl);
94 ~QQuickWindow() override;
96 QQuickItem *contentItem()
const;
98 QQuickItem *activeFocusItem()
const;
99 QObject *focusObject()
const override;
101 QQuickItem *mouseGrabberItem()
const;
105 void setRenderTarget(
const QQuickRenderTarget &target);
106 QQuickRenderTarget renderTarget()
const;
108 struct GraphicsStateInfo {
109 int currentFrameSlot;
112 const GraphicsStateInfo &graphicsStateInfo();
113 void beginExternalCommands();
114 void endExternalCommands();
115 QQmlIncubationController *incubationController()
const;
117#if QT_CONFIG(accessibility)
118 QAccessibleInterface *accessibleRoot()
const override;
122 QSGTexture *createTextureFromImage(
const QImage &image)
const;
123 QSGTexture *createTextureFromImage(
const QImage &image, CreateTextureOptions options)
const;
124 QSGTexture *createTextureFromRhiTexture(QRhiTexture *texture, CreateTextureOptions options = {})
const;
126 void setColor(
const QColor &color);
127 QColor color()
const;
129 static bool hasDefaultAlphaBuffer();
130 static void setDefaultAlphaBuffer(
bool useAlpha);
132 void setPersistentGraphics(
bool persistent);
133 bool isPersistentGraphics()
const;
135 void setPersistentSceneGraph(
bool persistent);
136 bool isPersistentSceneGraph()
const;
138 bool isSceneGraphInitialized()
const;
140 void scheduleRenderJob(QRunnable *job, RenderStage schedule);
142 qreal effectiveDevicePixelRatio()
const;
144 QSGRendererInterface *rendererInterface()
const;
146 static void setGraphicsApi(QSGRendererInterface::GraphicsApi api);
147 static QSGRendererInterface::GraphicsApi graphicsApi();
149 static void setSceneGraphBackend(
const QString &backend);
150 static QString sceneGraphBackend();
152 void setGraphicsDevice(
const QQuickGraphicsDevice &device);
153 QQuickGraphicsDevice graphicsDevice()
const;
155 void setGraphicsConfiguration(
const QQuickGraphicsConfiguration &config);
156 QQuickGraphicsConfiguration graphicsConfiguration()
const;
158 QSGRectangleNode *createRectangleNode()
const;
159 QSGImageNode *createImageNode()
const;
160 QSGNinePatchNode *createNinePatchNode()
const;
161 QSGTextNode *createTextNode()
const;
163 static TextRenderType textRenderType();
164 static void setTextRenderType(TextRenderType renderType);
167 QRhiSwapChain *swapChain()
const;
171 void sceneGraphInitialized();
172 void sceneGraphInvalidated();
173 void beforeSynchronizing();
174 Q_REVISION(2, 2)
void afterSynchronizing();
175 void beforeRendering();
176 void afterRendering();
177 Q_REVISION(2, 2)
void afterAnimating();
178 Q_REVISION(2, 2)
void sceneGraphAboutToStop();
180 Q_REVISION(2, 1)
void closing(QQuickCloseEvent *close);
181 void colorChanged(
const QColor &);
182 Q_REVISION(2, 1)
void activeFocusItemChanged();
183 Q_REVISION(2, 2)
void sceneGraphError(QQuickWindow::SceneGraphError error,
const QString &message);
185 Q_REVISION(2, 14)
void beforeRenderPassRecording();
186 Q_REVISION(2, 14)
void afterRenderPassRecording();
188 Q_REVISION(6, 0)
void paletteChanged();
189 Q_REVISION(6, 0)
void paletteCreated();
191 Q_REVISION(6, 0)
void beforeFrameBegin();
192 Q_REVISION(6, 0)
void afterFrameEnd();
196 void releaseResources();
199 QQuickWindow(QQuickWindowPrivate &dd, QWindow *parent =
nullptr);
200 QQuickWindow(QQuickWindowPrivate &dd, QQuickRenderControl *control);
202 void exposeEvent(QExposeEvent *) override;
203 void resizeEvent(QResizeEvent *) override;
205 void showEvent(QShowEvent *) override;
206 void hideEvent(QHideEvent *) override;
207 void closeEvent(QCloseEvent *) override;
209 void focusInEvent(QFocusEvent *) override;
210 void focusOutEvent(QFocusEvent *) override;
212 bool event(QEvent *) override;
216 void keyPressEvent(QKeyEvent *) override;
217 void keyReleaseEvent(QKeyEvent *) override;
218 void mousePressEvent(QMouseEvent *) override;
219 void mouseReleaseEvent(QMouseEvent *) override;
220 void mouseDoubleClickEvent(QMouseEvent *) override;
221 void mouseMoveEvent(QMouseEvent *) override;
222#if QT_CONFIG(wheelevent)
223 void wheelEvent(QWheelEvent *) override;
225#if QT_CONFIG(tabletevent)
226 void tabletEvent(QTabletEvent *) override;
231 void cleanupSceneGraph();
232 void physicalDpiChanged();
233 void handleScreenChanged(QScreen *screen);
234 void runJobsAfterSwap();
235 void handleApplicationStateChanged(Qt::ApplicationState state);
236 void handleFontDatabaseChanged();
238#ifndef QT_NO_DEBUG_STREAM
239 inline friend QQmlInfo operator<<(QQmlInfo info,
const QQuickWindow *window)
241 info.QDebug::operator<<(window);
246 friend class QQuickItem;
247 friend class QQuickItemPrivate;
248 friend class QQuickWidget;
249 friend class QQuickRenderControl;
250 friend class QQuickAnimatorController;
251 friend class QQuickWidgetPrivate;
252 friend class QQuickDeliveryAgentPrivate;
253 Q_DISABLE_COPY(QQuickWindow)