Light change in user interface

When mouse over a element, coonductor, text, the graphic symbol draw his bounding box.
and draw a tooltip with his name
For conductor the conductor size change.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3490 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
runsys
2014-11-16 14:15:32 +00:00
parent 6f23bea143
commit e2f6e232ee
8 changed files with 168 additions and 9 deletions

View File

@@ -30,7 +30,9 @@ ConductorTextItem::ConductorTextItem(Conductor *parent_conductor, Diagram *paren
parent_conductor_(parent_conductor),
moved_by_user_(false),
rotate_by_user_(false)
{}
{
setAcceptsHoverEvents(true);
}
/**
Constructeur
@@ -201,3 +203,40 @@ void ConductorTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) {
QGraphicsTextItem::mouseReleaseEvent(e);
}
}
/**
When mouse over element
change bMouseOver to true (used in paint() function )
@param e QGraphicsSceneHoverEvent
*/
void ConductorTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *e) {
Q_UNUSED(e);
bMouseOver = true;
QString str_ToolTip = toPlainText();
setToolTip( str_ToolTip );
update();
}
/**
When mouse over element leave the position
change bMouseOver to false(used in paint() function )
@param e QGraphicsSceneHoverEvent
*/
void ConductorTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *e) {
Q_UNUSED(e);
//qDebug() << "Leave mouse over";
bMouseOver = false;
update();
}
/**
Do nothing default function .
@param e QGraphicsSceneHoverEvent
*/
void ConductorTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *e) {
Q_UNUSED(e);
QGraphicsTextItem::hoverMoveEvent(e);
}