Created
November 24, 2010 09:52
-
-
Save tronical/713420 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void QGraphicsScene::focusInEvent(QFocusEvent *focusEvent) | |
{ | |
Q_D(QGraphicsScene); | |
d->hasFocus = true; | |
switch (focusEvent->reason()) { | |
case Qt::TabFocusReason: | |
if (!focusNextPrevChild(true)) | |
focusEvent->ignore(); | |
break; | |
case Qt::BacktabFocusReason: | |
if (!focusNextPrevChild(false)) | |
focusEvent->ignore(); | |
break; | |
default: | |
if (d->lastFocusItem) { | |
// Set focus on the last focus item | |
setFocusItem(d->lastFocusItem, focusEvent->reason()); | |
} | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment