6#include <qpa/qplatformwindow.h>
7#include <qpa/qplatformintegration.h>
8#ifndef QT_NO_CONTEXTMENU
9#include <qpa/qplatformtheme.h>
13#include <qpa/qplatformopenglcontext.h>
21#if QT_CONFIG(accessibility)
25#if QT_CONFIG(draganddrop)
29#include <private/qevent_p.h>
31#include <QtCore/QTimer>
32#include <QtCore/QDebug>
35#include <qpa/qplatformcursor.h>
36#include <qpa/qplatformwindow_p.h>
126QWindow::QWindow(
QScreen *targetScreen)
131 d->init(
nullptr, targetScreen);
137 qWarning(
"QWindows cannot be reparented into desktop windows");
154QWindow::QWindow(
QWindow *parent)
228 qFatal(
"Cannot create window: no screens available");
241 QWindowSystemInterfacePrivate::GeometryChangeEvent gce(q, QHighDpi::fromNativePixels(q->handle()->geometry(), q));
242 QGuiApplicationPrivate::processGeometryChangeEvent(&gce);
308 return d->visibility;
311void QWindow::setVisibility(Visibility
v)
317 case AutomaticVisibility:
347 if (this->visible !=
visible) {
379 QString &firstWindowTitle = app_priv->firstWindowTitle;
380 if (!firstWindowTitle.
isEmpty()) {
381 q->setTitle(firstWindowTitle);
384 if (!app_priv->forcedWindowIcon.isNull())
385 q->setIcon(app_priv->forcedWindowIcon);
388 static bool geometryApplied =
false;
389 if (!geometryApplied) {
390 geometryApplied =
true;
408 && !qobject_cast<QShapedPixmapWindow *>(
q)
459 if (siblingCount == 0)
462 const qsizetype currentPosition = siblings.indexOf(
q);
467 if (currentPosition == targetPosition)
470 siblings.move(currentPosition, targetPosition);
476 const QScreen *oldScreen =
q->screen();
478 && !(oldScreen && oldScreen->virtualSiblings().contains(newScreen));
496 emit q->screenChanged(newScreen);
498 if (
child->isWindowType())
499 static_cast<QWindow *
>(
child)->d_func()->emitScreenChangedRecursion(newScreen);
507 qWarning() <<
q <<
'(' << newScreen <<
"): Attempt to set a screen on a child window.";
518 else if (newScreen && shouldRecreate)
538 q->parent()->create();
549 if (
q->isTopLevel()) {
557 platformWindow = nativeHandle ? platformIntegration->createForeignWindow(
q, nativeHandle)
558 : platformIntegration->createPlatformWindow(
q);
562 qWarning() <<
"Failed to create platform window for" <<
q <<
"with flags" <<
q->flags();
569 for (
int i = 0;
i < childObjects.
size();
i ++) {
571 if (!
object->isWindowType())
576 childWindow->d_func()->create(recursive);
581 if (childWindow->isVisible())
582 childWindow->setVisible(
true);
584 if (
QPlatformWindow *childPlatformWindow = childWindow->d_func()->platformWindow)
585 childPlatformWindow->setParent(
this->platformWindow);
616 const QSize adjustedSize =
618 if (*oldSizeMember == adjustedSize)
620 const bool widthChanged = adjustedSize.
width() != oldSizeMember->width();
621 const bool heightChanged = adjustedSize.
height() != oldSizeMember->height();
622 *oldSizeMember = adjustedSize;
635 const QSize currentSize =
q->size();
637 q->resize(boundedSize);
654void QWindow::setSurfaceType(SurfaceType surfaceType)
668 return d->surfaceType;
696bool QWindow::isVisible()
const
717void QWindow::create()
734WId QWindow::winId()
const
738 if (!
d->platformWindow)
739 const_cast<QWindow *
>(
this)->create();
741 if (!
d->platformWindow)
744 return d->platformWindow->winId();
760 return d->parentWindow ?
d->parentWindow : (
mode == IncludeTransients ? transientParent() :
nullptr);
773void QWindow::setParent(
QWindow *parent)
782 if (
d->windowRecreationRequired(newScreen)) {
783 qWarning() <<
this <<
'(' <<
parent <<
"): Cannot change screens (" << screen() << newScreen <<
')';
790 const auto previousParent =
d->parentWindow;
795 d->disconnectFromScreen();
797 d->connectToScreen(newScreen);
805 if (
d->platformWindow) {
814 if (previousParent) {
831bool QWindow::isTopLevel()
const
834 return d->parentWindow ==
nullptr;
844bool QWindow::isModal()
const
926 return d->requestedFormat;
949 if (
d->platformWindow)
950 return d->platformWindow->format();
951 return d->requestedFormat;
967void QWindow::setFlags(Qt::WindowFlags
flags)
970 if (
d->windowFlags ==
flags)
973 if (
d->platformWindow)
974 d->platformWindow->setWindowFlags(
flags);
981 Qt::WindowFlags
flags =
d->windowFlags;
983 if (
d->platformWindow &&
d->platformWindow->isForeignWindow())
1001 setFlags(
d->windowFlags | flag);
1003 setFlags(
d->windowFlags & ~flag);
1033 bool changed =
false;
1034 if (
d->windowTitle !=
title) {
1039 d->platformWindow->setWindowTitle(
title);
1047 return d->windowTitle;
1057void QWindow::setFilePath(
const QString &filePath)
1060 d->windowFilePath = filePath;
1061 if (
d->platformWindow)
1062 d->platformWindow->setWindowFilePath(filePath);
1070QString QWindow::filePath()
const
1073 return d->windowFilePath;
1090 d->windowIcon =
icon;
1091 if (
d->platformWindow)
1092 d->platformWindow->setWindowIcon(icon);
1102QIcon QWindow::icon()
const
1105 if (
d->windowIcon.isNull())
1107 return d->windowIcon;
1121 if (
d->platformWindow)
1122 d->platformWindow->raise();
1136 if (
d->platformWindow)
1137 d->platformWindow->lower();
1161 if (
Q_UNLIKELY(!isVisible() || !
d->platformWindow ||
d->maximumSize ==
d->minimumSize))
1165 const bool isCorner =
1171 if (
Q_UNLIKELY(!isSingleEdge && !isCorner)) {
1172 qWarning() <<
"Invalid edges" << edges <<
"passed to QWindow::startSystemResize, ignoring.";
1176 return d->platformWindow->startSystemResize(edges);
1199 if (
Q_UNLIKELY(!isVisible() || !
d->platformWindow))
1202 return d->platformWindow->startSystemMove();
1225 if (
d->platformWindow) {
1226 d->platformWindow->setOpacity(
level);
1247void QWindow::setMask(
const QRegion ®ion)
1250 if (
d->platformWindow)
1272void QWindow::requestActivate()
1276 qWarning() <<
"requestActivate() called for " <<
this <<
" which has Qt::WindowDoesNotAcceptFocus set.";
1279 if (
d->platformWindow)
1280 d->platformWindow->requestActivateWindow();
1294bool QWindow::isExposed()
const
1320bool QWindow::isActive()
const
1323 if (!
d->platformWindow)
1336 return p->isActive();
1338 return isAncestorOf(
focus);
1363 if (
d->contentOrientation == orientation)
1365 if (
d->platformWindow)
1366 d->platformWindow->handleContentOrientationChange(orientation);
1367 d->contentOrientation = orientation;
1374 return d->contentOrientation;
1389qreal QWindow::devicePixelRatio()
const
1392 return d->devicePixelRatio;
1442 setWindowStates(
state);
1461void QWindow::setWindowStates(Qt::WindowStates
state)
1465 qWarning(
"QWindow::setWindowStates does not accept Qt::WindowActive");
1469 if (
d->platformWindow)
1470 d->platformWindow->setWindowState(
state);
1475 if (newEffectiveState != originalEffectiveState)
1478 d->updateVisibility();
1503Qt::WindowStates QWindow::windowStates()
const
1506 return d->windowState;
1531void QWindow::setTransientParent(
QWindow *parent)
1539 qWarning() <<
"transient parent" <<
parent <<
"cannot be same as window";
1549QWindow *QWindow::transientParent()
const
1552 return d->transientParent.data();
1564 q->setTransientParent(
parent);
1584 if (
child->parent() ==
this || (
mode == IncludeTransients &&
child->transientParent() ==
this))
1603QSize QWindow::minimumSize()
const
1606 return d->minimumSize;
1614QSize QWindow::maximumSize()
const
1617 return d->maximumSize;
1625QSize QWindow::baseSize()
const
1636QSize QWindow::sizeIncrement()
const
1639 return d->sizeIncrement;
1649void QWindow::setMinimumSize(
const QSize &
size)
1653 &
d->minimumSize,
size, [
this,
d]() { emit minimumWidthChanged(d->minimumSize.width()); },
1654 [
this,
d]() { emit minimumHeightChanged(d->minimumSize.height()); });
1667 d->positionAutomatic =
false;
1680 d->positionAutomatic =
false;
1726void QWindow::setMaximumSize(
const QSize &
size)
1730 &
d->maximumSize,
size, [
this,
d]() { emit maximumWidthChanged(d->maximumSize.width()); },
1731 [
this,
d]() { emit maximumHeightChanged(d->maximumSize.height()); });
1760void QWindow::setBaseSize(
const QSize &
size)
1763 if (
d->baseSize ==
size)
1766 if (
d->platformWindow && isTopLevel())
1767 d->platformWindow->propagateSizeHints();
1784void QWindow::setSizeIncrement(
const QSize &
size)
1787 if (
d->sizeIncrement ==
size)
1789 d->sizeIncrement =
size;
1790 if (
d->platformWindow && isTopLevel())
1791 d->platformWindow->propagateSizeHints();
1817 d->positionAutomatic =
false;
1818 const QRect oldRect = geometry();
1819 if (
rect == oldRect)
1823 if (
d->platformWindow) {
1825 if (newScreen && isTopLevel())
1826 d->setTopLevelScreen(newScreen,
true);
1831 if (
rect.x() != oldRect.x())
1833 if (
rect.y() != oldRect.y())
1835 if (
rect.width() != oldRect.width())
1837 if (
rect.height() != oldRect.height())
1851 QScreen *currentScreen =
q->screen();
1852 QScreen *fallback = currentScreen;
1854 if (!
q->parent() && currentScreen && !currentScreen->geometry().contains(center)) {
1855 const auto screens = currentScreen->virtualSiblings();
1874QRect QWindow::geometry()
const
1877 if (
d->platformWindow) {
1878 const auto nativeGeometry =
d->platformWindow->geometry();
1889QMargins QWindow::frameMargins()
const
1892 if (
d->platformWindow)
1904QRect QWindow::frameGeometry()
const
1907 if (
d->platformWindow) {
1921QPoint QWindow::framePosition()
const
1924 if (
d->platformWindow) {
1928 return d->geometry.topLeft();
1938void QWindow::setFramePosition(
const QPoint &point)
1942 d->positionAutomatic =
false;
1943 if (
d->platformWindow) {
1946 d->geometry.moveTopLeft(point);
1964void QWindow::setPosition(
const QPoint &pt)
1976void QWindow::setPosition(
int posx,
int posy)
2007void QWindow::resize(
int w,
int h)
2017void QWindow::resize(
const QSize &newSize)
2022 if (newSize == oldSize)
2026 if (
d->platformWindow) {
2027 d->platformWindow->setGeometry(
2030 d->geometry.setSize(newSize);
2043void QWindow::destroy()
2046 if (!
d->platformWindow)
2049 if (
d->platformWindow->isForeignWindow())
2062 for (
int i = 0;
i < childrenWindows.size();
i++) {
2063 QObject *
object = childrenWindows.at(
i);
2064 if (
object->isWindowType()) {
2066 auto *childPlatformWindow =
w->handle();
2067 if (!childPlatformWindow)
2073 if (childPlatformWindow->isForeignWindow())
2074 childPlatformWindow->
setParent(
nullptr);
2080 bool wasVisible =
q->isVisible();
2126 return d->platformWindow;
2137 return d->platformWindow;
2150bool QWindow::setKeyboardGrabEnabled(
bool grab)
2153 if (
d->platformWindow)
2154 return d->platformWindow->setKeyboardGrabEnabled(grab);
2167bool QWindow::setMouseGrabEnabled(
bool grab)
2170 if (
d->platformWindow)
2171 return d->platformWindow->setMouseGrabEnabled(grab);
2182QScreen *QWindow::screen()
const
2185 return d->parentWindow ?
d->parentWindow->screen() :
d->topLevelScreen.data();
2201void QWindow::setScreen(
QScreen *newScreen)
2206 d->setTopLevelScreen(newScreen, newScreen !=
nullptr);
2242 return const_cast<QWindow *
>(
this);
2260 Qt::WindowState defaultState = platformIntegration->defaultWindowState(d_func()->windowFlags);
2325#if !defined Q_OS_QNX
2364 if (!
d->platformWindow)
2371 bool success =
d->platformWindow->close();
2382 if (!
q->isTopLevel())
2393 if (
q->transientParent())
2402 return q->isVisible();
2513 switch (ev->type()) {
2555#if QT_CONFIG(accessibility)
2557 state.active =
true;
2558 QAccessibleStateChangeEvent
event(
this,
state);
2559 QAccessible::updateAccessibility(&
event);
2565#if QT_CONFIG(accessibility)
2567 state.active =
true;
2568 QAccessibleStateChangeEvent
event(
this,
state);
2569 QAccessible::updateAccessibility(&
event);
2573#if QT_CONFIG(wheelevent)
2575 wheelEvent(
static_cast<QWheelEvent*
>(ev));
2582 const bool wasVisible =
d->treatAsVisible();
2583 const bool participatesInLastWindowClosed =
d->participatesInLastWindowClosed();
2586 QPointer<QWindow> deletionGuard(
this);
2589 if (ev->isAccepted()) {
2592 if (wasVisible && participatesInLastWindowClosed)
2619#if QT_CONFIG(tabletevent)
2623 tabletEvent(
static_cast<QTabletEvent *
>(ev));
2642#ifndef QT_NO_CONTEXTMENU
2657 auto asMouseEvent = [](
QEvent *ev) {
2658 const auto t = ev->type();
2666 me->globalPosition().toPoint(), me->modifiers());
2700void QWindow::requestUpdate()
2703 "QWindow",
"Updates can only be scheduled from the GUI (main) thread");
2706 if (
d->updateRequestPending || !
d->platformWindow)
2708 d->updateRequestPending =
true;
2709 d->platformWindow->requestUpdate();
2794#if QT_CONFIG(wheelevent)
2798void QWindow::wheelEvent(QWheelEvent *ev)
2812#if QT_CONFIG(tabletevent)
2819void QWindow::tabletEvent(QTabletEvent *ev)
2856 if (
d->platformWindow
2857 && (
d->platformWindow->isForeignWindow() ||
d->platformWindow->isEmbedded())) {
2862 return pos +
d->globalPosition();
2874 QPointF nativeWindowGlobalPos =
d->platformWindow
2875 ?
d->platformWindow->mapToGlobal(
QPoint(0,0)).toPointF()
2877 QPointF nativeGlobalPos = nativeLocalPos + nativeWindowGlobalPos;
2879 return deviceIndependentGlobalPos;
2903 if (
d->platformWindow
2904 && (
d->platformWindow->isForeignWindow() ||
d->platformWindow->isEmbedded())) {
2909 return pos -
d->globalPosition();
2917 QPointF nativeWindowGlobalPos =
d->platformWindow
2918 ?
d->platformWindow->mapToGlobal(
QPoint(0,0)).toPointF()
2920 QPointF nativeLocalPos = nativeGlobalPos - nativeWindowGlobalPos;
2922 return deviceIndependentLocalPos;
2937 for (
const QWindow *
p =
q->parent();
p;
p =
p->parent()) {
2939 if (pw && (pw->isForeignWindow() || pw->isEmbedded())) {
2993QWindow *QWindow::fromWinId(WId
id)
2996 qWarning(
"QWindow::fromWinId(): platform plugin does not support foreign windows.");
3026void QWindow::alert(
int msec)
3029 if (!
d->platformWindow ||
d->platformWindow->isAlertState() || isActive())
3031 d->platformWindow->setAlertState(
true);
3032 if (
d->platformWindow->isAlertState() && msec)
3066 d->setCursor(&cursor);
3072void QWindow::unsetCursor()
3075 d->setCursor(
nullptr);
3083QCursor QWindow::cursor()
const
3125 platformCursor->changeCursor(
c,
q);
3133void *QWindow::resolveInterface(
const char *
name,
int revision)
const
3137 auto *platformWindow =
handle();
3142#if defined(Q_OS_WIN)
3150#if defined(Q_OS_MACOS)
3154#if QT_CONFIG(wayland)
3158#if defined(Q_OS_WASM)
3165#ifndef QT_NO_DEBUG_STREAM
3172 if (!
window->objectName().isEmpty())
3174 if (
debug.verbosity() > 2) {
3177 debug <<
", visible";
3179 debug <<
", exposed";
3181 <<
", type=" <<
window->type() <<
", flags=" <<
window->flags()
3182 <<
", surface type=" <<
window->surfaceType();
3183 if (
window->isTopLevel())
3184 debug <<
", toplevel";
3189 debug <<
", margins=" << margins;
3190 debug <<
", devicePixelRatio=" <<
window->devicePixelRatio();
3198 debug <<
"QWindow(0x0)";
3204#if QT_CONFIG(vulkan) || defined(Q_QDOC)
3214 d->vulkanInstance = instance;
3223 return d->vulkanInstance;
3230#include "moc_qwindow.cpp"
The QCloseEvent class contains parameters that describe a close event.
static bool is_app_closing
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
static void removePostedEvents(QObject *receiver, int eventType=0)
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
The QCursor class provides a mouse cursor with an arbitrary shape.
Qt::CursorShape shape() const
Returns the cursor shape identifier.
@ ParentWindowAboutToChange
@ ApplicationWindowIconChange
Type type() const
Returns the event type.
The QExposeEvent class contains event parameters for expose events. \inmodule QtGui.
The QFocusEvent class contains event parameters for widget focus events.
static void updateBlockedStatus(QWindow *window)
static QWindow * currentMousePressWindow
static void showModalWindow(QWindow *window)
static void hideModalWindow(QWindow *window)
static QPlatformIntegration * platformIntegration()
static QWindowList window_list
static QList< TabletPointData > tabletDevicePoints
static QEvent::Type contextMenuEventType()
static QGuiApplicationPrivate * instance()
static QWindow * currentMouseWindow
static QWindow * focus_window
static void applyWindowGeometrySpecificationTo(QWindow *window)
static QWindow * modalWindow()
Returns the most recently shown modal window.
QScreen * primaryScreen
the primary (or default) screen of the application.
static QCursor * overrideCursor()
Returns the active application override cursor.
static QWindow * focusWindow()
Returns the QWindow that receives events tied to focus, such as key events.
QIcon windowIcon
the default window icon
The QHideEvent class provides an event which is sent after a widget is hidden.
static qreal factor(C *context)
The QIcon class provides scalable icons in different modes and states.
The QKeyEvent class describes a key event.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
constexpr bool isNull() const noexcept
Returns true if all margins are is 0; otherwise returns false.
constexpr int left() const noexcept
Returns the left margin.
constexpr int top() const noexcept
Returns the top margin.
The QMoveEvent class contains event parameters for move events.
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
virtual bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
void setParent(QObject *parent)
Makes the object a child of parent.
QThread * thread() const
Returns the thread in which the object lives.
static QOpenGLContext * currentContext()
Returns the last context which called makeCurrent in the current thread, or \nullptr,...
The QPaintEvent class contains event parameters for paint events.
\inmodule QtCore\reentrant
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
bool intersects(const QRect &r) const noexcept
Returns true if this rectangle intersects with the given rectangle (i.e., there is at least one pixel...
constexpr int height() const noexcept
Returns the height of the rectangle.
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr QPoint center() const noexcept
Returns the center point of the rectangle.
The QRegion class specifies a clip region for a painter.
The QResizeEvent class contains event parameters for resize events.
The QScreen class is used to query screen properties. \inmodule QtGui.
QRect geometry
the screen's geometry in pixels
QString name
a user presentable string representing the screen
QPlatformScreen * handle() const
Get the platform screen handle.
The QShowEvent class provides an event that is sent when a widget is shown.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr QSize expandedTo(const QSize &) const noexcept
Returns a size holding the maximum width and height of this size and the given otherSize.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
virtual QPlatformSurface * surfaceHandle() const =0
Returns a handle to the platform-specific implementation of the surface.
SurfaceType
The SurfaceType enum describes what type of surface this is.
static QThread * currentThread()
bool singleShot
whether the timer is a single-shot timer
The QTouchEvent class contains parameters that describe a touch event.
The QVulkanInstance class represents a native Vulkan instance, enabling Vulkan rendering onto a QSurf...
bool windowRecreationRequired(QScreen *newScreen) const
QWindow * topLevelWindow(QWindow::AncestorMode mode=QWindow::IncludeTransients) const
QPointer< QScreen > topLevelScreen
void disconnectFromScreen()
QScreen * screenForGeometry(const QRect &rect) const
virtual void clearFocusObject()
QPlatformWindow * platformWindow
virtual void setVisible(bool visible)
void emitScreenChangedRecursion(QScreen *newScreen)
bool updateRequestPending
~QWindowPrivate() override
QPoint globalPosition() const
void updateSiblingPosition(SiblingPosition)
void setCursor(const QCursor *c=nullptr)
void setTopLevelScreen(QScreen *newScreen, bool recreate)
QWindow::Visibility visibility
bool updateDevicePixelRatio()
void setMinOrMaxSize(QSize *oldSizeMember, const QSize &size, qxp::function_ref< void()> funcWidthChanged, qxp::function_ref< void()> funcHeightChanged)
void init(QWindow *parent, QScreen *targetScreen=nullptr)
void connectToScreen(QScreen *topLevelScreen)
Qt::WindowStates windowState
bool transientParentPropertySet
virtual QRectF closestAcceptableGeometry(const QRectF &rect) const
static Qt::WindowState effectiveState(Qt::WindowStates)
virtual bool treatAsVisible() const
QSurfaceFormat requestedFormat
virtual bool participatesInLastWindowClosed() const
void setTransientParent(QWindow *parent)
void create(bool recursive)
void showNormal()
Shows the window as normal, i.e.
int minimumHeight
the minimum height of the window's geometry
virtual QAccessibleInterface * accessibleRoot() const
Returns the accessibility interface for the object that the window represents.
virtual void moveEvent(QMoveEvent *)
Override this to handle window move events (ev).
int x
the x position of the window's geometry
void windowStateChanged(Qt::WindowState windowState)
This signal is emitted when the windowState changes, either by being set explicitly with setWindowSta...
void heightChanged(int arg)
int maximumWidth
the maximum width of the window's geometry
void showFullScreen()
Shows the window as fullscreen.
virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result)
Override this to handle platform dependent events.
int width
the width of the window's geometry
bool startSystemMove()
Start a system-specific move operation.
void showMinimized()
Shows the window as minimized.
void modalityChanged(Qt::WindowModality modality)
This signal is emitted when the Qwindow::modality property changes to modality.
virtual void closeEvent(QCloseEvent *)
Override this to handle close events (ev).
void show()
Shows the window.
void setMaximumHeight(int h)
virtual void mousePressEvent(QMouseEvent *)
Override this to handle mouse press events (ev).
void hide()
Hides the window.
void setMinimumHeight(int h)
virtual void focusInEvent(QFocusEvent *)
Override this to handle focus in events (ev).
Qt::WindowFlags flags
the window flags of the window
void contentOrientationChanged(Qt::ScreenOrientation orientation)
virtual void keyPressEvent(QKeyEvent *)
Override this to handle key press events (ev).
QSurfaceFormat format() const override
Returns the actual format of this window.
virtual void mouseMoveEvent(QMouseEvent *)
Override this to handle mouse move events (ev).
SurfaceType surfaceType() const override
Returns the surface type of the window.
Qt::ScreenOrientation contentOrientation
the orientation of the window's contents
void setTitle(const QString &)
bool visible
whether the window is visible or not
void raise()
Raise the window in the windowing system.
virtual void exposeEvent(QExposeEvent *)
The expose event (ev) is sent by the window system when a window moves between the un-exposed and exp...
int maximumHeight
the maximum height of the window's geometry
void setMaximumWidth(int w)
void showMaximized()
Shows the window as maximized.
void setMinimumWidth(int w)
QSize size() const override
Returns the size of the window excluding any window frame.
virtual bool event(QEvent *) override
Override this to handle any event (ev) sent to the window.
virtual void mouseReleaseEvent(QMouseEvent *)
Override this to handle mouse release events (ev).
int y
the y position of the window's geometry
void setGeometry(int posx, int posy, int w, int h)
Sets the geometry of the window, excluding its window frame, to a rectangle constructed from posx,...
int minimumWidth
the minimum width of the window's geometry
virtual QObject * focusObject() const
Returns the QObject that will be the final receiver of events tied focus, such as key events.
virtual void hideEvent(QHideEvent *)
Override this to handle hide events (ev).
virtual void mouseDoubleClickEvent(QMouseEvent *)
Override this to handle mouse double click events (ev).
bool close()
Close the window.
virtual void keyReleaseEvent(QKeyEvent *)
Override this to handle key release events (ev).
QString title
the window's title in the windowing system
Visibility visibility
the screen-occupation state of the window
bool startSystemResize(Qt::Edges edges)
Start a system-specific resize operation.
virtual void touchEvent(QTouchEvent *)
Override this to handle touch events (ev).
virtual void paintEvent(QPaintEvent *)
The paint event (ev) is sent by the window system whenever an area of the window needs a repaint,...
virtual void resizeEvent(QResizeEvent *)
Override this to handle resize events (ev).
virtual void focusOutEvent(QFocusEvent *)
Override this to handle focus out events (ev).
void widthChanged(int arg)
void screenChanged(QScreen *screen)
This signal is emitted when a window's screen changes, either by being set explicitly with setScreen(...
virtual void showEvent(QShowEvent *)
Override this to handle show events (ev).
Qt::WindowModality modality
the modality of the window
void setVisible(bool visible)
int height
the height of the window's geometry
void lower()
Lower the window in the windowing system.
qreal opacity
The opacity of the window in the windowing system.
[Window class with invokable method]
T toNativeLocalPosition(const T &value, const C *context)
T toNativeGlobalPosition(const T &value, const C *context)
T fromNativeLocalPosition(const T &value, const C *context)
T fromNativeGlobalPosition(const T &value, const C *context)
T fromNativePixels(const T &value, const C *context)
QRegion toNativeLocalRegion(const QRegion &pointRegion, const QWindow *window)
T toNativeWindowGeometry(const T &value, const C *context)
T fromNativeWindowGeometry(const T &value, const C *context)
Combined button and popup list for selecting options.
QTextStream & hex(QTextStream &stream)
Calls QTextStream::setIntegerBase(16) on stream and returns stream.
QTextStream & noforcesign(QTextStream &stream)
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() & ~QTextStream::ForceSign) on stream and...
QTextStream & dec(QTextStream &stream)
Calls QTextStream::setIntegerBase(10) on stream and returns stream.
QTextStream & forcesign(QTextStream &stream)
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() | QTextStream::ForceSign) on stream and ...
@ WindowDoesNotAcceptFocus
#define QT_NATIVE_INTERFACE_RETURN_IF(NativeInterface, baseType)
n void setPosition(void) \n\
GLsizei const GLfloat * v
[13]
GLuint64 GLenum void * handle
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLsizei const GLchar * message
GLenum GLuint GLintptr offset
GLint GLsizei GLsizei GLenum format
GLfloat GLfloat GLfloat GLfloat h
GLdouble GLdouble GLdouble GLdouble q
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_ASSERT_X(cond, x, msg)
#define QT_CONFIG(feature)
Q_GUI_EXPORT QWindowPrivate * qt_window_private(QWindow *window)
static constexpr auto kForeignWindowId
QDebug operator<<(QDebug debug, const QWindow *window)
static QWindow * nonDesktopParent(QWindow *parent)