make it possible for scripts to get at the size of the applet

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=743090
This commit is contained in:
Aaron J. Seigo 2007-11-29 20:39:42 +00:00
parent 5b65d5c54c
commit e07afa49a8
2 changed files with 6 additions and 5 deletions

View File

@ -64,7 +64,11 @@ void ScriptEngine::paintInterface(QPainter* painter, const QStyleOptionGraphicsI
QSizeF ScriptEngine::size() const
{
return QSizeF(0, 0);
if (applet()) {
return applet()->contentSize();
}
return QSizeF();
}
bool ScriptEngine::init()

View File

@ -87,10 +87,7 @@ public:
**/
virtual void paintInterface(QPainter* painter, const QStyleOptionGraphicsItem* option, const QRect &contentsRect);
/**
* @return the size of the applet
**/
virtual QSizeF size() const;
Q_INVOKABLE QSizeF size() const;
protected:
/**