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:
Jason Stubbs 2007-12-31 01:45:48 +00:00
parent 48a812947b
commit 7a202c3382
2 changed files with 6 additions and 1 deletions

View File

@ -96,8 +96,10 @@ Plasma::Widget *ToolTip::currentWidget() const
//PRIVATE FUNCTIONS
void ToolTip::slotShowToolTip()
{
if ( d->currentWidget->view() && d->currentWidget->view()->mouseGrabber() )
QGraphicsView *v = d->currentWidget->view();
if (v && v->mouseGrabber()) {
return;
}
d->isShown = true; //ToolTip is visible
setVisible(true);

View File

@ -140,6 +140,9 @@ Widget::Widget(QGraphicsItem *parent, QObject* parentObject)
Widget::~Widget()
{
if (ToolTip::instance()->currentWidget() == this) {
ToolTip::instance()->hide();
}
delete d;
}