avoid (non-critical) warnings

BUG:264069

svn path=/trunk/KDE/kdelibs/; revision=1217570
This commit is contained in:
Aaron J. Seigo 2011-01-27 22:18:32 +00:00
parent 8c65e607b8
commit 2a916cb089
2 changed files with 12 additions and 9 deletions

View File

@ -234,8 +234,9 @@ void ToolTip::hideEvent(QHideEvent *e)
QWidget::hideEvent(e); QWidget::hideEvent(e);
d->animation->stop(); d->animation->stop();
if (d->source) { QObject *source = d->source.data();
QMetaObject::invokeMethod(d->source.data(), "toolTipHidden"); if (source && source->metaObject()->indexOfMethod("toolTipHidden()") != -1) {
QMetaObject::invokeMethod(source, "toolTipHidden");
} }
WindowEffects::highlightWindows(winId(), QList<WId>()); WindowEffects::highlightWindows(winId(), QList<WId>());

View File

@ -364,13 +364,15 @@ void ToolTipManagerPrivate::showToolTip()
return; return;
} }
// toolTipAboutToShow may call into methods such as setContent which play if (currentWidget->metaObject()->indexOfMethod("toolTipAboutToShow()") != -1) {
// with the current widget; so let's just pretend for a moment that we don't have // toolTipAboutToShow may call into methods such as setContent which play
// a current widget // with the current widget; so let's just pretend for a moment that we don't have
QGraphicsWidget *temp = currentWidget; // a current widget
currentWidget = 0; QGraphicsWidget *temp = currentWidget;
QMetaObject::invokeMethod(temp, "toolTipAboutToShow"); currentWidget = 0;
currentWidget = temp; QMetaObject::invokeMethod(temp, "toolTipAboutToShow");
currentWidget = temp;
}
QHash<QGraphicsWidget *, ToolTipContent>::const_iterator tooltip = tooltips.constFind(currentWidget); QHash<QGraphicsWidget *, ToolTipContent>::const_iterator tooltip = tooltips.constFind(currentWidget);