add a contentSizeHint so that this can be easily forwarded in those cases where it needs to be something special (mac dashboard widgets being such an example)

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=779416
This commit is contained in:
Aaron J. Seigo 2008-02-26 04:08:01 +00:00
parent 9c94c63dfe
commit 12cea8acf1
2 changed files with 11 additions and 0 deletions

View File

@ -61,6 +61,11 @@ void AppletScript::paintInterface(QPainter* painter, const QStyleOptionGraphicsI
Q_UNUSED(contentsRect)
}
QSizeF AppletScript::contentSizeHint() const
{
return applet()->contentSizeHint();
}
QSizeF AppletScript::size() const
{
if (applet()) {

View File

@ -68,6 +68,12 @@ public:
const QStyleOptionGraphicsItem* option,
const QRect &contentsRect);
/**
* Called to discover the content size hint for the item.
* The default implementation simply returns the Applet's contentSizeHint
*/
virtual QSizeF contentSizeHint() const;
Q_INVOKABLE QSizeF size() const;
protected: