Added labelRect function to meter to allow applets to create correctly elided text.

svn path=/trunk/KDE/kdelibs/; revision=881275
This commit is contained in:
Rob Scheepmaker 2008-11-07 17:19:47 +00:00
parent 4de7d13a16
commit 4cb5e7857c
2 changed files with 12 additions and 0 deletions

View File

@ -281,6 +281,12 @@ Qt::Alignment Meter::labelAlignment(int index) const
return d->alignments[index];
}
QRectF Meter::labelRect(int index) const
{
QString elementID = QString("label%1").arg(index);
return d->image->elementRect(elementID);
}
void Meter::dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data)
{
Q_UNUSED(sourceName)

View File

@ -189,6 +189,12 @@ public:
*/
Qt::Alignment labelAlignment(int index) const;
/**
* @param index label index
* @return the size of this label.
*/
QRectF labelRect(int index) const;
public Q_SLOTS:
/**
* Used when connecting to a DataEngine