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:
parent
2f5fa3f5fa
commit
b7ef853123
11
svg.cpp
11
svg.cpp
@ -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
6
svg.h
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user