QWindow

The QWindow class represents a window in the underlying windowing system. More

Inheritance diagram of PySide2.QtGui.QWindow

Inherited by: Qt3DExtras.Qt3DWindow, QtDataVisualization.Q3DBars, QtDataVisualization.Q3DScatter, QtDataVisualization.Q3DSurface, QtDataVisualization.QAbstract3DGraph, QQuickView, QQuickWindow

Synopsis

Functions

Virtual functions

Slots

Signals

Static functions

Detailed Description

A window that is supplied a parent becomes a native child window of their parent window.

An application will typically use QWidget or QQuickView for its UI, and not QWindow directly. Still, it is possible to render directly to a QWindow with QBackingStore or QOpenGLContext , when wanting to keep dependencies to a minimum or when wanting to use OpenGL directly. The Raster Window Example and OpenGL Window Example are useful reference examples for how to render to a QWindow using either approach.

Resource Management

Windows can potentially use a lot of memory. A usual measurement is width times height times color depth. A window might also include multiple buffers to support double and triple buffering, as well as depth and stencil buffers. To release a window’s memory resources, call the destroy() function.

Content Orientation

QWindow has reportContentOrientationChange() that can be used to specify the layout of the window contents in relation to the screen. The content orientation is simply a hint to the windowing system about which orientation the window contents are in. It’s useful when you wish to keep the same window size, but rotate the contents instead, especially when doing rotation animations between different orientations. The windowing system might use this value to determine the layout of system popups or dialogs.

Visibility and Windowing System Exposure

By default, the window is not visible, and you must call setVisible (true), or show() or similar to make it visible. To make a window hidden again, call setVisible (false) or hide() . The visible property describes the state the application wants the window to be in. Depending on the underlying system, a visible window might still not be shown on the screen. It could, for instance, be covered by other opaque windows or moved outside the physical area of the screen. On windowing systems that have exposure notifications, the isExposed() accessor describes whether the window should be treated as directly visible on screen. The exposeEvent() function is called whenever an area of the window is invalidated, for example due to the exposure in the windowing system changing. On windowing systems that do not make this information visible to the application, isExposed() will simply return the same value as isVisible() .

Visibility queried through visibility() is a convenience API combining the functions of visible() and windowStates() .

Rendering

There are two Qt APIs that can be used to render content into a window, QBackingStore for rendering with a QPainter and flushing the contents to a window with type RasterSurface , and QOpenGLContext for rendering with OpenGL to a window with type OpenGLSurface .

The application can start rendering as soon as isExposed() returns true , and can keep rendering until it isExposed() returns false . To find out when isExposed() changes, reimplement exposeEvent() . The window will always get a resize event before the first expose event.

Initial Geometry

If the window’s width and height are left uninitialized, the window will get a reasonable default geometry from the platform window. If the position is left uninitialized, then the platform window will allow the windowing system to position the window. For example on X11, the window manager usually does some kind of smart positioning to try to avoid having new windows completely obscure existing windows. However setGeometry() initializes both the position and the size, so if you want a fixed size but an automatic position, you should call resize() or setWidth() and setHeight() instead.

class QWindow([screen=None])

QWindow(parent)

param parent

QWindow

param screen

QScreen

Creates a window as a top level on the targetScreen .

The window is not shown until setVisible (true), show() , or similar is called.

See also

setScreen()

Creates a window as a child of the given parent window.

The window will be embedded inside the parent window, its coordinates relative to the parent.

The screen is inherited from the parent.

See also

setParent()

PySide2.QtGui.QWindow.Visibility

This enum describes what part of the screen the window occupies or should occupy.

Constant

Description

QWindow.Windowed

The window occupies part of the screen, but not necessarily the entire screen. This state will occur only on windowing systems which support showing multiple windows simultaneously. In this state it is possible for the user to move and resize the window manually, if WindowFlags permit it and if it is supported by the windowing system.

QWindow.Minimized

