Holding on to the return value of view() as it's a heavy function call. Hiding
the widget's tooltip when the widget is deleted. Fixed coding style. svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=754986
This commit is contained in:
parent
48a812947b
commit
7a202c3382
@ -96,8 +96,10 @@ Plasma::Widget *ToolTip::currentWidget() const
|
|||||||
//PRIVATE FUNCTIONS
|
//PRIVATE FUNCTIONS
|
||||||
void ToolTip::slotShowToolTip()
|
void ToolTip::slotShowToolTip()
|
||||||
{
|
{
|
||||||
if ( d->currentWidget->view() && d->currentWidget->view()->mouseGrabber() )
|
QGraphicsView *v = d->currentWidget->view();
|
||||||
|
if (v && v->mouseGrabber()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
d->isShown = true; //ToolTip is visible
|
d->isShown = true; //ToolTip is visible
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
|
@ -140,6 +140,9 @@ Widget::Widget(QGraphicsItem *parent, QObject* parentObject)
|
|||||||
|
|
||||||
Widget::~Widget()
|
Widget::~Widget()
|
||||||
{
|
{
|
||||||
|
if (ToolTip::instance()->currentWidget() == this) {
|
||||||
|
ToolTip::instance()->hide();
|
||||||
|
}
|
||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user