don't crash when given a null item pointer
BUG:176410 svn path=/trunk/KDE/kdelibs/; revision=891032
This commit is contained in:
parent
c4d63ac944
commit
2048022183
@ -69,7 +69,7 @@ Direction locationToDirection(Location location)
|
|||||||
|
|
||||||
QGraphicsView *viewFor(const QGraphicsItem *item)
|
QGraphicsView *viewFor(const QGraphicsItem *item)
|
||||||
{
|
{
|
||||||
if (!item->scene()) {
|
if (!item || !item->scene()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,9 +166,9 @@ void ToolTipManager::hide(QGraphicsWidget *widget)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
d->currentWidget = 0;
|
||||||
d->showTimer->stop(); // stop the timer to show the tooltip
|
d->showTimer->stop(); // stop the timer to show the tooltip
|
||||||
d->delayedHide = false;
|
d->delayedHide = false;
|
||||||
d->currentWidget = 0;
|
|
||||||
d->tipWidget->hide();
|
d->tipWidget->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,10 +255,10 @@ void ToolTipManagerPrivate::onWidgetDestroyed(QObject *object)
|
|||||||
QGraphicsWidget *w = static_cast<QGraphicsWidget*>(object);
|
QGraphicsWidget *w = static_cast<QGraphicsWidget*>(object);
|
||||||
|
|
||||||
if (currentWidget == w) {
|
if (currentWidget == w) {
|
||||||
tipWidget->setContent(0, ToolTipContent());
|
|
||||||
tipWidget->hide();
|
|
||||||
currentWidget = 0;
|
currentWidget = 0;
|
||||||
showTimer->stop(); // stop the timer to show the tooltip
|
showTimer->stop(); // stop the timer to show the tooltip
|
||||||
|
tipWidget->setContent(0, ToolTipContent());
|
||||||
|
tipWidget->hide();
|
||||||
delayedHide = false;
|
delayedHide = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,8 +277,8 @@ void ToolTipManagerPrivate::resetShownState()
|
|||||||
//One might have moused out and back in again
|
//One might have moused out and back in again
|
||||||
delayedHide = false;
|
delayedHide = false;
|
||||||
isShown = false;
|
isShown = false;
|
||||||
tipWidget->hide();
|
|
||||||
currentWidget = 0;
|
currentWidget = 0;
|
||||||
|
tipWidget->hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user