Skip to content

PythonQt.QtGui.QWidget · declarations 006

Back to PythonQt.QtGui.QWidget

setToolTip

setToolTip(arg__1: str) -> None

X.setToolTip(arg__1)

Upstream PySide2 reference signatures (binding differences may apply):

setToolTip(self, arg__1: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setToolTip

setToolTipDuration

setToolTipDuration(msec: int) -> None

X.setToolTipDuration(msec)

Upstream PySide2 reference signatures (binding differences may apply):

setToolTipDuration(self, msec: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setToolTipDuration

setUpdatesEnabled

setUpdatesEnabled(enable: bool) -> None

X.setUpdatesEnabled(enable)

Upstream PySide2 reference signatures (binding differences may apply):

setUpdatesEnabled(self, enable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setUpdatesEnabled

setVisible

setVisible(visible: bool) -> None

X.setVisible(visible)

Upstream PySide2 reference signatures (binding differences may apply):

setVisible(self, visible: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setVisible

setWhatsThis

setWhatsThis(arg__1: str) -> None

X.setWhatsThis(arg__1)

Upstream PySide2 reference signatures (binding differences may apply):

setWhatsThis(self, arg__1: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setWhatsThis

setWindowFilePath

setWindowFilePath(filePath: str) -> None

X.setWindowFilePath(filePath)

Upstream PySide2 reference signatures (binding differences may apply):

setWindowFilePath(self, filePath: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setWindowFilePath

setWindowFlags

setWindowFlags(type: Any) -> None

X.setWindowFlags(type)

Upstream PySide2 reference signatures (binding differences may apply):

setWindowFlags(self, type: PySide2.QtCore.Qt.WindowFlags) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setWindowFlags

setWindowIcon

setWindowIcon(icon: Any) -> None

X.setWindowIcon(icon)

Upstream PySide2 reference signatures (binding differences may apply):

setWindowIcon(self, icon: PySide2.QtGui.QIcon) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setWindowIcon

setWindowIconText

setWindowIconText(arg__1: str) -> None

X.setWindowIconText(arg__1)

Upstream PySide2 reference signatures (binding differences may apply):

setWindowIconText(self, arg__1: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setWindowIconText

setWindowModality

setWindowModality(windowModality: Any) -> None

X.setWindowModality(windowModality)

Upstream PySide2 reference signatures (binding differences may apply):

setWindowModality(self, windowModality: PySide2.QtCore.Qt.WindowModality) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setWindowModality

setWindowModified

setWindowModified(a: Any) -> None

X.setWindowModified(a)

Upstream PySide2 reference signatures (binding differences may apply):

setWindowModified(self, arg__1: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setWindowModified

setWindowOpacity

setWindowOpacity(level: float) -> None

X.setWindowOpacity(level)

Upstream PySide2 reference signatures (binding differences may apply):

setWindowOpacity(self, level: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setWindowOpacity

setWindowRole

setWindowRole(arg__1: str) -> None

X.setWindowRole(arg__1)

Supplemental documentation: Qt 5 reference:

void QWidget::setWindowRole(const QString \&role)

Sets the window's role to role. This only makes sense for windows on X11.

See also windowRole().

Upstream PySide2 reference signatures (binding differences may apply):

setWindowRole(self, arg__1: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setWindowRole

setWindowState

setWindowState(state: Any) -> None

X.setWindowState(state)

Supplemental documentation: Qt 5 reference:

void QWidget::setWindowState(Qt::WindowStates windowState)

Sets the window state to windowState. The window state is a OR'ed combination of Qt::WindowState: Qt::WindowMinimized, Qt::WindowMaximized, Qt::WindowFullScreen, and Qt::WindowActive.

If the window is not visible (i.e. isVisible() returns false), the window state will take effect when show() is called. For visible windows, the change is immediate. For example, to toggle between full-screen and normal mode, use the following code:

w->setWindowState(w->windowState() ^ Qt::WindowFullScreen);

In order to restore and activate a minimized window (while preserving its maximized and/or full-screen state), use the following:

w->setWindowState((w->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);

Calling this function will hide the widget. You must call show() to make the widget visible again.

Note: On some window systems Qt::WindowActive is not immediate, and may be ignored in certain cases.

When the window state changes, the widget receives a changeEvent() of type QEvent::WindowStateChange.

See also Qt::WindowState and windowState().

Upstream PySide2 reference signatures (binding differences may apply):

setWindowState(self, state: PySide2.QtCore.Qt.WindowStates) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setWindowState

setWindowTitle

setWindowTitle(a: Any) -> None

X.setWindowTitle(a)

Upstream PySide2 reference signatures (binding differences may apply):

setWindowTitle(self, arg__1: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#setWindowTitle

sharedPainter

sharedPainter() -> Any

X.sharedPainter() -> PythonQt.QtGui.QPainter

Upstream PySide2 reference signatures (binding differences may apply):

sharedPainter(self) -> PySide2.QtGui.QPainter

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#sharedPainter

show

show() -> None

X.show()

Supplemental documentation: Qt 5 reference:

[slot] void QWidget::show()

Shows the widget and its child widgets.

This is equivalent to calling showFullScreen(), showMaximized(), or setVisible(true), depending on the platform's default behavior for the window flags.

See also raise(), showEvent(), hide(), setVisible(), showMinimized(), showMaximized(), showNormal(), isVisible(), and windowFlags().

Upstream PySide2 reference signatures (binding differences may apply):

show(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#show

showEvent

showEvent(event: Any) -> None

X.showEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QWidget::showEvent(QShowEvent *event)

This event handler can be reimplemented in a subclass to receive widget show events which are passed in the event parameter.

Non-spontaneous show events are sent to widgets immediately before they are shown. The spontaneous show events of windows are delivered afterwards.

Note: A widget receives spontaneous show and hide events when its mapping status is changed by the window system, e.g. a spontaneous hide event when the user minimizes the window, and a spontaneous show event when the window is restored again. After receiving a spontaneous hide event, a widget is still considered visible in the sense of isVisible().

See also visible, event(), and QShowEvent.

Upstream PySide2 reference signatures (binding differences may apply):

showEvent(self, event: PySide2.QtGui.QShowEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#showEvent

showFullScreen

showFullScreen() -> None

X.showFullScreen()

Supplemental documentation: Qt 5 reference:

[slot] void QWidget::showFullScreen()

Shows the widget in full-screen mode.

Calling this function only affects windows.

To return from full-screen mode, call showNormal() or close().

Note: Full-screen mode works fine under Windows, but has certain problems under X. These problems are due to limitations of the ICCCM protocol that specifies the communication between X11 clients and the window manager. ICCCM simply does not understand the concept of non-decorated full-screen windows. Therefore, the best we can do is to request a borderless window and place and resize it to fill the entire screen. Depending on the window manager, this may or may not work. The borderless window is requested using MOTIF hints, which are at least partially supported by virtually all modern window managers.

An alternative would be to bypass the window manager entirely and create a window with the Qt::X11BypassWindowManagerHint flag. This has other severe problems though, like totally broken keyboard focus and very strange effects on desktop changes or when the user raises other windows.

X11 window managers that follow modern post-ICCCM specifications support full-screen mode properly.

On macOS, showing a window full screen puts the entire application in full-screen mode, providing it with a dedicated desktop. Showing another window while the application runs in full-screen mode might automatically make that window full screen as well. To prevent that, exit full-screen mode by calling showNormal() or by close() on the full screen window before showing another window.

See also showNormal(), showMaximized(), show(), isVisible(), and close().

Upstream PySide2 reference signatures (binding differences may apply):

showFullScreen(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#showFullScreen

showMaximized

showMaximized() -> None

X.showMaximized()

Supplemental documentation: Qt 5 reference:

[slot] void QWidget::showMaximized()

Shows the widget maximized.

Calling this function only affects windows.

On X11, this function may not work properly with certain window managers. See the Window Geometry documentation for an explanation.

See also setWindowState(), showNormal(), showMinimized(), show(), hide(), and isVisible().

Upstream PySide2 reference signatures (binding differences may apply):

showMaximized(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#showMaximized

showMinimized

showMinimized() -> None

X.showMinimized()

Supplemental documentation: Qt 5 reference:

[slot] void QWidget::showMinimized()

Shows the widget minimized, as an icon.

Calling this function only affects windows.

See also showNormal(), showMaximized(), show(), hide(), isVisible(), and isMinimized().

Upstream PySide2 reference signatures (binding differences may apply):

showMinimized(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#showMinimized

showNormal

showNormal() -> None

X.showNormal()

Supplemental documentation: Qt 5 reference:

[slot] void QWidget::showNormal()

Restores the widget after it has been maximized or minimized.

Calling this function only affects windows.

See also setWindowState(), showMinimized(), showMaximized(), show(), hide(), and isVisible().

Upstream PySide2 reference signatures (binding differences may apply):

showNormal(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#showNormal

size instance-attribute

size: QSize

Qt 5 reference:

size : QSize

This property holds the size of the widget excluding any window frame

If the widget is visible when it is being resized, it receives a resize event (resizeEvent()) immediately. If the widget is not currently visible, it is guaranteed to receive an event before it is shown.

The size is adjusted if it lies outside the range defined by minimumSize() and maximumSize().

By default, this property contains a value that depends on the user's platform and screen geometry.

Warning: Calling resize() or setGeometry() inside resizeEvent() can lead to infinite recursion.

Note: Setting the size to QSize(0, 0) will cause the widget to not appear on screen. This also applies to windows.

Access functions:

QSize size() const
void resize(int w, int h)
void resize(const QSize \&)

See also pos, geometry, minimumSize, maximumSize, resizeEvent(), and adjustSize().

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#size

sizeHint instance-attribute

sizeHint: QSize

Qt 5 reference:

sizeHint : const QSize

This property holds the recommended size for the widget

If the value of this property is an invalid size, no size is recommended.

The default implementation of sizeHint() returns an invalid size if there is no layout for this widget, and returns the layout's preferred size otherwise.

Access functions:

virtual QSize sizeHint() const

See also QSize::isValid(), minimumSizeHint(), sizePolicy(), setMinimumSize(), and updateGeometry().

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#sizeHint

sizeIncrement instance-attribute

sizeIncrement: QSize

Qt 5 reference:

sizeIncrement : QSize

This property holds the size increment of the widget

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. Preferred widget sizes are for non-negative integers i and j:

width = baseSize().width() + i * sizeIncrement().width();
height = baseSize().height() + j * sizeIncrement().height();

Note that while you can set the size increment for all widgets, it only affects windows.

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

Warning: The size increment has no effect under Windows, and may be disregarded by the window manager on X11.

Access functions:

QSize sizeIncrement() const
void setSizeIncrement(const QSize \&)
void setSizeIncrement(int w, int h)

See also size, minimumSize, and maximumSize.

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#sizeIncrement

sizePolicy instance-attribute

sizePolicy: QSizePolicy

Qt 5 reference:

sizePolicy : QSizePolicy

This property holds the default layout behavior of the widget

If there is a QLayout that manages this widget's children, the size policy specified by that layout is used. If there is no such QLayout, the result of this function is used.

The default policy is Preferred/Preferred, which means that the widget can be freely resized, but prefers to be the size sizeHint() returns. Button-like widgets set the size policy to specify that they may stretch horizontally, but are fixed vertically. The same applies to lineedit controls (such as QLineEdit, QSpinBox or an editable QComboBox) and other horizontally orientated widgets (such as QProgressBar). QToolButton's are normally square, so they allow growth in both directions. Widgets that support different directions (such as QSlider, QScrollBar or QHeader) specify stretching in the respective direction only. Widgets that can provide scroll bars (usually subclasses of QScrollArea) tend to specify that they can use additional space, and that they can make do with less than sizeHint().

Access functions:

QSizePolicy sizePolicy() const
void setSizePolicy(QSizePolicy)
void setSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)

See also sizeHint(), QLayout, QSizePolicy, and updateGeometry().

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#sizePolicy

stackUnder

stackUnder(arg__1: Any) -> None

X.stackUnder(arg__1)

Supplemental documentation: Qt 5 reference:

void QWidget::stackUnder(QWidget *w)

Places the widget under w in the parent widget's stack.

To make this work, the widget itself and w must be siblings.

See also raise() and lower().

Upstream PySide2 reference signatures (binding differences may apply):

stackUnder(self, arg__1: PySide2.QtWidgets.QWidget) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#stackUnder

statusTip instance-attribute

statusTip: str

Qt 5 reference:

statusTip : QString

This property holds the widget's status tip

By default, this property contains an empty string.

Access functions:

QString statusTip() const
void setStatusTip(const QString \&)

See also toolTip and whatsThis.

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#statusTip

style

style() -> Any

X.style() -> PythonQt.QtGui.QStyle

Supplemental documentation: Qt 5 reference:

QStyle *QWidget::style() const

See also QWidget::setStyle(), QApplication::setStyle(), and QApplication::style().

Upstream PySide2 reference signatures (binding differences may apply):

style(self) -> PySide2.QtWidgets.QStyle

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#style

styleSheet instance-attribute

styleSheet: str

Qt 5 reference:

styleSheet : QString

This property holds the widget's style sheet

The style sheet contains a textual description of customizations to the widget's style, as described in the Qt Style Sheets document.

Since Qt 4.5, Qt style sheets fully supports macOS.

Warning: Qt style sheets are currently not supported for custom QStyle subclasses. We plan to address this in some future release.

This property was introduced in Qt 4.2.

Access functions:

QString styleSheet() const
void setStyleSheet(const QString \&styleSheet)

See also setStyle(), QApplication::styleSheet, and Qt Style Sheets.

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#styleSheet

tabletEvent

tabletEvent(event: Any) -> None

X.tabletEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QWidget::tabletEvent(QTabletEvent *event)

This event handler, for event event, can be reimplemented in a subclass to receive tablet events for the widget.

If you reimplement this handler, it is very important that you ignore() the event if you do not handle it, so that the widget's parent can interpret it.

The default implementation ignores the event.

If tablet tracking is switched off, tablet move events only occur if the stylus is in contact with the tablet, or at least one stylus button is pressed, while the stylus is being moved. If tablet tracking is switched on, tablet move events occur even while the stylus is hovering in proximity of the tablet, with no buttons pressed.

See also QEvent::ignore(), QEvent::accept(), event(), setTabletTracking(), and QTabletEvent.

Upstream PySide2 reference signatures (binding differences may apply):

tabletEvent(self, event: PySide2.QtGui.QTabletEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#tabletEvent

tabletTracking instance-attribute

tabletTracking: Any

Qt 5 reference:

tabletTracking : bool

This property holds whether tablet tracking is enabled for the widget

If tablet tracking is disabled (the default), the widget only receives tablet move events when the stylus is in contact with the tablet, or at least one stylus button is pressed, while the stylus is being moved.

If tablet tracking is enabled, the widget receives tablet move events even while hovering in proximity. This is useful for monitoring position as well as the auxiliary properties such as rotation and tilt, and providing feedback in the UI.

This property was introduced in Qt 5.9.

Access functions:

bool hasTabletTracking() const
void setTabletTracking(bool enable)

See also tabletEvent().

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#tabletTracking

testAttribute

testAttribute(arg__1: Any) -> bool

X.testAttribute(arg__1) -> bool

Supplemental documentation: Qt 5 reference:

bool QWidget::testAttribute(Qt::WidgetAttribute attribute) const

Returns true if attribute attribute is set on this widget; otherwise returns false.

See also setAttribute().

Upstream PySide2 reference signatures (binding differences may apply):

testAttribute(self, arg__1: PySide2.QtCore.Qt.WidgetAttribute) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#testAttribute

toolTip instance-attribute

toolTip: str

Qt 5 reference:

toolTip : QString

This property holds the widget's tooltip

Note that by default tooltips are only shown for widgets that are children of the active window. You can change this behavior by setting the attribute Qt::WA_AlwaysShowToolTips on the window, not on the widget with the tooltip.

If you want to control a tooltip's behavior, you can intercept the event() function and catch the QEvent::ToolTip event (e.g., if you want to customize the area for which the tooltip should be shown).

By default, this property contains an empty string.

Access functions:

QString toolTip() const
void setToolTip(const QString \&)

See also QToolTip, statusTip, and whatsThis.

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#toolTip

toolTipDuration instance-attribute

toolTipDuration: int

Qt 5 reference:

toolTipDuration : int

This property holds the widget's tooltip duration

Specifies how long time the tooltip will be displayed, in milliseconds. If the value is -1 (default) the duration is calculated depending on the length of the tooltip.

This property was introduced in Qt 5.2.

Access functions:

int toolTipDuration() const
void setToolTipDuration(int msec)

See also toolTip.

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#toolTipDuration

underMouse

underMouse() -> bool

X.underMouse() -> bool

Supplemental documentation: Qt 5 reference:

bool QWidget::underMouse() const

Returns true if the widget is under the mouse cursor; otherwise returns false.

This value is not updated properly during drag and drop operations.

See also enterEvent() and leaveEvent().

Upstream PySide2 reference signatures (binding differences may apply):

underMouse(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#underMouse

ungrabGesture

ungrabGesture(type: Any) -> None

X.ungrabGesture(type)

Supplemental documentation: Qt 5 reference:

void QWidget::ungrabGesture(Qt::GestureType gesture)

Unsubscribes the widget from a given gesture type

This function was introduced in Qt 4.6.

See also grabGesture() and QGestureEvent.

Upstream PySide2 reference signatures (binding differences may apply):

ungrabGesture(self, type: PySide2.QtCore.Qt.GestureType) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#ungrabGesture

unsetCursor

unsetCursor() -> None

X.unsetCursor()

Upstream PySide2 reference signatures (binding differences may apply):

unsetCursor(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#unsetCursor

unsetLayoutDirection

unsetLayoutDirection() -> None

X.unsetLayoutDirection()

Upstream PySide2 reference signatures (binding differences may apply):

unsetLayoutDirection(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#unsetLayoutDirection

unsetLocale

unsetLocale() -> None

X.unsetLocale()

Upstream PySide2 reference signatures (binding differences may apply):

unsetLocale(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qwidget.html#unsetLocale