use the default corona in case the widget doesn't provide one
we need a different solution for libplasma2, however. BUG:281759
This commit is contained in:
parent
b556753ecd
commit
96cdb27080
@ -248,6 +248,11 @@ void ToolTipManager::setContent(QGraphicsWidget *widget, const ToolTipContent &d
|
|||||||
//look if the data prefers aother graphicswidget, otherwise use the one used as event catcher
|
//look if the data prefers aother graphicswidget, otherwise use the one used as event catcher
|
||||||
QGraphicsWidget *referenceWidget = data.graphicsWidget() ? data.graphicsWidget() : widget;
|
QGraphicsWidget *referenceWidget = data.graphicsWidget() ? data.graphicsWidget() : widget;
|
||||||
Corona *corona = qobject_cast<Corona *>(referenceWidget->scene());
|
Corona *corona = qobject_cast<Corona *>(referenceWidget->scene());
|
||||||
|
if (!corona) {
|
||||||
|
// fallback to the corona we were given
|
||||||
|
corona = m_corona;
|
||||||
|
}
|
||||||
|
|
||||||
if (corona) {
|
if (corona) {
|
||||||
d->tipWidget->moveTo(corona->popupPosition(referenceWidget, d->tipWidget->size(), Qt::AlignCenter));
|
d->tipWidget->moveTo(corona->popupPosition(referenceWidget, d->tipWidget->size(), Qt::AlignCenter));
|
||||||
}
|
}
|
||||||
@ -403,6 +408,11 @@ void ToolTipManagerPrivate::showToolTip()
|
|||||||
tipWidget->prepareShowing();
|
tipWidget->prepareShowing();
|
||||||
QGraphicsWidget *referenceWidget = tooltip.value().graphicsWidget() ? tooltip.value().graphicsWidget() : currentWidget;
|
QGraphicsWidget *referenceWidget = tooltip.value().graphicsWidget() ? tooltip.value().graphicsWidget() : currentWidget;
|
||||||
Corona *corona = qobject_cast<Corona *>(referenceWidget->scene());
|
Corona *corona = qobject_cast<Corona *>(referenceWidget->scene());
|
||||||
|
if (!corona) {
|
||||||
|
// fallback to the corona we were given
|
||||||
|
corona = q->m_corona;
|
||||||
|
}
|
||||||
|
|
||||||
if (corona) {
|
if (corona) {
|
||||||
tipWidget->moveTo(corona->popupPosition(referenceWidget, tipWidget->size(), Qt::AlignCenter));
|
tipWidget->moveTo(corona->popupPosition(referenceWidget, tipWidget->size(), Qt::AlignCenter));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user