add a missing bit of obvious api.

svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=666798
This commit is contained in:
Aaron J. Seigo 2007-05-20 22:39:38 +00:00
parent 48db336a07
commit f88f9ed076
2 changed files with 14 additions and 2 deletions

View File

@ -128,7 +128,7 @@ Svg::Svg( const QString& imagePath, QObject* parent )
: QObject( parent ),
d( new Private( imagePath ) )
{
connect( Plasma::Theme::self(), SIGNAL(changed()), this, SLOT(themeChanged()) );
connect(Plasma::Theme::self(), SIGNAL(changed()), this, SLOT(themeChanged()));
}
Svg::~Svg()
@ -181,7 +181,12 @@ QSize Svg::elementSize(const QString& elementId)
qreal dy = d->size.height() / naturalSize.height();
elementSize.scale( elementSize.width() * dx, elementSize.height() * dy, Qt::IgnoreAspectRatio );
return elementSize.toSize();;
return elementSize.toSize();
}
QSize Svg::size()
{
return d->size.toSize();
}
void Svg::themeChanged()

7
svg.h
View File

@ -115,6 +115,13 @@ class PLASMA_EXPORT Svg : public QObject
**/
QSize elementSize( const QString& elementId );
/**
* Currently set size of the SVG
* @arg elementId the id of the element to check
* @return the current size of a given element
**/
QSize size();
Q_SIGNALS:
void repaintNeeded();