stub in elementAtPoint; it doesn't actually do anything right now pending changes to QSvgRenderer, but the code is all there ready to go

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=738069
This commit is contained in:
Aaron J. Seigo 2007-11-17 21:34:28 +00:00
parent 2f5fa3f5fa
commit b7ef853123
2 changed files with 17 additions and 0 deletions

11
svg.cpp
View File

@ -273,6 +273,17 @@ bool Svg::elementExists(const QString& elementId) const
return d->renderer->elementExists(elementId);
}
QString Svg::elementAtPoint(const QPoint &point) const
{
d->createRenderer();
QSizeF naturalSize = d->renderer->defaultSize();
qreal dx = d->size.width() / naturalSize.width();
qreal dy = d->size.height() / naturalSize.height();
//kDebug() << point << "is really" << QPoint(point.x() *dx, naturalSize.height() - point.y() * dy);
return QString(); // d->renderer->elementAtPoint(QPoint(point.x() *dx, naturalSize.height() - point.y() * dy));
}
QMatrix Svg::matrixForElement(const QString& elementId) const
{
d->createRenderer();

6
svg.h
View File

@ -158,6 +158,12 @@ class PLASMA_EXPORT Svg : public QObject
**/
Q_INVOKABLE bool elementExists( const QString& elementId ) const;
/**
* Returns the element (by id) at the given point. An empty string is
* returned if no element is at that point.
*/
Q_INVOKABLE QString elementAtPoint(const QPoint &point) const;
/**
* The transformation matrix of the element. That includes the
* transformation on the element itself.