mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-30 15:50:52 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user