AppletScript::shape()
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=824153
This commit is contained in:
parent
4f25215729
commit
350bb8c48e
@ -1398,6 +1398,15 @@ QVariant Applet::itemChange(GraphicsItemChange change, const QVariant &value)
|
|||||||
return QGraphicsWidget::itemChange(change, value);
|
return QGraphicsWidget::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPainterPath Applet::shape() const
|
||||||
|
{
|
||||||
|
if (d->script) {
|
||||||
|
return d->script->shape();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QGraphicsWidget::shape();
|
||||||
|
}
|
||||||
|
|
||||||
QSizeF Applet::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const
|
QSizeF Applet::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const
|
||||||
{
|
{
|
||||||
QSizeF hint = QGraphicsWidget::sizeHint(which, constraint);
|
QSizeF hint = QGraphicsWidget::sizeHint(which, constraint);
|
||||||
|
5
applet.h
5
applet.h
@ -727,6 +727,11 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*/
|
*/
|
||||||
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reimplemented from QGraphicsItem
|
||||||
|
*/
|
||||||
|
QPainterPath shape() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reimplemented from QGraphicsLayoutItem
|
* Reimplemented from QGraphicsLayoutItem
|
||||||
*/
|
*/
|
||||||
|
@ -80,6 +80,17 @@ QList<QAction*> AppletScript::contextualActions()
|
|||||||
return QList<QAction*>();
|
return QList<QAction*>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPainterPath AppletScript::shape() const
|
||||||
|
{
|
||||||
|
if (applet()) {
|
||||||
|
QPainterPath path;
|
||||||
|
path.addRect(applet()->boundingRect());
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
return QPainterPath();
|
||||||
|
}
|
||||||
|
|
||||||
void AppletScript::showConfigurationInterface()
|
void AppletScript::showConfigurationInterface()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -98,6 +98,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual QList<QAction*> contextualActions();
|
virtual QList<QAction*> contextualActions();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the shape of the widget, defaults to the bounding rect
|
||||||
|
*/
|
||||||
|
virtual QPainterPath shape() const;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user