Skip to content

PythonQt.QtGui.QGraphicsEffect · declarations 001

Back to PythonQt.QtGui.QGraphicsEffect

boundingRect

boundingRect() -> Any

X.boundingRect() -> PythonQt.QtCore.QRectF

Supplemental documentation: Qt 5 reference:

QRectF QGraphicsEffect::boundingRect() const

Returns the effective bounding rectangle for this effect, i.e., the bounding rectangle of the source in device coordinates, adjusted by any margins applied by the effect itself.

See also boundingRectFor() and updateBoundingRect().

Upstream PySide2 reference signatures (binding differences may apply):

boundingRect(self) -> PySide2.QtCore.QRectF

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#boundingRect

boundingRectFor

boundingRectFor(sourceRect: Any) -> Any

X.boundingRectFor(sourceRect) -> PythonQt.QtCore.QRectF

Supplemental documentation: Qt 5 reference:

[virtual] QRectF QGraphicsEffect::boundingRectFor(const QRectF \&rect) const

Returns the effective bounding rectangle for this effect, given the provided rect in the device coordinates. When writing you own custom effect, you must call updateBoundingRect() whenever any parameters are changed that may cause this this function to return a different value.

See also sourceBoundingRect().

Upstream PySide2 reference signatures (binding differences may apply):

boundingRectFor(self, sourceRect: PySide2.QtCore.QRectF) -> PySide2.QtCore.QRectF

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#boundingRectFor

destroyed

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

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

draw

draw(painter: Any) -> None

X.draw(painter)

Supplemental documentation: Qt 5 reference:

[pure virtual protected] void QGraphicsEffect::draw(QPainter *painter)

This pure virtual function draws the effect and is called whenever the source needs to be drawn.

Reimplement this function in a QGraphicsEffect subclass to provide the effect's drawing implementation, using painter.

For example:

MyGraphicsEffect::draw(QPainter *painter)
{
    ...
    QPoint offset;
    if (sourceIsPixmap()) {
        // No point in drawing in device coordinates (pixmap will be scaled anyways).
        const QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset);
        ...
        painter->drawPixmap(offset, pixmap);
    } else {
        // Draw pixmap in device coordinates to avoid pixmap scaling;
        const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset);
        painter->setWorldTransform(QTransform());
        ...
        painter->drawPixmap(offset, pixmap);
    }
    ...
}

This function should not be called explicitly by the user, since it is meant for reimplementation purposes only.

Upstream PySide2 reference signatures (binding differences may apply):

draw(self, painter: PySide2.QtGui.QPainter) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#draw

drawSource

drawSource(painter: Any) -> None

X.drawSource(painter)

Supplemental documentation: Qt 5 reference:

[protected] void QGraphicsEffect::drawSource(QPainter *painter)

Draws the source directly using the given painter.

This function should only be called from QGraphicsEffect::draw().

For example:

MyGraphicsOpacityEffect::draw(QPainter *painter)
{
    // Fully opaque; draw directly without going through a pixmap.
    if (qFuzzyCompare(m_opacity, 1)) {
        drawSource(painter);
        return;
    }
    ...
}

See also QGraphicsEffect::draw().

Upstream PySide2 reference signatures (binding differences may apply):

drawSource(self, painter: PySide2.QtGui.QPainter) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#drawSource

enabled instance-attribute

enabled: Any

Qt 5 reference:

enabled : bool

This property holds whether the effect is enabled or not.

If an effect is disabled, the source will be rendered with as normal, with no interference from the effect. If the effect is enabled, the source will be rendered with the effect applied.

This property is enabled by default.

Using this property, you can disable certain effects on slow platforms, in order to ensure that the user interface is responsive.

Access functions:

bool isEnabled() const
void setEnabled(bool enable)

Notifier signal:

void enabledChanged(bool enabled)

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#enabled

enabledChanged

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

Native PythonQt.QtGui.QGraphicsEffect.enabledChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QGraphicsEffect::enabledChanged(bool enabled)

This signal is emitted whenever the effect is enabled or disabled. The enabled parameter holds the effects's new enabled state.

Note: Notifier signal for property enabled.

See also isEnabled().

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#enabledChanged

isEnabled

isEnabled() -> bool

X.isEnabled() -> bool

Upstream PySide2 reference signatures (binding differences may apply):

