Skip to content

Instantly share code, notes, and snippets.

@tronical
Created November 24, 2010 09:49
Show Gist options
  • Save tronical/713415 to your computer and use it in GitHub Desktop.
Save tronical/713415 to your computer and use it in GitHub Desktop.
bool QGraphicsScene::event(QEvent *event)
{
Q_D(QGraphicsScene);
switch (event->type()) {
...
case QEvent::WindowActivate:
if (!d->activationRefCount++) {
if (d->lastActivePanel) {
// Activate the last panel.
d->setActivePanelHelper(d->lastActivePanel, true);
} else if (d->tabFocusFirst && d->tabFocusFirst->isPanel()) {
// Activate the panel of the first item in the tab focus
// chain.
d->setActivePanelHelper(d->tabFocusFirst, true);
} else {
// Activate all toplevel items.
QEvent event(QEvent::WindowActivate);
foreach (QGraphicsItem *item, items()) {
if (item->isVisible() && !item->isPanel() && !item->parentItem())
sendEvent(item, &event);
}
}
}
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment