Skip to content

PythonQt.QtGui.QCursor · declarations 001

Back to PythonQt.QtGui.QCursor

bitmap

bitmap() -> Any

X.bitmap() -> PythonQt.QtGui.QBitmap

Supplemental documentation: Qt 5 reference:

QBitmap QCursor::bitmap(Qt::ReturnByValueConstant) const

Returns the cursor bitmap, or a null bitmap if it is one of the standard cursors.

Previously, Qt provided a version of bitmap() which returned the bitmap by-pointer. That version is now deprecated. To maintain compatibility with old code, you can explicitly differentiate between the by-pointer function and the by-value function:

const QBitmap *bmpPtr = cursor->bitmap();
QBitmap bmpVal = cursor->bitmap(Qt::ReturnByValue);

If you disable the deprecated version using the QT_DISABLE_DEPRECATED_BEFORE macro, then you can omit Qt::ReturnByValue as shown below:

QBitmap bmpVal = cursor->bitmap();

This function was introduced in Qt 5.15.

Upstream PySide2 reference signatures (binding differences may apply):

bitmap(self) -> PySide2.QtGui.QBitmap

Source: https://doc.qt.io/archives/qt-5.15/qcursor.html#bitmap

hotSpot

hotSpot() -> Any

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

Supplemental documentation: Qt 5 reference:

QPoint QCursor::hotSpot() const

Returns the cursor hot spot, or (0, 0) if it is one of the standard cursors.

Upstream PySide2 reference signatures (binding differences may apply):

hotSpot(self) -> PySide2.QtCore.QPoint

Source: https://doc.qt.io/archives/qt-5.15/qcursor.html#hotSpot

mask

mask() -> Any

X.mask() -> PythonQt.QtGui.QBitmap

Supplemental documentation: Qt 5 reference:

QBitmap QCursor::mask(Qt::ReturnByValueConstant) const

Returns the cursor bitmap mask, or a null bitmap if it is one of the standard cursors.

Previously, Qt provided a version of mask() which returned the bitmap by-pointer. That version is now deprecated. To maintain compatibility with old code, you can explicitly differentiate between the by-pointer function and the by-value function:

const QBitmap *bmpPtr = cursor->mask();
QBitmap bmpVal = cursor->mask(Qt::ReturnByValue);

If you disable the deprecated version using the QT_DISABLE_DEPRECATED_BEFORE macro, then you can omit Qt::ReturnByValue as shown below:

QBitmap bmpVal = cursor->mask();

This function was introduced in Qt 5.15.

Upstream PySide2 reference signatures (binding differences may apply):

mask(self) -> PySide2.QtGui.QBitmap

Source: https://doc.qt.io/archives/qt-5.15/qcursor.html#mask

pixmap

pixmap() -> Any

X.pixmap() -> PythonQt.QtGui.QPixmap

Supplemental documentation: Qt 5 reference:

QPixmap QCursor::pixmap() const

Returns the cursor pixmap. This is only valid if the cursor is a pixmap cursor.

Upstream PySide2 reference signatures (binding differences may apply):

pixmap(self) -> PySide2.QtGui.QPixmap

Source: https://doc.qt.io/archives/qt-5.15/qcursor.html#pixmap

pos

pos(screen: Any) -> Any

X.pos(screen) -> PythonQt.QtCore.QPoint

Supplemental documentation: Qt 5 reference:

[static] QPoint QCursor::pos()

Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.

You can call QWidget::mapFromGlobal() to translate it to widget coordinates.

Note: The position is queried from the windowing system. If mouse events are generated via other means (e.g., via QWindowSystemInterface in a unit test), those fake mouse moves will not be reflected in the returned value.

Note: On platforms where there is no windowing system or cursors are not available, the returned position is based on the mouse move events generated via QWindowSystemInterface.

See also setPos(), QWidget::mapFromGlobal(), QWidget::mapToGlobal(), and QGuiApplication::primaryScreen().

[static] QPoint QCursor::pos(const QScreen *screen)

Returns the position of the cursor (hot spot) of the screen in global screen coordinates.

You can call QWidget::mapFromGlobal() to translate it to widget coordinates.

See also setPos(), QWidget::mapFromGlobal(), and QWidget::mapToGlobal().

Upstream PySide2 reference signatures (binding differences may apply):

pos() -> PySide2.QtCore.QPoint
pos(screen: PySide2.QtGui.QScreen) -> PySide2.QtCore.QPoint

Source: https://doc.qt.io/archives/qt-5.15/qcursor.html#pos

readFrom

readFrom(inS: Any) -> Any

X.readFrom(inS)

setPos

setPos(screen: Any, x: Any, y: Any) -> None

X.setPos(screen, x, y)

Supplemental documentation: Qt 5 reference:

[static] void QCursor::setPos(int x, int y)

Moves the cursor (hot spot) of the primary screen to the global screen position (x, y).

You can call QWidget::mapToGlobal() to translate widget coordinates to global screen coordinates.

See also pos(), QWidget::mapFromGlobal(), QWidget::mapToGlobal(), and QGuiApplication::primaryScreen().

[static] void QCursor::setPos(QScreen *screen, int x, int y)

Moves the cursor (hot spot) of the screen to the global screen position (x, y).

You can call QWidget::mapToGlobal() to translate widget coordinates to global screen coordinates.

Note: Calling this function results in changing the cursor position through the windowing system. The windowing system will typically respond by sending mouse events to the application's window. This means that the usage of this function should be avoided in unit tests and everywhere where fake mouse events are being injected via QWindowSystemInterface because the windowing system's mouse state (with regards to buttons for example) may not match the state in the application-generated events.

Note: On platforms where there is no windowing system or cursors are not available, this function may do nothing.

See also pos(), QWidget::mapFromGlobal(), and QWidget::mapToGlobal().

[static] void QCursor::setPos(const QPoint \&p)

This is an overloaded function.

Moves the cursor (hot spot) to the global screen position at point p.

[static] void QCursor::setPos(QScreen *screen, const QPoint \&p)

This is an overloaded function.

Moves the cursor (hot spot) to the global screen position of the screen at point p.

Upstream PySide2 reference signatures (binding differences may apply):

setPos(p: PySide2.QtCore.QPoint) -> None
setPos(screen: PySide2.QtGui.QScreen, p: PySide2.QtCore.QPoint) -> None
setPos(screen: PySide2.QtGui.QScreen, x: int, y: int) -> None
setPos(x: int, y: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcursor.html#setPos

setShape

setShape(newShape: Any) -> None

X.setShape(newShape)

Supplemental documentation: Qt 5 reference:

void QCursor::setShape(Qt::CursorShape shape)

Sets the cursor to the shape identified by shape.

See Qt::CursorShape for the list of cursor shapes.

See also shape().

Upstream PySide2 reference signatures (binding differences may apply):

setShape(self, newShape: PySide2.QtCore.Qt.CursorShape) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcursor.html#setShape

shape

shape() -> Any

X.shape()

Supplemental documentation: Qt 5 reference:

Qt::CursorShape QCursor::shape() const

Returns the cursor shape identifier.

See also setShape().

Upstream PySide2 reference signatures (binding differences may apply):

shape(self) -> PySide2.QtCore.Qt.CursorShape

Source: https://doc.qt.io/archives/qt-5.15/qcursor.html#shape

writeTo

writeTo(outS: Any) -> Any

X.writeTo(outS)