bug fix: cross ref item have wrong behavior when rotate is master. (thanks mmiacca)

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2984 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-04-12 01:26:19 +00:00
parent c7aaf5b509
commit c7fe3f583b
3 changed files with 14 additions and 11 deletions

View File

@@ -31,15 +31,14 @@
* @param elmt element to dispaly the cross ref
* @param parent parent QetGraphicsItem
*/
CrossRefItem::CrossRefItem(Element *elmt, QetGraphicsItem *parent) :
QetGraphicsItem(parent),
CrossRefItem::CrossRefItem(Element *elmt, QGraphicsItem *parent) :
QGraphicsObject(parent),
element_ (elmt)
{
snap_to_grid_=false;
setFlags(QGraphicsItem::ItemIsSelectable|QGraphicsItem::ItemIsMovable);
setFlags(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsMovable);
connect(elmt, SIGNAL(positionChange(QPointF)), this, SLOT(autoPos()));
connect(elmt, SIGNAL(elementInfoChange(DiagramContext)), this, SLOT(updateLabel()));
connect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
connect(elmt->diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
updateLabel();
}
@@ -50,7 +49,7 @@ CrossRefItem::CrossRefItem(Element *elmt, QetGraphicsItem *parent) :
CrossRefItem::~CrossRefItem() {
disconnect(element_, SIGNAL(positionChange(QPointF)), this, SLOT(autoPos()));
disconnect(element_, SIGNAL(elementInfoChange(DiagramContext)), this, SLOT(updateLabel()));
disconnect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
disconnect(element_->diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
}
/**
@@ -189,7 +188,7 @@ void CrossRefItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
*/
void CrossRefItem::mouseMoveEvent(QGraphicsSceneMouseEvent *e) {
element_->setHighlighted(true);
QetGraphicsItem::mouseMoveEvent(e);
QGraphicsObject::mouseMoveEvent(e);
}
/**
@@ -199,7 +198,7 @@ void CrossRefItem::mouseMoveEvent(QGraphicsSceneMouseEvent *e) {
*/
void CrossRefItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) {
element_->setHighlighted(false);
QetGraphicsItem::mouseReleaseEvent(e);
QGraphicsObject::mouseReleaseEvent(e);
}
/**