移除souce属性
This commit is contained in:
@@ -6,19 +6,19 @@ PicImageItem::PicImageItem(QGraphicsItem *parent, QGraphicsScene *scene, const S
|
||||
|
||||
}
|
||||
|
||||
QVariant PicImageItem::source()
|
||||
QString PicImageItem::imagePath()
|
||||
{
|
||||
return m_imgPath;
|
||||
}
|
||||
|
||||
void PicImageItem::setSource(QVariant var)
|
||||
void PicImageItem::setImagePath(const QString& path)
|
||||
{
|
||||
QImage img(var.toString());
|
||||
QImage img(path);
|
||||
if(img.isNull())
|
||||
return;
|
||||
|
||||
m_img = img;
|
||||
m_imgPath = var.toString();
|
||||
m_imgPath = path;
|
||||
applyModify();
|
||||
}
|
||||
|
||||
@@ -29,12 +29,12 @@ QImage PicImageItem::itemImage()
|
||||
|
||||
void PicImageItem::setCustomAttrs(const QXmlStreamAttributes &attrs)
|
||||
{
|
||||
setSource(attrs.value("source").toString());
|
||||
setImagePath(attrs.value("source").toString());
|
||||
}
|
||||
|
||||
void PicImageItem::saveCustomAttrs(QXmlStreamAttributes &attrs)
|
||||
{
|
||||
attrs.append("source", source().toString());
|
||||
attrs.append("source", imagePath());
|
||||
}
|
||||
|
||||
void PicImageItem::colorReversalChanged()
|
||||
|
||||
Reference in New Issue
Block a user