Пример #1
0
void RoleItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
    if(!this->selected)
    {
        emit roleSelected(roleID);
    }
    else
    {
        emit roleUnselected(roleID);
    }
}
Пример #2
0
void RoleItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
    if(!this->selected)
    {
        selected=1;
        setY(y()-20);
        emit roleSelected(roleID);
    }
    else
    {
        selected=0;
        setY(y()+20);
        emit roleUnselected(roleID);
    }
}