Skip to content

PythonQt.QtGui.QWindow · declarations 001

Back to PythonQt.QtGui.QWindow

active instance-attribute

active: Any

Qt 5 reference:

active : const bool

This property holds the active status of the window

This property was introduced in Qt 5.1.

Access functions:

bool isActive() const

Notifier signal:

void activeChanged()

See also requestActivate().

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#active

activeChanged

activeChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QWindow.activeChanged; argument details are not documented.

alert

alert(msec: int) -> None

X.alert(msec)

Supplemental documentation: Qt 5 reference:

[slot] void QWindow::alert(int msec)

Causes an alert to be shown for msec miliseconds. If msec is 0 (the default), then the alert is shown indefinitely until the window becomes active again. This function has no effect on an active window.

In alert state, the window indicates that it demands attention, for example by flashing or bouncing the taskbar entry.

This function was introduced in Qt 5.1.

Upstream PySide2 reference signatures (binding differences may apply):

alert(self, msec: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#alert

baseSize

baseSize() -> Any

X.baseSize() -> PythonQt.QtCore.QSize

Supplemental documentation: Qt 5 reference:

QSize QWindow::baseSize() const

Returns the base size of the window.

See also setBaseSize().

Upstream PySide2 reference signatures (binding differences may apply):

baseSize(self) -> PySide2.QtCore.QSize

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#baseSize

close

close() -> bool

X.close() -> bool

Supplemental documentation: Qt 5 reference:

[slot] bool QWindow::close()

Close the window.

This closes the window, effectively calling destroy(), and potentially quitting the application. Returns true on success, false if it has a parent window (in which case the top level window should be closed instead).

See also destroy() and QGuiApplication::quitOnLastWindowClosed().

Upstream PySide2 reference signatures (binding differences may apply):

close(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#close

contentOrientation instance-attribute

contentOrientation: Any

Qt 5 reference:

contentOrientation : Qt::ScreenOrientation

This property holds the orientation of the window's contents

This is a hint to the window manager in case it needs to display additional content like popups, dialogs, status bars, or similar in relation to the window.

The recommended orientation is QScreen::orientation() but an application doesn't have to support all possible orientations, and thus can opt to ignore the current screen orientation.

The difference between the window and the content orientation determines how much to rotate the content by. QScreen::angleBetween(), QScreen::transformBetween(), and QScreen::mapBetween() can be used to compute the necessary transform.

The default value is Qt::PrimaryOrientation

Access functions:

Qt::ScreenOrientation contentOrientation() const
void reportContentOrientationChange(Qt::ScreenOrientation orientation)

Notifier signal:

void contentOrientationChanged(Qt::ScreenOrientation orientation)

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#contentOrientation

contentOrientationChanged

contentOrientationChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QWindow.contentOrientationChanged; argument details are not documented.

create

create() -> None

X.create()

Supplemental documentation: Qt 5 reference:

void QWindow::create()

Allocates the platform resources associated with the window.

It is at this point that the surface format set using setFormat() gets resolved into an actual native surface. However, the window remains hidden until setVisible() is called.

Note that it is not usually necessary to call this function directly, as it will be implicitly called by show(), setVisible(), and other functions that require access to the platform resources.

Call destroy() to free the platform resources if necessary.

See also destroy().

Upstream PySide2 reference signatures (binding differences may apply):

create(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#create

cursor

cursor() -> Any

X.cursor() -> PythonQt.QtGui.QCursor

Supplemental documentation: Qt 5 reference:

QCursor QWindow::cursor() const

the cursor shape for this window

See also setCursor() and unsetCursor().

Upstream PySide2 reference signatures (binding differences may apply):

cursor(self) -> PySide2.QtGui.QCursor

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#cursor

destroy

destroy() -> None

X.destroy()

Supplemental documentation: Qt 5 reference:

void QWindow::destroy()

Releases the native platform resources associated with this window.

See also create().

Upstream PySide2 reference signatures (binding differences may apply):

destroy(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#destroy

destroyed

destroyed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QWindow.destroyed; argument details are not documented.

devicePixelRatio

devicePixelRatio() -> float

X.devicePixelRatio() -> float

Supplemental documentation: Qt 5 reference:

qreal QWindow::devicePixelRatio() const

Returns the ratio between physical pixels and device-independent pixels for the window. This value is dependent on the screen the window is on, and may change when the window is moved.

Common values are 1.0 on normal displays and 2.0 on Apple "retina" displays.

Note: For windows not backed by a platform window, meaning that create() was not called, the function will fall back to the associated QScreen's device pixel ratio.

See also QScreen::devicePixelRatio().

Upstream PySide2 reference signatures (binding differences may apply):

devicePixelRatio(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#devicePixelRatio

event

event(arg__1: Any) -> bool

X.event(arg__1) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual protected] bool QWindow::event(QEvent *ev)

Reimplements: QObject::event(QEvent *e).

Override this to handle any event (ev) sent to the window. Return true if the event was recognized and processed.

Remember to call the base class version if you wish for mouse events, key events, resize events, etc to be dispatched as usual.

Upstream PySide2 reference signatures (binding differences may apply):

event(self, arg__1: PySide2.QtCore.QEvent) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#event

exposeEvent

exposeEvent(arg__1: Any) -> None

X.exposeEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QWindow::exposeEvent(QExposeEvent *ev)

The expose event (ev) is sent by the window system whenever an area of the window is invalidated, for example due to the exposure in the windowing system changing.

The application can start rendering into the window with QBackingStore and QOpenGLContext as soon as it gets an exposeEvent() such that isExposed() is true.

If the window is moved off screen, is made totally obscured by another window, iconified or similar, this function might be called and the value of isExposed() might change to false. When this happens, an application should stop its rendering as it is no longer visible to the user.

A resize event will always be sent before the expose event the first time a window is shown.

See also isExposed().

Upstream PySide2 reference signatures (binding differences may apply):

exposeEvent(self, arg__1: PySide2.QtGui.QExposeEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#exposeEvent

filePath

filePath() -> str

X.filePath() -> str

Supplemental documentation: Qt 5 reference:

QString QWindow::filePath() const

the file name this window is representing.

See also setFilePath().

Upstream PySide2 reference signatures (binding differences may apply):

filePath(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#filePath

flags instance-attribute

flags: Any

Qt 5 reference:

flags : Qt::WindowFlags

This property holds the window flags of the window

The window flags control the window's appearance in the windowing system, whether it's a dialog, popup, or a regular window, and whether it should have a title bar, etc.

The actual window flags might differ from the flags set with setFlags() if the requested flags could not be fulfilled.

Access functions:

Qt::WindowFlags flags() const
void setFlags(Qt::WindowFlags flags)

See also setFlag().

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#flags

focusInEvent

focusInEvent(arg__1: Any) -> None

X.focusInEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QWindow::focusInEvent(QFocusEvent *ev)

Override this to handle focus in events (ev).

Focus in events are sent when the window receives keyboard focus.

See also focusOutEvent().

Upstream PySide2 reference signatures (binding differences may apply):

focusInEvent(self, arg__1: PySide2.QtGui.QFocusEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#focusInEvent

focusObject

focusObject() -> Any

X.focusObject() -> PythonQt.private.QObject

Supplemental documentation: Qt 5 reference:

[virtual] QObject *QWindow::focusObject() const

Returns the QObject that will be the final receiver of events tied focus, such as key events.

Upstream PySide2 reference signatures (binding differences may apply):

focusObject(self) -> PySide2.QtCore.QObject

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#focusObject

focusObjectChanged

focusObjectChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QWindow.focusObjectChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QWindow::focusObjectChanged(QObject *object)

This signal is emitted when the final receiver of events tied to focus is changed to object.

See also focusObject().

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#focusObjectChanged

focusOutEvent

focusOutEvent(arg__1: Any) -> None

X.focusOutEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QWindow::focusOutEvent(QFocusEvent *ev)

Override this to handle focus out events (ev).

Focus out events are sent when the window loses keyboard focus.

See also focusInEvent().

Upstream PySide2 reference signatures (binding differences may apply):

focusOutEvent(self, arg__1: PySide2.QtGui.QFocusEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#focusOutEvent

format

format() -> Any

X.format() -> PythonQt.QtGui.QSurfaceFormat

Supplemental documentation: Qt 5 reference:

[override virtual] QSurfaceFormat QWindow::format() const

Reimplements: QSurface::format() const.

Returns the actual format of this window.

After the window has been created, this function will return the actual surface format of the window. It might differ from the requested format if the requested format could not be fulfilled by the platform. It might also be a superset, for example certain buffer sizes may be larger than requested.

Note: Depending on the platform, certain values in this surface format may still contain the requested values, that is, the values that have been passed to setFormat(). Typical examples are the OpenGL version, profile and options. These may not get updated during create() since these are context specific and a single window may be used together with multiple contexts over its lifetime. Use the QOpenGLContext's format() instead to query such values.

See also setFormat(), create(), requestedFormat(), and QOpenGLContext::format().

Upstream PySide2 reference signatures (binding differences may apply):

format(self) -> PySide2.QtGui.QSurfaceFormat

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#format

frameGeometry

frameGeometry() -> Any

X.frameGeometry() -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRect QWindow::frameGeometry() const

Returns the geometry of the window, including its window frame.

The geometry is in relation to the virtualGeometry() of its screen.

See also geometry() and frameMargins().

Upstream PySide2 reference signatures (binding differences may apply):

frameGeometry(self) -> PySide2.QtCore.QRect

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#frameGeometry

frameMargins

frameMargins() -> Any

X.frameMargins() -> PythonQt.QtGui.QMargins

Supplemental documentation: Qt 5 reference:

QMargins QWindow::frameMargins() const

Returns the window frame margins surrounding the window.

See also geometry() and frameGeometry().

Upstream PySide2 reference signatures (binding differences may apply):

frameMargins(self) -> PySide2.QtCore.QMargins

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#frameMargins

framePosition

framePosition() -> Any

X.framePosition() -> PythonQt.QtCore.QPoint

Supplemental documentation: Qt 5 reference:

QPoint QWindow::framePosition() const

Returns the top left position of the window, including its window frame.

This returns the same value as frameGeometry().topLeft().

See also setFramePosition(), geometry(), and frameGeometry().

Upstream PySide2 reference signatures (binding differences may apply):

framePosition(self) -> PySide2.QtCore.QPoint

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#framePosition

fromWinId

fromWinId(id: int) -> Any

X.fromWinId(id) -> PythonQt.QtGui.QWindow

Supplemental documentation: Qt 5 reference:

[static] QWindow *QWindow::fromWinId(WId id)

Creates a local representation of a window created by another process or by using native libraries below Qt.

Given the handle id to a native window, this method creates a QWindow object which can be used to represent the window when invoking methods like setParent() and setTransientParent().

This can be used, on platforms which support it, to embed a QWindow inside a native window, or to embed a native window inside a QWindow.

If foreign windows are not supported or embedding the native window failed in the platform plugin, this function returns nullptr.

Note: The resulting QWindow should not be used to manipulate the underlying native window (besides re-parenting), or to observe state changes of the native window. Any support for these kind of operations is incidental, highly platform dependent and untested.

See also setParent().

Upstream PySide2 reference signatures (binding differences may apply):

fromWinId(id: int) -> PySide2.QtGui.QWindow

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#fromWinId

geometry

geometry() -> Any

X.geometry() -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRect QWindow::geometry() const

Returns the geometry of the window, excluding its window frame.

The geometry is in relation to the virtualGeometry() of its screen.

See also setGeometry(), frameMargins(), and frameGeometry().

Upstream PySide2 reference signatures (binding differences may apply):

geometry(self) -> PySide2.QtCore.QRect

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#geometry

height instance-attribute

height: int

Qt 5 reference:

height : int

This property holds the height of the window's geometry

Access functions:

int height() const
void setHeight(int arg)

Notifier signal:

void heightChanged(int arg)

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#height

heightChanged

heightChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QWindow.heightChanged; argument details are not documented.

hide

hide() -> None

X.hide()

Supplemental documentation: Qt 5 reference:

[slot] void QWindow::hide()

Hides the window.

Equivalent to calling setVisible(false).

See also show() and setVisible().

Upstream PySide2 reference signatures (binding differences may apply):

hide(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#hide

hideEvent

hideEvent(arg__1: Any) -> None

X.hideEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QWindow::hideEvent(QHideEvent *ev)

Override this to handle hide events (ev).

The function is called when the window has requested being hidden in the windowing system.

Upstream PySide2 reference signatures (binding differences may apply):

hideEvent(self, arg__1: PySide2.QtGui.QHideEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#hideEvent

icon

icon() -> Any

X.icon() -> PythonQt.QtGui.QIcon

Supplemental documentation: Qt 5 reference:

QIcon QWindow::icon() const

Returns the window's icon in the windowing system

See also setIcon().

Upstream PySide2 reference signatures (binding differences may apply):

icon(self) -> PySide2.QtGui.QIcon

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#icon

isActive

isActive() -> bool

X.isActive() -> bool

Supplemental documentation: Qt 5 reference:

bool QWindow::isActive() const

Returns true if the window is active.

This is the case for the window that has input focus as well as windows that are in the same parent / transient parent chain as the focus window.

Typically active windows should appear active from a style perspective.

To get the window that currently has focus, use QGuiApplication::focusWindow().

Note: Getter function for property active.

Upstream PySide2 reference signatures (binding differences may apply):

isActive(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#isActive

isAncestorOf

isAncestorOf(child: Any, mode: Any) -> bool

X.isAncestorOf(child, mode) -> bool

Supplemental documentation: Qt 5 reference:

bool QWindow::isAncestorOf(const QWindow *child, QWindow::AncestorMode mode \= IncludeTransients) const

Returns true if the window is an ancestor of the given child. If mode is IncludeTransients, then transient parents are also considered ancestors.

Upstream PySide2 reference signatures (binding differences may apply):

isAncestorOf(self, child: PySide2.QtGui.QWindow, mode: PySide2.QtGui.QWindow.AncestorMode=...) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#isAncestorOf

isExposed

isExposed() -> bool

X.isExposed() -> bool

Supplemental documentation: Qt 5 reference:

bool QWindow::isExposed() const

Returns if this window is exposed in the windowing system.

When the window is not exposed, it is shown by the application but it is still not showing in the windowing system, so the application should minimize rendering and other graphical activities.

An exposeEvent() is sent every time this value changes.

See also exposeEvent().

Upstream PySide2 reference signatures (binding differences may apply):

isExposed(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#isExposed

isModal

isModal() -> bool

X.isModal() -> bool

Supplemental documentation: Qt 5 reference:

bool QWindow::isModal() const

Returns whether the window is modal.

A modal window prevents other windows from getting any input.

See also QWindow::modality.

Upstream PySide2 reference signatures (binding differences may apply):

isModal(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#isModal

isTopLevel

isTopLevel() -> bool

X.isTopLevel() -> bool

Supplemental documentation: Qt 5 reference:

bool QWindow::isTopLevel() const

Returns whether the window is top level, i.e. has no parent window.

Upstream PySide2 reference signatures (binding differences may apply):

isTopLevel(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#isTopLevel

isVisible

isVisible() -> bool

X.isVisible() -> bool

Upstream PySide2 reference signatures (binding differences may apply):

isVisible(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#isVisible

keyPressEvent

keyPressEvent(arg__1: Any) -> None

X.keyPressEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QWindow::keyPressEvent(QKeyEvent *ev)

Override this to handle key press events (ev).

See also keyReleaseEvent().

Upstream PySide2 reference signatures (binding differences may apply):

keyPressEvent(self, arg__1: PySide2.QtGui.QKeyEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#keyPressEvent

keyReleaseEvent

keyReleaseEvent(arg__1: Any) -> None

X.keyReleaseEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QWindow::keyReleaseEvent(QKeyEvent *ev)

Override this to handle key release events (ev).

See also keyPressEvent().

Upstream PySide2 reference signatures (binding differences may apply):

keyReleaseEvent(self, arg__1: PySide2.QtGui.QKeyEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#keyReleaseEvent

lower

lower() -> None

X.lower()

Supplemental documentation: Qt 5 reference:

[slot] void QWindow::lower()

Lower the window in the windowing system.

Requests that the window be lowered to appear below other windows.

Upstream PySide2 reference signatures (binding differences may apply):

lower(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwindow.html#lower