62class Q_GUI_EXPORT
QWindow :
public QObject,
public QSurface
65 Q_DECLARE_PRIVATE(QWindow)
77 Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY windowTitleChanged)
78 Q_PROPERTY(Qt::WindowModality modality READ modality WRITE setModality NOTIFY modalityChanged)
79 Q_PROPERTY(Qt::WindowFlags flags READ flags WRITE setFlags)
80 Q_PROPERTY(
int x READ x WRITE setX NOTIFY xChanged)
81 Q_PROPERTY(
int y READ y WRITE setY NOTIFY yChanged)
82 Q_PROPERTY(
int width READ width WRITE setWidth NOTIFY widthChanged)
83 Q_PROPERTY(
int height READ height WRITE setHeight NOTIFY heightChanged)
84 Q_PROPERTY(
int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged)
85 Q_PROPERTY(
int minimumHeight READ minimumHeight WRITE setMinimumHeight
86 NOTIFY minimumHeightChanged)
87 Q_PROPERTY(
int maximumWidth READ maximumWidth WRITE setMaximumWidth NOTIFY maximumWidthChanged)
88 Q_PROPERTY(
int maximumHeight READ maximumHeight WRITE setMaximumHeight
89 NOTIFY maximumHeightChanged)
90 Q_PROPERTY(
bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
91 Q_PROPERTY(
bool active READ isActive NOTIFY activeChanged REVISION(2, 1))
92 Q_PROPERTY(Visibility visibility READ visibility WRITE setVisibility NOTIFY visibilityChanged
94 Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation
95 WRITE reportContentOrientationChange NOTIFY contentOrientationChanged)
96 Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged REVISION(2, 1))
98 Q_PROPERTY(QWindow* transientParent READ transientParent WRITE setTransientParent NOTIFY transientParentChanged)
100 Q_PRIVATE_PROPERTY(QWindow::d_func(), QWindow* transientParent MEMBER transientParent
101 WRITE setTransientParent NOTIFY transientParentChanged REVISION(2, 13))
121 explicit QWindow(QScreen *screen =
nullptr);
122 explicit QWindow(QWindow *parent);
125 void setSurfaceType(SurfaceType surfaceType);
126 SurfaceType surfaceType()
const override;
128 bool isVisible()
const;
130 Visibility visibility()
const;
131 void setVisibility(Visibility v);
137 QWindow *parent(AncestorMode mode = ExcludeTransients)
const;
138 void setParent(QWindow *parent);
140 bool isTopLevel()
const;
142 bool isModal()
const;
143 Qt::WindowModality modality()
const;
144 void setModality(Qt::WindowModality modality);
146 void setFormat(
const QSurfaceFormat &format);
147 QSurfaceFormat format()
const override;
148 QSurfaceFormat requestedFormat()
const;
150 void setFlags(Qt::WindowFlags flags);
151 Qt::WindowFlags flags()
const;
152 void setFlag(Qt::WindowType,
bool on =
true);
153 Qt::WindowType type()
const;
155 QString title()
const;
157 void setOpacity(qreal level);
158 qreal opacity()
const;
160 void setMask(
const QRegion ®ion);
161 QRegion mask()
const;
163 bool isActive()
const;
165 void reportContentOrientationChange(Qt::ScreenOrientation orientation);
166 Qt::ScreenOrientation contentOrientation()
const;
168 qreal devicePixelRatio()
const;
170 Qt::WindowState windowState()
const;
171 Qt::WindowStates windowStates()
const;
172 void setWindowState(Qt::WindowState state);
173 void setWindowStates(Qt::WindowStates states);
175 void setTransientParent(QWindow *parent);
176 QWindow *transientParent()
const;
178 bool isAncestorOf(
const QWindow *child, AncestorMode mode = IncludeTransients)
const;
180 bool isExposed()
const;
182 inline int minimumWidth()
const {
return minimumSize().width(); }
183 inline int minimumHeight()
const {
return minimumSize().height(); }
184 inline int maximumWidth()
const {
return maximumSize().width(); }
185 inline int maximumHeight()
const {
return maximumSize().height(); }
187 QSize minimumSize()
const;
188 QSize maximumSize()
const;
189 QSize baseSize()
const;
190 QSize sizeIncrement()
const;
192 void setMinimumSize(
const QSize &size);
193 void setMaximumSize(
const QSize &size);
194 void setBaseSize(
const QSize &size);
195 void setSizeIncrement(
const QSize &size);
197 QRect geometry()
const;
199 QMargins frameMargins()
const;
200 QRect frameGeometry()
const;
202 QPoint framePosition()
const;
203 void setFramePosition(
const QPoint &point);
205 inline int width()
const {
return geometry().width(); }
206 inline int height()
const {
return geometry().height(); }
207 inline int x()
const {
return geometry().x(); }
208 inline int y()
const {
return geometry().y(); }
210 QSize size()
const override {
return geometry().size(); }
211 inline QPoint position()
const {
return geometry().topLeft(); }
213 void setPosition(
const QPoint &pt);
214 void setPosition(
int posx,
int posy);
216 void resize(
const QSize &newSize);
217 void resize(
int w,
int h);
219 void setFilePath(
const QString &filePath);
220 QString filePath()
const;
222 void setIcon(
const QIcon &icon);
227 QPlatformWindow *handle()
const;
229 bool setKeyboardGrabEnabled(
bool grab);
230 bool setMouseGrabEnabled(
bool grab);
232 QScreen *screen()
const;
233 void setScreen(QScreen *screen);
235 virtual QAccessibleInterface *accessibleRoot()
const;
236 virtual QObject *focusObject()
const;
238 QPointF mapToGlobal(
const QPointF &pos)
const;
239 QPointF mapFromGlobal(
const QPointF &pos)
const;
240 QPoint mapToGlobal(
const QPoint &pos)
const;
241 QPoint mapFromGlobal(
const QPoint &pos)
const;
244 QCursor cursor()
const;
245 void setCursor(
const QCursor &);
249 static QWindow *fromWinId(WId id);
251#if QT_CONFIG(vulkan) || defined(Q_QDOC)
252 void setVulkanInstance(QVulkanInstance *instance);
253 QVulkanInstance *vulkanInstance()
const;
256 QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QWindow)
259 Q_REVISION(2, 1)
void requestActivate();
261 void setVisible(
bool visible);
266 void showMinimized();
267 void showMaximized();
268 void showFullScreen();
274 bool startSystemResize(Qt::Edges edges);
275 bool startSystemMove();
277 void setTitle(
const QString &);
281 void setWidth(
int arg);
282 void setHeight(
int arg);
283 void setGeometry(
int posx,
int posy,
int w,
int h);
284 void setGeometry(
const QRect &rect);
286 void setMinimumWidth(
int w);
287 void setMinimumHeight(
int h);
288 void setMaximumWidth(
int w);
289 void setMaximumHeight(
int h);
291 Q_REVISION(2, 1)
void alert(
int msec);
293 Q_REVISION(2, 3)
void requestUpdate();
296 void screenChanged(QScreen *screen);
297 void modalityChanged(Qt::WindowModality modality);
298 void windowStateChanged(Qt::WindowState windowState);
299 Q_REVISION(2, 2)
void windowTitleChanged(
const QString &title);
301 void xChanged(
int arg);
302 void yChanged(
int arg);
304 void widthChanged(
int arg);
305 void heightChanged(
int arg);
307 void minimumWidthChanged(
int arg);
308 void minimumHeightChanged(
int arg);
309 void maximumWidthChanged(
int arg);
310 void maximumHeightChanged(
int arg);
312 void visibleChanged(
bool arg);
313 Q_REVISION(2, 1)
void visibilityChanged(QWindow::Visibility visibility);
314 Q_REVISION(2, 1)
void activeChanged();
315 void contentOrientationChanged(Qt::ScreenOrientation orientation);
317 void focusObjectChanged(QObject *object);
319 Q_REVISION(2, 1)
void opacityChanged(qreal opacity);
321 Q_REVISION(2, 13)
void transientParentChanged(QWindow *transientParent);
324 virtual void exposeEvent(QExposeEvent *);
325 virtual void resizeEvent(QResizeEvent *);
326 virtual void paintEvent(QPaintEvent *);
327 virtual void moveEvent(QMoveEvent *);
328 virtual void focusInEvent(QFocusEvent *);
329 virtual void focusOutEvent(QFocusEvent *);
331 virtual void showEvent(QShowEvent *);
332 virtual void hideEvent(QHideEvent *);
333 virtual void closeEvent(QCloseEvent *);
335 virtual bool event(QEvent *) override;
336 virtual void keyPressEvent(QKeyEvent *);
337 virtual void keyReleaseEvent(QKeyEvent *);
338 virtual void mousePressEvent(QMouseEvent *);
339 virtual void mouseReleaseEvent(QMouseEvent *);
340 virtual void mouseDoubleClickEvent(QMouseEvent *);
341 virtual void mouseMoveEvent(QMouseEvent *);
342#if QT_CONFIG(wheelevent)
343 virtual void wheelEvent(QWheelEvent *);
345 virtual void touchEvent(QTouchEvent *);
346#if QT_CONFIG(tabletevent)
347 virtual void tabletEvent(QTabletEvent *);
349 virtual bool nativeEvent(
const QByteArray &eventType,
void *message, qintptr *result);
351 QWindow(QWindowPrivate &dd, QWindow *parent);
354 Q_PRIVATE_SLOT(d_func(),
void _q_clearAlert())
355 QPlatformSurface *surfaceHandle()
const override;
357 Q_DISABLE_COPY(QWindow)
359 friend class QGuiApplication;
360 friend class QGuiApplicationPrivate;
361 friend class QWindowContainer;
362 friend Q_GUI_EXPORT QWindowPrivate *qt_window_private(QWindow *window);