Fix a crash with trying to show the tooltip on the profile.

Fixed a crash with trying to show the tooltip on the profile,
with an empty profile. Since the widgets are not created yet,
we got a crash trying to access the toolBarProxy.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2013-11-16 22:24:10 -02:00 committed by Dirk Hohndel
parent 7e9a7b6223
commit 5058d8914a

View file

@ -139,7 +139,7 @@ bool ProfileGraphicsView::eventFilter(QObject* obj, QEvent* event)
// This will "Eat" the default tooltip behavior if it is not on the toolBar. // This will "Eat" the default tooltip behavior if it is not on the toolBar.
if (event->type() == QEvent::GraphicsSceneHelp) { if (event->type() == QEvent::GraphicsSceneHelp) {
if(!toolBarProxy->geometry().contains(mapFromGlobal(QCursor::pos()))){ if(toolBarProxy && !toolBarProxy->geometry().contains(mapFromGlobal(QCursor::pos()))){
event->ignore(); event->ignore();
return true; return true;
} }