The window is reduced to an entry or icon on the task bar, dock, task list or desktop, depending on how the windowing system handles minimized windows.

QWindow.Maximized

The window occupies one entire screen, and the titlebar is still visible. On most windowing systems this is the state achieved by clicking the maximize button on the toolbar.

QWindow.FullScreen

The window occupies one entire screen, is not resizable, and there is no titlebar. On some platforms which do not support showing multiple simultaneous windows, this can be the usual visibility when the window is not hidden.

QWindow.AutomaticVisibility

This means to give the window a default visible state, which might be fullscreen or windowed depending on the platform. It can be given as a parameter to setVisibility but will never be read back from the visibility accessor.

QWindow.Hidden

The window is not visible in any way, however it may remember a latent visibility which can be restored by setting .

PySide2.QtGui.QWindow.AncestorMode

This enum is used to control whether or not transient parents should be considered ancestors.

Constant

Description

QWindow.ExcludeTransients

Transient parents are not considered ancestors.

QWindow.IncludeTransients

Transient parents are considered ancestors.

PySide2.QtGui.QWindow.accessibleRoot()
Return type

QAccessibleInterface

Returns the accessibility interface for the object that the window represents

See also

QAccessible

PySide2.QtGui.QWindow.activeChanged()
PySide2.QtGui.QWindow.alert(msec)
Parameters

msecint

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.

PySide2.QtGui.QWindow.baseSize()
Return type

QSize

Returns the base size of the window.

See also

setBaseSize()

PySide2.QtGui.QWindow.close()
Return type

bool

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).

PySide2.QtGui.QWindow.contentOrientation()
Return type

ScreenOrientation

PySide2.QtGui.QWindow.contentOrientationChanged(orientation)
Parameters

orientationScreenOrientation

PySide2.QtGui.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()

PySide2.QtGui.QWindow.cursor()
Return type

QCursor

the cursor shape for this window

PySide2.QtGui.QWindow.destroy()

Releases the native platform resources associated with this window.

See also

create()

PySide2.QtGui.QWindow.devicePixelRatio()
Return type

qreal

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.

PySide2.QtGui.QWindow.exposeEvent(arg__1)
Parameters

arg__1QExposeEvent

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 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()

PySide2.QtGui.QWindow.filePath()
Return type

unicode

the file name this window is representing.

See also

setFilePath()

PySide2.QtGui.QWindow.flags()
Return type

WindowFlags

See also

setFlags()

PySide2.QtGui.QWindow.focusInEvent(arg__1)
Parameters

arg__1QFocusEvent

Override this to handle focus in events (ev ).

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

See also

focusOutEvent()

PySide2.QtGui.QWindow.focusObject()
Return type

QObject

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

PySide2.QtGui.QWindow.focusObjectChanged(object)
Parameters

objectQObject

PySide2.QtGui.QWindow.focusOutEvent(arg__1)
Parameters

arg__1QFocusEvent

Override this to handle focus out events (ev ).

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

See also

focusInEvent()

PySide2.QtGui.QWindow.frameGeometry()
Return type

QRect

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

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

PySide2.QtGui.QWindow.frameMargins()
Return type

QMargins

Returns the window frame margins surrounding the window.

PySide2.QtGui.QWindow.framePosition()
Return type

QPoint

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

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

static PySide2.QtGui.QWindow.fromWinId(id)
Parameters

idWId

Return type

QWindow

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 .

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 None .

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.

PySide2.QtGui.QWindow.geometry()
Return type

QRect

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

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

PySide2.QtGui.QWindow.height()
Return type

int

See also

setHeight()

PySide2.QtGui.QWindow.heightChanged(arg)
Parameters

argint

PySide2.QtGui.QWindow.hide()

Hides the window.

Equivalent to calling setVisible (false).

See also

show() setVisible()

PySide2.QtGui.QWindow.hideEvent(arg__1)
Parameters

arg__1QHideEvent

Override this to handle hide events (ev ).

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

