Ejemplo n.º 1
0
void SeqDiagramView::keyPressEvent(QKeyEvent * e)
{
    if (!window()->frozen()) {
        DiagramView::keyPressEvent(e);

        if (e->modifiers() != ::Qt::ControlModifier) {
            switch (e->key()) {
            case ::Qt::Key_Left:
            case ::Qt::Key_Up:
            case ::Qt::Key_Right:
            case ::Qt::Key_Down: {
                QList<QGraphicsItem*> all = canvas()->items();
                QList<QGraphicsItem*>::Iterator cit;

                for (cit = all.begin(); cit != all.end(); ++cit) {
                    DiagramItem * it = QCanvasItemToDiagramItem(*cit);

                    if ((it != 0) && // an uml canvas item
                            (*cit)->isVisible())
                        it->update();
                }
            }
                break;

            default:
                break;
            }
        }
    }
}
Ejemplo n.º 2
0
void SeqDiagramView::mouseMoveEvent(QMouseEvent * e)
{
    if (!window()->frozen()) {
        DiagramView::mouseMoveEvent(e);

        QList<QGraphicsItem*> all = canvas()->items();
        QList<QGraphicsItem*>::Iterator cit;

        for (cit = all.begin(); cit != all.end(); ++cit) {
            DiagramItem * it = QCanvasItemToDiagramItem(*cit);

            if ((it != 0) && // an uml canvas item
                    (*cit)->isVisible())
                it->update();
        }
    }
}