Skip to content

PythonQt.Qt.QGraphicsEffect

QGraphicsEffect

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

Effects alter the appearance of elements by hooking into the rendering pipeline and operating between the source (e.g., a QGraphicsPixmapItem) and the destination device (e.g., QGraphicsView's viewport). Effects can be disabled by calling setEnabled(false). If effects are disabled, the source is rendered directly.

To add a visual effect to a QGraphicsItem, for example, you can use one of the standard effects, or alternately, create your own effect by creating a subclass of QGraphicsEffect. The effect can then be installed on the item using QGraphicsItem::setGraphicsEffect().

Qt provides the following standard effects:

For more information on how to use each effect, refer to the specific effect's documentation.

To create your own custom effect, create a subclass of QGraphicsEffect (or any other existing effects) and reimplement the virtual function draw(). This function is called whenever the effect needs to redraw. The draw() function takes the painter with which to draw as an argument. For more information, refer to the documentation for draw(). In the draw() function you can call sourcePixmap() to get a pixmap of the graphics effect source which you can then process.

If your effect changes, use update() to request for a redraw. If your custom effect changes the bounding rectangle of the source, e.g., a radial glow effect may need to apply an extra margin, you can reimplement the virtual boundingRectFor() function, and call updateBoundingRect() to notify the framework whenever this rectangle changes. The virtual sourceChanged() function is called to notify the effects that the source has changed in some way - e.g., if the source is a QGraphicsRectItem and its rectangle parameters have changed.

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

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
ChangeFlag attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
ChangeFlags attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
NoPad attribute Any (shared captured text)
PadToEffectiveBoundingRect attribute Any (shared captured text)
PadToTransparentBorder attribute Any (shared captured text)
PixmapPadMode attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
SourceAttached attribute Any (shared captured text)
SourceBoundingRectChanged attribute Any (shared captured text)
SourceDetached attribute Any (shared captured text)
SourceInvalidated attribute Any (shared captured text)
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
blockSignals function (self, b: Any) -> bool X.blockSignals(b) -> bool (shared captured text)
boundingRect function (self) -> Any X.boundingRect() -> PythonQt.QtCore.QRectF (shared captured text)
boundingRectFor function (self, sourceRect: Any) -> Any X.boundingRectFor(sourceRect) -> PythonQt.QtCore.QRectF (shared captured text)
childEvent function (self, event: Any) -> Any (shared captured text)
children function (self) -> tuple X.children() -> tuple (shared captured text)
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
connect function (self, signal: Any, receiver: Any, slot: Any, type: Any) -> bool X.connect(signal, receiver, slot, type) -> bool (shared captured text)
customEvent function (self, event: Any) -> Any (shared captured text)
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
deleteLater function (self) -> Any (shared captured text)
destroyed function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.Qt.QGraphicsEffect.destroyed; argument details are not documented.
disconnect function (self, signal: Any, receiver: Any, slot: Any) -> bool X.disconnect(signal, receiver, slot) -> bool (shared captured text)
draw function (self, painter: Any) -> None This pure virtual function draws the effect and is called whenever the source needs to be drawn. (shared captured text)
drawSource function (self, painter: Any) -> None Draws the source directly using the given painter. (shared captured text)
dumpObjectInfo function (self) -> Any (shared captured text)
dumpObjectTree function (self) -> Any (shared captured text)
dynamicPropertyNames function (self) -> Any (shared captured text)
enabled attribute Any This property holds whether the effect is enabled or not. (shared captured text)
enabledChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.Qt.QGraphicsEffect.enabledChanged; argument details are not documented.
event function (self, event: Any) -> bool X.event(event) -> bool (shared captured text)
eventFilter function (self, watched: Any, event: Any) -> bool X.eventFilter(watched, event) -> bool (shared captured text)
findChild function (self, type: Any, name: Any) -> Any X.findChild(type, name) -> PythonQt.private.QObject (shared captured text)
findChildren function (self, type: Any, name: Any) -> tuple X.findChildren(type, name) -> tuple (shared captured text)
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
installEventFilter function (self, filterObj: Any) -> Any (shared captured text)
isEnabled function (self) -> bool X.isEnabled() -> bool (shared captured text)
isSignalConnected function (self, signal: Any) -> bool X.isSignalConnected(signal) -> bool (shared captured text)
isWidgetType function (self) -> bool X.isWidgetType() -> bool (shared captured text)
isWindowType function (self) -> bool X.isWindowType() -> bool (shared captured text)
killTimer function (self, id: Any) -> Any (shared captured text)
metaObject function (self) -> Any X.metaObject() -> PythonQt.QtCore.QMetaObject (shared captured text)
moveToThread function (self, thread: Any) -> Any (shared captured text)
objectName attribute Any (shared captured text)
objectNameChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.Qt.QGraphicsEffect.objectNameChanged; argument details are not documented.
parent function (self) -> Any X.parent() -> PythonQt.private.QObject (shared captured text)
property function (self, name: Any) -> Any X.property(name) -> object (shared captured text)
removeEventFilter function (self, obj: Any) -> Any (shared captured text)
sender function (self) -> Any X.sender() -> PythonQt.private.QObject (shared captured text)
senderSignalIndex function (self) -> int X.senderSignalIndex() -> int (shared captured text)
setEnabled function (self, enable: bool) -> None (shared captured text)
setObjectName function (self, name: Any) -> Any (shared captured text)
setParent function (self, parent: Any) -> Any (shared captured text)
setProperty function (self, name: Any, value: Any) -> bool X.setProperty(name, value) -> bool (shared captured text)
signalsBlocked function (self) -> bool X.signalsBlocked() -> bool (shared captured text)
sourceBoundingRect function (self, system: Any) -> Any X.sourceBoundingRect(system) -> PythonQt.QtCore.QRectF (shared captured text)
sourceChanged function (self, arg0: flags) -> None This virtual function is called by [QGraphicsEffect](https://doc.qt.io/archives/qt-5.15/qgraphicseffect.html) to notify the effect that the source has changed. (shared captured text)
sourceIsPixmap function (self) -> bool X.sourceIsPixmap() -> bool (shared captured text)
sourcePixmap function (self, system: Any, offset: Any, mode: Any) -> Any X.sourcePixmap(system, offset, mode) -> PythonQt.QtGui.QPixmap (shared captured text)
startTimer function (self, interval: Any, timerType: Any) -> int X.startTimer(interval, timerType) -> int (shared captured text)
thread function (self) -> Any (shared captured text)
timerEvent function (self, event: Any) -> Any (shared captured text)
tr function (self, text: Any, ambig: Any, n: Any) -> str X.tr(text, ambig, n) -> str (shared captured text)
update function (self) -> None Schedules a redraw of the effect. (shared captured text)
updateBoundingRect function (self) -> None This function notifies the effect framework when the effect's bounding rectangle has changed. (shared captured text)