PySide2.QtGui.QWindow.icon()
Return type

QIcon

Returns the window’s icon in the windowing system

See also

setIcon()

PySide2.QtGui.QWindow.isActive()
Return type

bool

Returns true if the window should appear active from a style perspective.

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.

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

PySide2.QtGui.QWindow.isAncestorOf(child[, mode=IncludeTransients])
Parameters
Return type

bool

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

PySide2.QtGui.QWindow.isExposed()
Return type

bool

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()

PySide2.QtGui.QWindow.isModal()
Return type

bool

Returns whether the window is modal.

A modal window prevents other windows from getting any input.

See also

modality

PySide2.QtGui.QWindow.isTopLevel()
Return type

bool

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

PySide2.QtGui.QWindow.isVisible()
Return type

bool

PySide2.QtGui.QWindow.keyPressEvent(arg__1)
Parameters

arg__1QKeyEvent

Override this to handle key press events (ev ).

PySide2.QtGui.QWindow.keyReleaseEvent(arg__1)
Parameters

arg__1QKeyEvent

Override this to handle key release events (ev ).

See also

keyPressEvent()

PySide2.QtGui.QWindow.lower()

Lower the window in the windowing system.

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

PySide2.QtGui.QWindow.mapFromGlobal(pos)
Parameters

posQPoint

Return type

QPoint

Translates the global screen coordinate pos to window coordinates.

See also

mapToGlobal()

PySide2.QtGui.QWindow.mapToGlobal(pos)
Parameters

posQPoint

Return type

QPoint

Translates the window coordinate pos to global screen coordinates. For example, mapToGlobal(QPoint(0,0)) would give the global coordinates of the top-left pixel of the window.

See also

mapFromGlobal()

PySide2.QtGui.QWindow.mask()
Return type

QRegion

Returns the mask set on the window.

The mask is a hint to the windowing system that the application does not want to receive mouse or touch input outside the given region.

See also

setMask()

PySide2.QtGui.QWindow.maximumHeight()
Return type

int

PySide2.QtGui.QWindow.maximumHeightChanged(arg)
Parameters

argint

PySide2.QtGui.QWindow.maximumSize()
Return type

QSize

Returns the maximum size of the window.

See also

setMaximumSize()

PySide2.QtGui.QWindow.maximumWidth()
Return type

int

PySide2.QtGui.QWindow.maximumWidthChanged(arg)
Parameters

argint

PySide2.QtGui.QWindow.minimumHeight()
Return type

int

PySide2.QtGui.QWindow.minimumHeightChanged(arg)
Parameters

argint

PySide2.QtGui.QWindow.minimumSize()
Return type

QSize

Returns the minimum size of the window.

See also

setMinimumSize()

PySide2.QtGui.QWindow.minimumWidth()
Return type

int

PySide2.QtGui.QWindow.minimumWidthChanged(arg)
Parameters

argint

PySide2.QtGui.QWindow.modality()
Return type

WindowModality

See also

setModality()

PySide2.QtGui.QWindow.modalityChanged(modality)
Parameters

modalityWindowModality

PySide2.QtGui.QWindow.mouseDoubleClickEvent(arg__1)
Parameters

arg__1QMouseEvent

Override this to handle mouse double click events (ev ).

PySide2.QtGui.QWindow.mouseMoveEvent(arg__1)
Parameters

arg__1QMouseEvent

Override this to handle mouse move events (ev ).

PySide2.QtGui.QWindow.mousePressEvent(arg__1)
Parameters

arg__1QMouseEvent

Override this to handle mouse press events (ev ).

PySide2.QtGui.QWindow.mouseReleaseEvent(arg__1)
Parameters

arg__1QMouseEvent

Override this to handle mouse release events (ev ).

PySide2.QtGui.QWindow.moveEvent(arg__1)
Parameters

arg__1QMoveEvent

Override this to handle window move events (ev ).

PySide2.QtGui.QWindow.nativeEvent(eventType, message)
Parameters
  • eventTypeQByteArray

  • messagevoid

