Qt 4.8
Public Functions | Public Variables | List of all members
QWidgetEffectSourcePrivate Class Reference

#include <qwidget_p.h>

Inheritance diagram for QWidgetEffectSourcePrivate:
QGraphicsEffectSourcePrivate QObjectPrivate QObjectData

Public Functions

QRectF boundingRect (Qt::CoordinateSystem system) const
 
void detach ()
 
QRect deviceRect () const
 
void draw (QPainter *p)
 
void effectBoundingRectChanged ()
 
const QGraphicsItemgraphicsItem () const
 
bool isPixmap () const
 
QPixmap pixmap (Qt::CoordinateSystem system, QPoint *offset, QGraphicsEffect::PixmapPadMode mode) const
 
 QWidgetEffectSourcePrivate (QWidget *widget)
 
const QStyleOptionstyleOption () const
 
void update ()
 
const QWidgetwidget () const
 
- Public Functions inherited from QGraphicsEffectSourcePrivate
QGraphicsEffect::PixmapPadMode currentCachedMode () const
 
Qt::CoordinateSystem currentCachedSystem () const
 
void invalidateCache (InvalidateReason reason=SourceChanged) const
 
 QGraphicsEffectSourcePrivate ()
 
void setCachedOffset (const QPoint &offset)
 
virtual ~QGraphicsEffectSourcePrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Public Variables

QWidgetPaintContextcontext
 
QTransform lastEffectTransform
 
QWidgetm_widget
 
bool updateDueToGraphicsEffect
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Additional Inherited Members

- Public Types inherited from QGraphicsEffectSourcePrivate
enum  InvalidateReason { TransformChanged, EffectRectChanged, SourceChanged }
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Detailed Description

Definition at line 945 of file qwidget_p.h.

Constructors and Destructors

◆ QWidgetEffectSourcePrivate()

QWidgetEffectSourcePrivate::QWidgetEffectSourcePrivate ( QWidget widget)
inline

Definition at line 948 of file qwidget_p.h.

Functions

◆ boundingRect()

QRectF QWidgetEffectSourcePrivate::boundingRect ( Qt::CoordinateSystem  system) const
virtual

Implements QGraphicsEffectSourcePrivate.

Definition at line 6013 of file qwidget.cpp.

6014 {
6015  if (system != Qt::DeviceCoordinates)
6016  return m_widget->rect();
6017 
6018  if (!context) {
6019  // Device coordinates without context not yet supported.
6020  qWarning("QGraphicsEffectSource::boundingRect: Not yet implemented, lacking device context");
6021  return QRectF();
6022  }
6023 
6025 }
QPainter * painter
Definition: qwidget_p.h:941
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
Q_CORE_EXPORT void qWarning(const char *,...)
const QTransform & worldTransform() const
Returns the world transformation matrix.
Definition: qpainter.cpp:9652
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
QWidgetPaintContext * context
Definition: qwidget_p.h:993

◆ detach()

void QWidgetEffectSourcePrivate::detach ( )
inlinevirtual

Implements QGraphicsEffectSourcePrivate.

Definition at line 952 of file qwidget_p.h.

953  { m_widget->d_func()->graphicsEffect = 0; }
QGraphicsEffect * graphicsEffect() const
The graphicsEffect function returns a pointer to the widget&#39;s graphics effect.
Definition: qwidget.cpp:5484

◆ deviceRect()

QRect QWidgetEffectSourcePrivate::deviceRect ( ) const
inlinevirtual

Implements QGraphicsEffectSourcePrivate.

Definition at line 984 of file qwidget_p.h.

985  { return m_widget->window()->rect(); }
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492

◆ draw()

void QWidgetEffectSourcePrivate::draw ( QPainter p)
virtual

Implements QGraphicsEffectSourcePrivate.

Definition at line 6027 of file qwidget.cpp.

6028 {
6029  if (!context || context->painter != painter) {
6030  m_widget->render(painter);
6031  return;
6032  }
6033 
6034  // The region saved in the context is neither clipped to the rect
6035  // nor the mask, so we have to clip it here before calling drawWidget.
6036  QRegion toBePainted = context->rgn;
6037  toBePainted &= m_widget->rect();
6039  if (wd->extra && wd->extra->hasMask)
6040  toBePainted &= wd->extra->mask;
6041 
6042  wd->drawWidget(context->pdev, toBePainted, context->offset, context->flags,
6044 }
QPainter * painter
Definition: qwidget_p.h:941
QPainter * sharedPainter
Definition: qwidget_p.h:939
QPaintDevice * pdev
Definition: qwidget_p.h:935
void drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter=0, QWidgetBackingStore *backingStore=0)
Definition: qwidget.cpp:5679
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
QRegion mask
Definition: qwidget_p.h:260
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
Q_GUI_EXPORT QWidgetPrivate * qt_widget_private(QWidget *widget)
Definition: qwidget.cpp:12920
QWidgetPaintContext * context
Definition: qwidget_p.h:993
QWExtra * extra
Definition: qwidget_p.h:700
uint hasMask
Definition: qwidget_p.h:278
QWidgetBackingStore * backingStore
Definition: qwidget_p.h:940
void render(QPaintDevice *target, const QPoint &targetOffset=QPoint(), const QRegion &sourceRegion=QRegion(), RenderFlags renderFlags=RenderFlags(DrawWindowBackground|DrawChildren))
Renders the sourceRegion of this widget into the target using renderFlags to determine how to render...
Definition: qwidget.cpp:5372

◆ effectBoundingRectChanged()

