Permalink
Browse files

Finished fixing label editing

  • Loading branch information...
aelliott committed May 2, 2013
1 parent 16b21e0 commit 9cb3f95439b793510e53bcffa98b19d2858c17f2
@@ -48,6 +48,7 @@ EditEdgeDialog::EditEdgeDialog(EdgeItem *edgeItem, QWidget *parent)
EditEdgeDialog::~EditEdgeDialog()
{
delete _ui;
//delete _labelValidator;
}
void EditEdgeDialog::accept()
@@ -36,7 +36,7 @@ EditNodeDialog::EditNodeDialog(NodeItem *node, QWidget *parent)
EditNodeDialog::~EditNodeDialog()
{
delete _ui;
delete _labelValidator;
//delete _labelValidator;
}
void EditNodeDialog::accept()
@@ -42,19 +42,19 @@ void GraphItem::setId(const QString &itemId)
emit idChanged(_id, itemId);
_id = itemId;
}
update();
}
void GraphItem::setLabel(const QString &itemLabel)
{
_label = itemLabel;
update();
if(itemLabel != _label)
{
_label = itemLabel;
}
}
void GraphItem::setItemState(ItemState state)
{
_itemState = state;
update();
}
}
@@ -59,10 +59,12 @@ NodeItem::NodeItem(const QString &nodeId, const QString &nodeLabel, bool root,
void NodeItem::recalculate()
{
_shape = QPainterPath();
_shape = shape();
_boundingRect = QRectF();
_boundingRect = boundingRect();
qDebug() << _boundingRect;
_shape = QPainterPath();
_shape = shape();
qDebug() << _shape;
emit shapeChanged();
}
@@ -88,6 +90,9 @@ Node *NodeItem::node() const
void NodeItem::setId(const QString &itemId)
{
if(itemId == id())
return;
GraphItem::setId(itemId);
if(_node != 0)
@@ -96,6 +101,9 @@ void NodeItem::setId(const QString &itemId)
void NodeItem::setLabel(const QString &itemLabel)
{
if(itemLabel == label())
return;
GraphItem::setLabel(itemLabel);
recalculate();
@@ -105,6 +113,9 @@ void NodeItem::setLabel(const QString &itemLabel)
void NodeItem::setIsRoot(bool root)
{
if(root == _isRoot)
return;
_isRoot = root;
recalculate();
@@ -114,6 +125,9 @@ void NodeItem::setIsRoot(bool root)
void NodeItem::setMarked(bool isMarked)
{
if(isMarked == _marked)
return;
_marked = isMarked;
if(_node != 0)

0 comments on commit 9cb3f95

Please sign in to comment.