Return type

PyObject

Override this to handle platform dependent events. Will be given eventType , message and result .

This might make your application non-portable.

Should return true only if the event was handled.

PySide2.QtGui.QWindow.opacity()
Return type

qreal

See also

setOpacity()

PySide2.QtGui.QWindow.opacityChanged(opacity)
Parameters

opacityqreal

PySide2.QtGui.QWindow.parent(mode)
Parameters

modeAncestorMode

Return type

QWindow

Returns the parent window, if any.

If mode is IncludeTransients , then the transient parent is returned if there is no parent.

A window without a parent is known as a top level window.

See also

setParent()

PySide2.QtGui.QWindow.position()
Return type

QPoint

Returns the position of the window on the desktop excluding any window frame

See also

setPosition()

PySide2.QtGui.QWindow.raise_()

Raise the window in the windowing system.

Requests that the window be raised to appear above other windows.

PySide2.QtGui.QWindow.reportContentOrientationChange(orientation)
Parameters

orientationScreenOrientation

PySide2.QtGui.QWindow.requestActivate()

Requests the window to be activated, i.e. receive keyboard focus.

See also

isActive() focusWindow() setWindowActivationBehavior()

PySide2.QtGui.QWindow.requestUpdate()

Schedules a UpdateRequest event to be delivered to this window.

The event is delivered in sync with the display vsync on platforms where this is possible. Otherwise, the event is delivered after a delay of 5 ms. The additional time is there to give the event loop a bit of idle time to gather system events, and can be overridden using the QT_QPA_UPDATE_IDLE_TIME environment variable.

When driving animations, this function should be called once after drawing has completed. Calling this function multiple times will result in a single event being delivered to the window.

Subclasses of QWindow should reimplement event() , intercept the event and call the application’s rendering code, then call the base class implementation.

Note

The subclass’ reimplementation of event() must invoke the base class implementation, unless it is absolutely sure that the event does not need to be handled by the base class. For example, the default implementation of this function relies on Timer events. Filtering them away would therefore break the delivery of the update events.

PySide2.QtGui.QWindow.requestedFormat()
Return type

QSurfaceFormat

Returns the requested surface format of this window.

If the requested format was not supported by the platform implementation, the will differ from the actual window format.

This is the value set with setFormat() .

See also

setFormat() format()

PySide2.QtGui.QWindow.resize(newSize)
Parameters

newSizeQSize

set the size of the window, excluding any window frame, to newSize

See also

size() geometry()

PySide2.QtGui.QWindow.resize(w, h)
Parameters
  • wint

  • hint

set the size of the window, excluding any window frame, to a QSize constructed from width w and height h

See also

size() geometry()

PySide2.QtGui.QWindow.resizeEvent(arg__1)
Parameters

arg__1QResizeEvent

Override this to handle resize events (ev ).

The resize event is called whenever the window is resized in the windowing system, either directly through the windowing system acknowledging a setGeometry() or resize() request, or indirectly through the user resizing the window manually.

PySide2.QtGui.QWindow.screen()
Return type

QScreen

Returns the screen on which the window is shown, or null if there is none.

For child windows, this returns the screen of the corresponding top level window.

PySide2.QtGui.QWindow.screenChanged(screen)
Parameters

screenQScreen

PySide2.QtGui.QWindow.setBaseSize(size)
Parameters

sizeQSize

Sets the base size of the window.

The base size is used to calculate a proper window size if the window defines sizeIncrement() .

PySide2.QtGui.QWindow.setCursor(arg__1)
Parameters

arg__1QCursor

set the cursor shape for this window

The mouse cursor will assume this shape when it is over this window, unless an override cursor is set. See the list of predefined cursor objects for a range of useful shapes.

If no cursor has been set, or after a call to unsetCursor() , the parent window’s cursor is used.

By default, the cursor has the ArrowCursor shape.

Some underlying window implementations will reset the cursor if it leaves a window even if the mouse is grabbed. If you want to have a cursor set for all windows, even when outside the window, consider setOverrideCursor() .

PySide2.QtGui.QWindow.setFilePath(filePath)
Parameters

filePath – unicode

set the file name this window is representing.

The windowing system might use filePath to display the path of the document this window is representing in the tile bar.

See also

filePath()

PySide2.QtGui.QWindow.setFlag(arg__1[, on=true])
Parameters
  • arg__1WindowType

  • onbool

Sets the window flag flag on this window if on is true; otherwise clears the flag.

PySide2.QtGui.QWindow.setFlags(flags)
Parameters

flagsWindowFlags

See also

flags()

PySide2.QtGui.QWindow.setFormat(format)
Parameters

formatQSurfaceFormat

Sets the window’s surface format .

The format determines properties such as color depth, alpha, depth and stencil buffer size, etc. For example, to give a window a transparent background (provided that the window system supports compositing, and provided that other content in the window does not make it opaque again):

QSurfaceFormat format;
format.setAlphaBufferSize(8);
window.setFormat(format);

The surface format will be resolved in the create() function. Calling this function after create() has been called will not re-resolve the surface format of the native surface.

When the format is not explicitly set via this function, the format returned by defaultFormat() will be used. This means that when having multiple windows, individual calls to this function can be replaced by one single call to setDefaultFormat() before creating the first window.

PySide2.QtGui.QWindow.setFramePosition(point)
Parameters

pointQPoint

Sets the upper left position of the window (point ) including its window frame.

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

PySide2.QtGui.QWindow.setGeometry(posx, posy, w, h)
Parameters
  • posxint

  • posyint

  • wint

  • hint

Sets the geometry of the window, excluding its window frame, to a rectangle constructed from posx , posy , w and h .

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

See also

geometry()

PySide2.QtGui.QWindow.setGeometry(rect)
Parameters

rectQRect

Sets the geometry of the window, excluding its window frame, to rect .

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

See also

geometry()

PySide2.QtGui.QWindow.setHeight(arg)
Parameters

argint

See also

height()

PySide2.QtGui.QWindow.setIcon(icon)
Parameters

iconQIcon

Sets the window’s icon in the windowing system

The window icon might be used by the windowing system for example to decorate the window, and/or in the task switcher.

Note

On macOS , the window title bar icon is meant for windows representing documents, and will only show up if a file path is also set.

PySide2.QtGui.QWindow.setKeyboardGrabEnabled(grab)
Parameters

grabbool

Return type

bool

Sets whether keyboard grab should be enabled or not (grab ).

If the return value is true, the window receives all key events until (false) is called; other windows get no key events at all. Mouse events are not affected. Use setMouseGrabEnabled() if you want to grab that.

PySide2.QtGui.QWindow.setMask(region)
Parameters

regionQRegion

Sets the mask of the window.

The mask is a hint to the windowing system that the application does not want to receive mouse or touch input outside the given region .

The window manager may or may not choose to display any areas of the window not included in the mask, thus it is the application’s responsibility to clear to transparent the areas that are not part of the mask.

See also

mask()

PySide2.QtGui.QWindow.setMaximumHeight(h)
Parameters

hint

See also

maximumHeight()

PySide2.QtGui.QWindow.setMaximumSize(size)
Parameters

sizeQSize

Sets the maximum size of the window.

This is a hint to the window manager to prevent resizing above the specified size .

PySide2.QtGui.QWindow.setMaximumWidth(w)
Parameters

wint

See also

maximumWidth()

PySide2.QtGui.QWindow.setMinimumHeight(h)
Parameters

hint

See also

minimumHeight()

PySide2.QtGui.QWindow.setMinimumSize(size)
Parameters

sizeQSize

Sets the minimum size of the window.

This is a hint to the window manager to prevent resizing below the specified size .

PySide2.QtGui.QWindow.setMinimumWidth(w)
Parameters

