first commit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
#include "piccodeitem.h"
|
||||
|
||||
|
||||
|
||||
PicCodeItem::PicCodeItem(QGraphicsItem *parent, QGraphicsScene *scene, const SourceType type)
|
||||
:PicTextItem(parent, scene, type)
|
||||
{
|
||||
setFlag(QGraphicsItem::ItemIsMovable);
|
||||
setFlag(QGraphicsItem::ItemIsSelectable);
|
||||
setFlag(QGraphicsItem::ItemIsFocusable);
|
||||
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||
}
|
||||
|
||||
QVariant PicCodeItem::source()
|
||||
{
|
||||
return imagePath;
|
||||
}
|
||||
|
||||
void PicCodeItem::setSource(QVariant var)
|
||||
{
|
||||
imagePath = var.toString();
|
||||
applyModify();
|
||||
}
|
||||
|
||||
QImage PicCodeItem::itemImage()
|
||||
{
|
||||
return QImage(imagePath);
|
||||
}
|
||||
|
||||
void PicCodeItem::setCustomAttrs(const QXmlStreamAttributes &attrs)
|
||||
{
|
||||
imagePath = attrs.value("CodeImage").toString();
|
||||
}
|
||||
|
||||
void PicCodeItem::saveCustomAttrs(QXmlStreamAttributes &attrs)
|
||||
{
|
||||
attrs.append("CodeImage", imagePath);
|
||||
}
|
||||
Reference in New Issue
Block a user