void QWidgetEffectSourcePrivate::effectBoundingRectChanged ( )
inlinevirtual

Implements QGraphicsEffectSourcePrivate.

Definition at line 971 of file qwidget_p.h.

972  {
973  // ### This function should take a rect parameter; then we can avoid
974  // updating too much on the parent widget.
976  parent->update();
977  else
978  update();
979  }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QObject * parent
Definition: qobject.h:92

◆ graphicsItem()

const QGraphicsItem* QWidgetEffectSourcePrivate::graphicsItem ( ) const
inlinevirtual

Implements QGraphicsEffectSourcePrivate.

Definition at line 955 of file qwidget_p.h.

956  { return 0; }

◆ isPixmap()

bool QWidgetEffectSourcePrivate::isPixmap ( ) const
inlinevirtual

Implements QGraphicsEffectSourcePrivate.

Definition at line 968 of file qwidget_p.h.

969  { return false; }

◆ pixmap()

QPixmap QWidgetEffectSourcePrivate::pixmap ( Qt::CoordinateSystem  system,
QPoint offset,
QGraphicsEffect::PixmapPadMode  mode 
) const
virtual

Implements QGraphicsEffectSourcePrivate.

Definition at line 6046 of file qwidget.cpp.

6048 {
6049  const bool deviceCoordinates = (system == Qt::DeviceCoordinates);
6050  if (!context && deviceCoordinates) {
6051  // Device coordinates without context not yet supported.
6052  qWarning("QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context");
6053  return QPixmap();
6054  }
6055 
6056  QPoint pixmapOffset;
6057  QRectF sourceRect = m_widget->rect();
6058 
6059  if (deviceCoordinates) {
6060  const QTransform &painterTransform = context->painter->worldTransform();
6061  sourceRect = painterTransform.mapRect(sourceRect);
6062  pixmapOffset = painterTransform.map(pixmapOffset);
6063  }
6064 
6065  QRect effectRect;
6066 
6068  effectRect = m_widget->graphicsEffect()->boundingRectFor(sourceRect).toAlignedRect();
6069  else if (mode == QGraphicsEffect::PadToTransparentBorder)
6070  effectRect = sourceRect.adjusted(-1, -1, 1, 1).toAlignedRect();
6071  else
6072  effectRect = sourceRect.toAlignedRect();
6073 
6074  if (offset)
6075  *offset = effectRect.topLeft();
6076 
6077  pixmapOffset -= effectRect.topLeft();
6078 
6079  QPixmap pixmap(effectRect.size());
6081  m_widget->render(&pixmap, pixmapOffset, QRegion(), QWidget::DrawChildren);
6082  return pixmap;
6083 }
QRect toAlignedRect() const
Returns a QRect based on the values of this rectangle that is the smallest possible integer rectangle...
Definition: qrect.cpp:2817
QPainter * painter
Definition: qwidget_p.h:941
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
Q_CORE_EXPORT void qWarning(const char *,...)
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
Definition: qrect.h:781
QGraphicsEffect * graphicsEffect() const
The graphicsEffect function returns a pointer to the widget&#39;s graphics effect.
Definition: qwidget.cpp:5484
void fill(const QColor &fillColor=Qt::white)
Fills the pixmap with the given color.
Definition: qpixmap.cpp:1080
const QTransform & worldTransform() const
Returns the world transformation matrix.
Definition: qpainter.cpp:9652
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
virtual QRectF boundingRectFor(const QRectF &sourceRect) const
Returns the effective bounding rectangle for this effect, given the provided rect in the device coord...
QWidgetPaintContext * context
Definition: qwidget_p.h:993
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset, QGraphicsEffect::PixmapPadMode mode) const
Definition: qwidget.cpp:6046
void render(QPaintDevice *target, const QPoint &targetOffset=QPoint(), const QRegion &sourceRegion=QRegion(), RenderFlags renderFlags=RenderFlags(DrawWindowBackground|DrawChildren))
Renders the sourceRegion of this widget into the target using renderFlags to determine how to render...
Definition: qwidget.cpp:5372
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

◆ styleOption()

const QStyleOption* QWidgetEffectSourcePrivate::styleOption ( ) const
inlinevirtual

Implements QGraphicsEffectSourcePrivate.

Definition at line 981 of file qwidget_p.h.

982  { return 0; }

◆ update()

void QWidgetEffectSourcePrivate::update ( )
inlinevirtual

Implements QGraphicsEffectSourcePrivate.

Definition at line 961 of file qwidget_p.h.

962  {
964  m_widget->update();
966  }
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883

◆ widget()

const QWidget* QWidgetEffectSourcePrivate::widget ( ) const
inlinevirtual

Implements QGraphicsEffectSourcePrivate.

Definition at line 958 of file qwidget_p.h.

959  { return m_widget; }

Properties

◆ context

QWidgetPaintContext* QWidgetEffectSourcePrivate::context

Definition at line 993 of file qwidget_p.h.

Referenced by QWidgetPrivate::drawWidget().

◆ lastEffectTransform

QTransform QWidgetEffectSourcePrivate::lastEffectTransform

Definition at line 994 of file qwidget_p.h.

Referenced by QWidgetPrivate::drawWidget().

◆ m_widget

QWidget* QWidgetEffectSourcePrivate::m_widget

Definition at line 992 of file qwidget_p.h.

◆ updateDueToGraphicsEffect

bool QWidgetEffectSourcePrivate::updateDueToGraphicsEffect

Definition at line 995 of file qwidget_p.h.

Referenced by QWidgetPrivate::invalidateGraphicsEffectsRecursively().


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