Add notify signal for Svg::imagePath property

The missing notify signal was causing problems in QtQuick2:
"depends on non-NOTIFYable properties".

Reviewed-By: Marco Martin
This commit is contained in:
Martin Gräßlin 2013-10-01 11:34:39 +02:00
parent 8dcfa386d0
commit ea376016c0
2 changed files with 8 additions and 1 deletions

View File

@ -235,6 +235,8 @@ bool SvgPrivate::setImagePath(const QString &imagePath)
lastModified = info.lastModified().toTime_t();
}
emit q->imagePathChanged();
return updateNeeded;
}

View File

@ -59,7 +59,7 @@ class PLASMA_EXPORT Svg : public QObject
Q_ENUMS(ContentType)
Q_PROPERTY(QSize size READ size WRITE resize NOTIFY sizeChanged)
Q_PROPERTY(bool multipleImages READ containsMultipleImages WRITE setContainsMultipleImages)
Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath)
Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath NOTIFY imagePathChanged)
Q_PROPERTY(bool usingRenderingCache READ isUsingRenderingCache WRITE setUsingRenderingCache)
public:
@ -378,6 +378,11 @@ class PLASMA_EXPORT Svg : public QObject
*/
void sizeChanged();
/**
* Emitted whenever the image path of the Svg is changed.
*/
void imagePathChanged();
private:
SvgPrivate *const d;