gah, probably not useful, revert previous commit

svn path=/trunk/KDE/kdebase/runtime/; revision=1204317
This commit is contained in:
Marco Martin 2010-12-06 18:42:31 +00:00
parent 6b80b7a199
commit 8a92c6b5f3
2 changed files with 1 additions and 33 deletions

View File

@ -31,6 +31,7 @@ SvgItem::SvgItem(QDeclarativeItem *parent)
: QDeclarativeItem(parent) : QDeclarativeItem(parent)
{ {
setFlag(QGraphicsItem::ItemHasNoContents, false); setFlag(QGraphicsItem::ItemHasNoContents, false);
} }
@ -41,7 +42,6 @@ SvgItem::~SvgItem()
void SvgItem::setElementId(const QString &elementID) void SvgItem::setElementId(const QString &elementID)
{ {
m_elementID = elementID; m_elementID = elementID;
emit sizeChanged();
update(); update();
} }
@ -50,28 +50,6 @@ QString SvgItem::elementId() const
return m_elementID; return m_elementID;
} }
qreal SvgItem::naturalWidth() const
{
if (!m_svg) {
return 0;
} else if (!m_elementID.isEmpty()) {
return m_svg.data()->elementSize(m_elementID).height();
} else {
return m_svg.data()->size().height();
}
}
qreal SvgItem::naturalHeight() const
{
if (!m_svg) {
return 0;
} else if (!m_elementID.isEmpty()) {
return m_svg.data()->elementSize(m_elementID).width();
} else {
return m_svg.data()->size().width();
}
}
void SvgItem::setSvg(Plasma::Svg *svg) void SvgItem::setSvg(Plasma::Svg *svg)
{ {
if (m_svg) { if (m_svg) {
@ -79,8 +57,6 @@ void SvgItem::setSvg(Plasma::Svg *svg)
} }
m_svg = svg; m_svg = svg;
connect(svg, SIGNAL(repaintNeeded()), this, SLOT(update())); connect(svg, SIGNAL(repaintNeeded()), this, SLOT(update()));
connect(svg, SIGNAL(repaintNeeded()), this, SLOT(sizeChanged()));
emit sizeChanged();
} }
Plasma::Svg *SvgItem::svg() const Plasma::Svg *SvgItem::svg() const

View File

@ -31,8 +31,6 @@ class SvgItem : public QDeclarativeItem
Q_PROPERTY(QString elementId READ elementId WRITE setElementId) Q_PROPERTY(QString elementId READ elementId WRITE setElementId)
Q_PROPERTY(Plasma::Svg * svg READ svg WRITE setSvg) Q_PROPERTY(Plasma::Svg * svg READ svg WRITE setSvg)
Q_PROPERTY(qreal naturalWidth READ naturalWidth NOTIFY sizeChanged)
Q_PROPERTY(qreal naturalHeight READ naturalHeight NOTIFY sizeChanged)
public: public:
SvgItem(QDeclarativeItem *parent=0); SvgItem(QDeclarativeItem *parent=0);
@ -44,14 +42,8 @@ public:
void setSvg(Plasma::Svg *svg); void setSvg(Plasma::Svg *svg);
Plasma::Svg *svg() const; Plasma::Svg *svg() const;
qreal naturalWidth() const;
qreal naturalHeight() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
Q_SIGNALS:
void sizeChanged();
private: private:
QWeakPointer<Plasma::Svg> m_svg; QWeakPointer<Plasma::Svg> m_svg;
QString m_elementID; QString m_elementID;