Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

bool QGraphicsView::event ( QEvent event ) [protected, inherited]

Reimplemented from QAbstractScrollArea.

Definition at line 2805 of file qgraphicsview.cpp.

References QKeyEvent::key(), QCoreApplication::sendEvent(), and QEvent::type().

Referenced by QGraphicsView::viewportEvent().


    if (d->sceneInteractionAllowed) {
        switch (event->type()) {
        case QEvent::ShortcutOverride:
            if (d->scene)
                return QApplication::sendEvent(d->scene, event);
        case QEvent::KeyPress:
            if (d->scene) {
                QKeyEvent *k = static_cast<QKeyEvent *>(event);
                if (k->key() == Qt::Key_Tab || k->key() == Qt::Key_Backtab) {
                    // Send the key events to the scene. This will invoke the
                    // scene's tab focus handling, and if the event is
                    // accepted, we return (prevent further event delivery),
                    // and the base implementation will call QGraphicsView's
                    // focusNextPrevChild() function. If the event is ignored,
                    // we fall back to standard tab focus handling.
                    QApplication::sendEvent(d->scene, event);
                    if (event->isAccepted())
                        return true;
                    // Ensure the event doesn't propagate just because the
                    // scene ignored it. If the event propagates, then tab
                    // handling will be called twice (this and parent).

    return QAbstractScrollArea::event(event);

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index