QtBase  v6.3.1
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
QGraphicsBlurEffect Class Reference

The QGraphicsBlurEffect class provides a blur effect. More...

#include <qgraphicseffect.h>

Inheritance diagram for QGraphicsBlurEffect:
Inheritance graph
[legend]
Collaboration diagram for QGraphicsBlurEffect:
Collaboration graph
[legend]

Public Types

enum  BlurHint { PerformanceHint = 0x00 , QualityHint = 0x01 , AnimationHint = 0x02 }
 
- Public Types inherited from QGraphicsEffect
enum  ChangeFlag { SourceAttached = 0x1 , SourceDetached = 0x2 , SourceBoundingRectChanged = 0x4 , SourceInvalidated = 0x8 }
 
enum  PixmapPadMode { NoPad , PadToTransparentBorder , PadToEffectiveBoundingRect }
 

Public Slots

void setBlurRadius (qreal blurRadius)
 
void setBlurHints (BlurHints hints)
 
- Public Slots inherited from QGraphicsEffect
void setEnabled (bool enable)
 
void update ()
 
- Public Slots inherited from QObject
void deleteLater ()
 

Signals

void blurRadiusChanged (qreal blurRadius)
 
void blurHintsChanged (BlurHints hints)
 
- Signals inherited from QGraphicsEffect
void enabledChanged (bool enabled)
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 

Public Member Functions

 QGraphicsBlurEffect (QObject *parent=nullptr)
 
 ~QGraphicsBlurEffect ()
 
QRectF boundingRectFor (const QRectF &rect) const override
 
qreal blurRadius () const
 
BlurHints blurHints () const
 
- Public Member Functions inherited from QGraphicsEffect
 QGraphicsEffect (QObject *parent=nullptr)
 
virtual ~QGraphicsEffect ()
 
QRectF boundingRect () const
 
bool isEnabled () const
 
QGraphicsEffectSourcesource () const
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 
virtual ~QObject ()
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const
 
void setObjectName (const QString &name)
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const noexcept
 
bool blockSignals (bool b) noexcept
 
QThreadthread () const
 
void moveToThread (QThread *thread)
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 
template<typename T >
T findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
const QObjectListchildren () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 
void dumpObjectInfo () const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 
bool inherits (const char *classname) const
 

Protected Member Functions

void draw (QPainter *painter) override
 
- Protected Member Functions inherited from QGraphicsEffect
 QGraphicsEffect (QGraphicsEffectPrivate &d, QObject *parent=nullptr)
 
virtual void sourceChanged (ChangeFlags flags)
 
void updateBoundingRect ()
 
bool sourceIsPixmap () const
 
QRectF sourceBoundingRect (Qt::CoordinateSystem system=Qt::LogicalCoordinates) const
 
void drawSource (QPainter *painter)
 
QPixmap sourcePixmap (Qt::CoordinateSystem system=Qt::LogicalCoordinates, QPoint *offset=nullptr, PixmapPadMode mode=PadToEffectiveBoundingRect) const
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 

Properties

qreal blurRadius
 the blur radius of the effect. More...
 
BlurHints blurHints
 the blur hint of the effect. More...
 
- Properties inherited from QGraphicsEffect
bool enabled
 whether the effect is enabled or not. More...
 
- Properties inherited from QObject
QString objectName
 the name of this object More...
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 

Detailed Description

The QGraphicsBlurEffect class provides a blur effect.

Since
4.6 \inmodule QtWidgets

A blur effect blurs the source. This effect is useful for reducing details, such as when the source loses focus and you want to draw attention to other elements. The level of detail can be modified using the setBlurRadius() function. Use setBlurHints() to choose the blur hints.

By default, the blur radius is 5 pixels. The blur radius is specified in device coordinates.

See also
QGraphicsDropShadowEffect, QGraphicsColorizeEffect, QGraphicsOpacityEffect

Definition at line 155 of file qgraphicseffect.h.

Member Enumeration Documentation

◆ BlurHint

Since
4.6

This enum describes the possible hints that can be used to control how blur effects are applied. The hints might not have an effect in all the paint engines.

\value PerformanceHint Indicates that rendering performance is the most important factor, at the potential cost of lower quality.

\value QualityHint Indicates that rendering quality is the most important factor, at the potential cost of lower performance.

\value AnimationHint Indicates that the blur radius is going to be animated, hinting that the implementation can keep a cache of blurred versions of the source. Do not use this hint if the source is going to be dynamically changing.

See also
blurHints(), setBlurHints()
Enumerator
PerformanceHint 
QualityHint 
AnimationHint 

Definition at line 161 of file qgraphicseffect.h.

Constructor & Destructor Documentation

◆ QGraphicsBlurEffect()

QGraphicsBlurEffect::QGraphicsBlurEffect ( QObject parent = nullptr)

Constructs a new QGraphicsBlurEffect instance. The parent parameter is passed to QGraphicsEffect's constructor.

Definition at line 764 of file qgraphicseffect.cpp.

◆ ~QGraphicsBlurEffect()

QGraphicsBlurEffect::~QGraphicsBlurEffect ( )

Destroys the effect.

Definition at line 774 of file qgraphicseffect.cpp.

Member Function Documentation

◆ blurHints()

QGraphicsBlurEffect::BlurHints QGraphicsBlurEffect::blurHints ( ) const

Definition at line 824 of file qgraphicseffect.cpp.

◆ blurHintsChanged

void QGraphicsBlurEffect::blurHintsChanged ( BlurHints  hints)
signal

This signal is emitted whenever the effect's blur hints changes. The hints parameter holds the effect's new blur hints.

Here is the caller graph for this function:

◆ blurRadius()

qreal QGraphicsBlurEffect::blurRadius ( ) const

Definition at line 790 of file qgraphicseffect.cpp.

◆ blurRadiusChanged

void QGraphicsBlurEffect::blurRadiusChanged ( qreal  radius)
signal

This signal is emitted whenever the effect's blur radius changes. The radius parameter holds the effect's new blur radius.

Here is the caller graph for this function:

◆ boundingRectFor()

QRectF QGraphicsBlurEffect::boundingRectFor ( const QRectF rect) const
overridevirtual

\reimp

Reimplemented from QGraphicsEffect.

Definition at line 850 of file qgraphicseffect.cpp.

◆ draw()

void QGraphicsBlurEffect::draw ( QPainter painter)
overrideprotectedvirtual

\reimp

Implements QGraphicsEffect.

Definition at line 859 of file qgraphicseffect.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBlurHints

void QGraphicsBlurEffect::setBlurHints ( BlurHints  hints)
slot

Definition at line 830 of file qgraphicseffect.cpp.

◆ setBlurRadius

void QGraphicsBlurEffect::setBlurRadius ( qreal  blurRadius)
slot

Definition at line 796 of file qgraphicseffect.cpp.

Here is the call graph for this function:

Property Documentation

◆ blurHints

QGraphicsBlurEffect::blurHints
readwrite

the blur hint of the effect.

Use the PerformanceHint hint to say that you want a faster blur, the QualityHint hint to say that you prefer a higher quality blur, or the AnimationHint when you want to animate the blur radius.

By default, the blur hint is PerformanceHint.

Definition at line 147 of file qgraphicseffect.h.

◆ blurRadius

QGraphicsBlurEffect::blurRadius
readwrite

the blur radius of the effect.

Using a smaller radius results in a sharper appearance, whereas a bigger radius results in a more blurred appearance.

By default, the blur radius is 5 pixels.

The radius is given in device coordinates, meaning it is unaffected by scale.

Definition at line 147 of file qgraphicseffect.h.


The documentation for this class was generated from the following files: