diff --git a/scripting/appletscript.cpp b/scripting/appletscript.cpp index 700f426b3..214294f9d 100644 --- a/scripting/appletscript.cpp +++ b/scripting/appletscript.cpp @@ -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()) { diff --git a/scripting/appletscript.h b/scripting/appletscript.h index e677619b7..ceea1c575 100644 --- a/scripting/appletscript.h +++ b/scripting/appletscript.h @@ -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: