diff options
Diffstat (limited to 'src/gui/effects/qgraphicseffect_p.h')
-rw-r--r-- | src/gui/effects/qgraphicseffect_p.h | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h index 9a46a24..0011eef 100644 --- a/src/gui/effects/qgraphicseffect_p.h +++ b/src/gui/effects/qgraphicseffect_p.h @@ -63,6 +63,41 @@ #ifndef QT_NO_GRAPHICSEFFECT QT_BEGIN_NAMESPACE +class QGraphicsEffectSourcePrivate; +class Q_GUI_EXPORT QGraphicsEffectSource : public QObject +{ + Q_OBJECT +public: + ~QGraphicsEffectSource(); + const QGraphicsItem *graphicsItem() const; + const QWidget *widget() const; + const QStyleOption *styleOption() const; + + bool isPixmap() const; + void draw(QPainter *painter); + void update(); + + QRectF boundingRect(Qt::CoordinateSystem coordinateSystem = Qt::LogicalCoordinates) const; + QRect deviceRect() const; + QPixmap pixmap(Qt::CoordinateSystem system = Qt::LogicalCoordinates, + QPoint *offset = 0, + QGraphicsEffect::PixmapPadMode mode = QGraphicsEffect::PadToEffectiveBoundingRect) const; + +protected: + QGraphicsEffectSource(QGraphicsEffectSourcePrivate &dd, QObject *parent = 0); + +private: + Q_DECLARE_PRIVATE(QGraphicsEffectSource) + Q_DISABLE_COPY(QGraphicsEffectSource) + friend class QGraphicsEffect; + friend class QGraphicsEffectPrivate; + friend class QGraphicsScenePrivate; + friend class QGraphicsItem; + friend class QGraphicsItemPrivate; + friend class QWidget; + friend class QWidgetPrivate; +}; + class QGraphicsEffectSourcePrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QGraphicsEffectSource) @@ -70,10 +105,10 @@ public: QGraphicsEffectSourcePrivate() : QObjectPrivate() , m_cachedSystem(Qt::DeviceCoordinates) - , m_cachedMode(QGraphicsEffectSource::ExpandToTransparentBorderPadMode) + , m_cachedMode(QGraphicsEffect::PadToTransparentBorder) {} - virtual ~QGraphicsEffectSourcePrivate() { invalidateCache(); } + virtual ~QGraphicsEffectSourcePrivate(); virtual void detach() = 0; virtual QRectF boundingRect(Qt::CoordinateSystem system) const = 0; virtual QRect deviceRect() const = 0; @@ -84,7 +119,7 @@ public: virtual void update() = 0; virtual bool isPixmap() const = 0; virtual QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset = 0, - QGraphicsEffectSource::PixmapPadMode mode = QGraphicsEffectSource::ExpandToTransparentBorderPadMode) const = 0; + QGraphicsEffect::PixmapPadMode mode = QGraphicsEffect::PadToTransparentBorder) const = 0; virtual void effectBoundingRectChanged() = 0; void invalidateCache(bool effectRectChanged = false) const; @@ -94,7 +129,7 @@ public: private: mutable Qt::CoordinateSystem m_cachedSystem; - mutable QGraphicsEffectSource::PixmapPadMode m_cachedMode; + mutable QGraphicsEffect::PixmapPadMode m_cachedMode; mutable QPoint m_cachedOffset; mutable QPixmapCache::Key m_cacheKey; }; |