isEnabled(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#isEnabled

objectNameChanged

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

Native PythonQt.QtGui.QGraphicsEffect.objectNameChanged; argument details are not documented.

setEnabled

setEnabled(enable: bool) -> None

X.setEnabled(enable)

Upstream PySide2 reference signatures (binding differences may apply):

setEnabled(self, enable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#setEnabled

sourceBoundingRect

sourceBoundingRect(system: Any) -> Any

X.sourceBoundingRect(system) -> PythonQt.QtCore.QRectF

Supplemental documentation: Qt 5 reference:

[protected] QRectF QGraphicsEffect::sourceBoundingRect(Qt::CoordinateSystem system \= Qt::LogicalCoordinates) const

Returns the bounding rectangle of the source mapped to the given system.

Calling this function with Qt::DeviceCoordinates outside of QGraphicsEffect::draw() will give undefined results, as there is no device context available.

See also draw().

Upstream PySide2 reference signatures (binding differences may apply):

sourceBoundingRect(self, system: PySide2.QtCore.Qt.CoordinateSystem=...) -> PySide2.QtCore.QRectF

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#sourceBoundingRect

sourceChanged

sourceChanged(arg0: flags) -> None

X.sourceChanged(flags)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsEffect::sourceChanged(QGraphicsEffect::ChangeFlags flags)

This virtual function is called by QGraphicsEffect to notify the effect that the source has changed. If the effect applies any cache, then this cache must be purged in order to reflect the new appearance of the source.

The flags describes what has changed.

Upstream PySide2 reference signatures (binding differences may apply):

sourceChanged(self, flags: PySide2.QtWidgets.QGraphicsEffect.ChangeFlags) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#sourceChanged

sourceIsPixmap

sourceIsPixmap() -> bool

X.sourceIsPixmap() -> bool

Supplemental documentation: Qt 5 reference:

[protected] bool QGraphicsEffect::sourceIsPixmap() const

Returns true if the source effectively is a pixmap, e.g., a QGraphicsPixmapItem.

This function is useful for optimization purposes. For instance, there's no point in drawing the source in device coordinates to avoid pixmap scaling if this function returns true - the source pixmap will be scaled anyways.

Upstream PySide2 reference signatures (binding differences may apply):

sourceIsPixmap(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#sourceIsPixmap

sourcePixmap

sourcePixmap(system: Any, offset: Any, mode: Any) -> Any

X.sourcePixmap(system, offset, mode) -> PythonQt.QtGui.QPixmap

Supplemental documentation: Qt 5 reference:

[protected] QPixmap QGraphicsEffect::sourcePixmap(Qt::CoordinateSystem system \= Qt::LogicalCoordinates, QPoint *offset \= nullptr, QGraphicsEffect::PixmapPadMode mode \= PadToEffectiveBoundingRect) const

Returns a pixmap with the source painted into it.

The system specifies which coordinate system to be used for the source. The optional offset parameter returns the offset where the pixmap should be painted at using the current painter. For control on how the pixmap is padded use the mode parameter.

The returned pixmap is clipped to the current painter's device rectangle when system is Qt::DeviceCoordinates.

Calling this function with Qt::DeviceCoordinates outside of QGraphicsEffect::draw() will give undefined results, as there is no device context available.

See also draw() and boundingRect().

Upstream PySide2 reference signatures (binding differences may apply):

sourcePixmap(self, system: PySide2.QtCore.Qt.CoordinateSystem=..., offset: typing.Optional[PySide2.QtCore.QPoint]=..., mode: PySide2.QtWidgets.QGraphicsEffect.PixmapPadMode=...) -> PySide2.QtGui.QPixmap

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#sourcePixmap

update

update() -> None

X.update()

Supplemental documentation: Qt 5 reference:

[slot] void QGraphicsEffect::update()

Schedules a redraw of the effect. Call this function whenever the effect needs to be redrawn. This function does not trigger a redraw of the source.

See also updateBoundingRect().

Upstream PySide2 reference signatures (binding differences may apply):

update(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#update

updateBoundingRect

updateBoundingRect() -> None

X.updateBoundingRect()

Supplemental documentation: Qt 5 reference:

[protected] void QGraphicsEffect::updateBoundingRect()

This function notifies the effect framework when the effect's bounding rectangle has changed. As a custom effect author, you must call this function whenever you change any parameters that will cause the virtual boundingRectFor() function to return a different value.

This function will call update() if this is necessary.

See also boundingRectFor(), boundingRect(), and sourceBoundingRect().

Upstream PySide2 reference signatures (binding differences may apply):

updateBoundingRect(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html#updateBoundingRect