* add getter for targetItem

* add property for targetItem

svn path=/trunk/KDE/kdelibs/; revision=1031688
This commit is contained in:
Aaron J. Seigo 2009-10-05 18:59:21 +00:00
parent 1a94dec4e2
commit 6ccaa814b3
2 changed files with 11 additions and 0 deletions

View File

@ -190,6 +190,11 @@ void ItemBackground::setTargetItem(QGraphicsItem *target)
}
}
QGraphicsItem *ItemBackground::targetItem() const
{
return d->target;
}
bool ItemBackground::eventFilter(QObject *watched, QEvent *event)
{
QGraphicsWidget *targetWidget = static_cast<QGraphicsWidget *>(d->target);

View File

@ -41,6 +41,7 @@ class PLASMA_EXPORT ItemBackground : public QGraphicsWidget
{
Q_OBJECT
Q_PROPERTY(QRectF target READ target WRITE setTarget)
Q_PROPERTY(QGraphicsItem* targetItem READ targetItem WRITE setTargetItem)
public:
ItemBackground(QGraphicsWidget *parent = 0);
@ -63,6 +64,11 @@ public:
*/
void setTargetItem(QGraphicsItem *target);
/**
* @return the target item, if any
*/
QGraphicsItem *targetItem() const;
/**
* @reimp from QGraphicsWidget
*/