wint

See also

minimumWidth()

PySide2.QtGui.QWindow.setModality(modality)
Parameters

modalityWindowModality

See also

modality()

PySide2.QtGui.QWindow.setMouseGrabEnabled(grab)
Parameters

grabbool

Return type

bool

Sets whether mouse grab should be enabled or not (grab ).

If the return value is true, the window receives all mouse events until (false) is called; other windows get no mouse events at all. Keyboard events are not affected. Use setKeyboardGrabEnabled() if you want to grab that.

PySide2.QtGui.QWindow.setOpacity(level)
Parameters

levelqreal

See also

opacity()

PySide2.QtGui.QWindow.setParent(parent)
Parameters

parentQWindow

Sets the parent Window. This will lead to the windowing system managing the clip of the window, so it will be clipped to the parent window.

Setting parent to be None will make the window become a top level window.

If parent is a window created by fromWinId() , then the current window will be embedded inside parent , if the platform supports it.

See also

parent()

PySide2.QtGui.QWindow.setPosition(pt)
Parameters

ptQPoint

set the position of the window on the desktop to pt

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

See also

position()

PySide2.QtGui.QWindow.setPosition(posx, posy)
Parameters
  • posxint

  • posyint

set the position of the window on the desktop to posx , posy

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

See also

position()

PySide2.QtGui.QWindow.setScreen(screen)
Parameters

screenQScreen

Sets the screen on which the window should be shown.

If the window has been created, it will be recreated on the newScreen .

Note

If the screen is part of a virtual desktop of multiple screens, the window will not move automatically to newScreen . To place the window relative to the screen, use the screen’s topLeft() position.

This function only works for top level windows.

PySide2.QtGui.QWindow.setSizeIncrement(size)
Parameters

sizeQSize

Sets the size increment (size ) of the window.

When the user resizes the window, the size will move in steps of sizeIncrement() . width() pixels horizontally and sizeIncrement() . height() pixels vertically, with baseSize() as the basis.

By default, this property contains a size with zero width and height.

The windowing system might not support size increments.

PySide2.QtGui.QWindow.setSurfaceType(surfaceType)
Parameters

surfaceTypeSurfaceType

Sets the surfaceType of the window.

Specifies whether the window is meant for raster rendering with QBackingStore , or OpenGL rendering with QOpenGLContext .

The surfaceType will be used when the native surface is created in the create() function. Calling this function after the native surface has been created requires calling destroy() and create() to release the old native surface and create a new one.

PySide2.QtGui.QWindow.setTitle(arg__1)
Parameters

arg__1 – unicode

See also

title()

PySide2.QtGui.QWindow.setTransientParent(parent)
Parameters

parentQWindow

PySide2.QtGui.QWindow.setVisibility(v)
Parameters

vVisibility

See also

visibility()

PySide2.QtGui.QWindow.setVisible(visible)
Parameters

visiblebool

See also

isVisible()

PySide2.QtGui.QWindow.setWidth(arg)
Parameters

argint

See also

width()

PySide2.QtGui.QWindow.setWindowState(state)
Parameters

stateWindowState

set the screen-occupation state of the window

The window state represents whether the window appears in the windowing system as maximized, minimized, fullscreen, or normal.

The enum value WindowActive is not an accepted parameter.

PySide2.QtGui.QWindow.setWindowStates(states)
Parameters

statesWindowStates

set the screen-occupation state of the window

The window state represents whether the window appears in the windowing system as maximized, minimized and/or fullscreen.

The window can be in a combination of several states. For example, if the window is both minimized and maximized, the window will appear minimized, but clicking on the task bar entry will restore it to the maximized state.

The enum value WindowActive should not be set.

PySide2.QtGui.QWindow.setX(arg)
Parameters

argint

See also

x()

PySide2.QtGui.QWindow.setY(arg)
Parameters

argint

See also

y()

PySide2.QtGui.QWindow.show()

Shows the window.

