diff --git a/widgets/tooltip.cpp b/widgets/tooltip.cpp index eebc0c286..9631c2601 100644 --- a/widgets/tooltip.cpp +++ b/widgets/tooltip.cpp @@ -68,7 +68,7 @@ class ToolTipSingleton }; K_GLOBAL_STATIC( ToolTipSingleton, privateInstance ) -ToolTip *ToolTip::instance() +ToolTip *ToolTip::self() { return &privateInstance->self; } diff --git a/widgets/tooltip_p.h b/widgets/tooltip_p.h index 14e476e15..0c8df8d3f 100644 --- a/widgets/tooltip_p.h +++ b/widgets/tooltip_p.h @@ -43,7 +43,7 @@ public: ToolTip(); ~ToolTip(); - static ToolTip *instance(); + static ToolTip *self(); void show(const QPoint &location, Plasma::Widget *widget); void hide(); diff --git a/widgets/widget.cpp b/widgets/widget.cpp index 8ebe6ca65..c2c297db8 100644 --- a/widgets/widget.cpp +++ b/widgets/widget.cpp @@ -140,8 +140,8 @@ Widget::Widget(QGraphicsItem *parent, QObject* parentObject) Widget::~Widget() { - if (ToolTip::instance()->currentWidget() == this) { - ToolTip::instance()->hide(); + if (ToolTip::self()->currentWidget() == this) { + ToolTip::self()->hide(); } delete d; } @@ -503,10 +503,10 @@ ToolTipData Widget::toolTip() const void Widget::setToolTip(const ToolTipData &tip) { d->toolTip = tip; - if (ToolTip::instance()->currentWidget() == this) { + if (ToolTip::self()->currentWidget() == this) { QPoint viewPos = view()->mapFromScene(scenePos()); QPoint globalPos = view()->mapToGlobal(viewPos); - ToolTip::instance()->show(globalPos, this); + ToolTip::self()->show(globalPos, this); } } @@ -560,7 +560,7 @@ bool Widget::sceneEvent(QEvent *event) case QEvent::GraphicsSceneHoverMove: // If the tooltip isn't visible, run through showing the tooltip again // so that it only becomes visible after a stationary hover - if (ToolTip::instance()->isVisible()) { + if (ToolTip::self()->isVisible()) { break; } @@ -580,7 +580,7 @@ bool Widget::sceneEvent(QEvent *event) if (parentView) { QPoint viewPos = parentView->mapFromScene(scenePos()); QPoint globalPos = parentView->mapToGlobal(viewPos); - ToolTip::instance()->show(globalPos, this); + ToolTip::self()->show(globalPos, this); } break; @@ -589,7 +589,7 @@ bool Widget::sceneEvent(QEvent *event) case QEvent::GraphicsSceneHoverLeave: case QEvent::GraphicsSceneMousePress: case QEvent::GraphicsSceneWheel: - ToolTip::instance()->hide(); + ToolTip::self()->hide(); default: break;