This is equivalent to calling showFullScreen() , showMaximized() , or showNormal() , depending on the platform’s default behavior for the window type and flags.

PySide2.QtGui.QWindow.showEvent(arg__1)
Parameters

arg__1QShowEvent

Override this to handle show events (ev ).

The function is called when the window has requested becoming visible.

If the window is successfully shown by the windowing system, this will be followed by a resize and an expose event.

PySide2.QtGui.QWindow.showFullScreen()

Shows the window as fullscreen.

Equivalent to calling setWindowStates ( WindowFullScreen ) and then setVisible (true).

PySide2.QtGui.QWindow.showMaximized()

Shows the window as maximized.

Equivalent to calling setWindowStates ( WindowMaximized ) and then setVisible (true).

PySide2.QtGui.QWindow.showMinimized()

Shows the window as minimized.

Equivalent to calling setWindowStates ( WindowMinimized ) and then setVisible (true).

PySide2.QtGui.QWindow.showNormal()

Shows the window as normal, i.e. neither maximized, minimized, nor fullscreen.

Equivalent to calling setWindowStates ( WindowNoState ) and then setVisible (true).

PySide2.QtGui.QWindow.sizeIncrement()
Return type

QSize

Returns the size increment of the window.

PySide2.QtGui.QWindow.tabletEvent(arg__1)
Parameters

arg__1QTabletEvent

Override this to handle tablet press, move, and release events (ev ).

Proximity enter and leave events are not sent to windows, they are delivered to the application instance.

PySide2.QtGui.QWindow.title()
Return type

unicode

See also

setTitle()

PySide2.QtGui.QWindow.touchEvent(arg__1)
Parameters

arg__1QTouchEvent

Override this to handle touch events (ev ).

PySide2.QtGui.QWindow.transientParent()
Return type

QWindow

PySide2.QtGui.QWindow.transientParentChanged(transientParent)
Parameters

transientParentQWindow

PySide2.QtGui.QWindow.type()
Return type

WindowType

Returns the type of the window.

This returns the part of the window flags that represents whether the window is a dialog, tooltip, popup, regular window, etc.

See also

flags() setFlags()

PySide2.QtGui.QWindow.unsetCursor()

Restores the default arrow cursor for this window.

PySide2.QtGui.QWindow.visibility()
Return type

Visibility

See also

setVisibility()

PySide2.QtGui.QWindow.visibilityChanged(visibility)
Parameters

visibilityVisibility

PySide2.QtGui.QWindow.visibleChanged(arg)
Parameters

argbool

PySide2.QtGui.QWindow.wheelEvent(arg__1)
Parameters

arg__1QWheelEvent

Override this to handle mouse wheel or other wheel events (ev ).

PySide2.QtGui.QWindow.width()
Return type

int

See also

setWidth()

PySide2.QtGui.QWindow.widthChanged(arg)
Parameters

argint

PySide2.QtGui.QWindow.winId()
Return type

WId

Returns the window’s platform id.

For platforms where this id might be useful, the value returned will uniquely represent the window inside the corresponding screen.

See also

screen()

PySide2.QtGui.QWindow.windowState()
Return type

WindowState

the screen-occupation state of the window

PySide2.QtGui.QWindow.windowStateChanged(windowState)
Parameters

windowStateWindowState

PySide2.QtGui.QWindow.windowStates()
Return type

WindowStates

the screen-occupation state of the window

The window can be in a combination of several states. For example, if the window is both minimized and maximized, the window will appear minimized, but clicking on the task bar entry will restore it to the maximized state.

PySide2.QtGui.QWindow.windowTitleChanged(title)
Parameters

title – unicode

PySide2.QtGui.QWindow.x()
Return type

int

See also

setX()

PySide2.QtGui.QWindow.xChanged(arg)
Parameters

argint

PySide2.QtGui.QWindow.y()
Return type

int

See also

setY()

PySide2.QtGui.QWindow.yChanged(arg)
Parameters

argint