have the tooltip inform the widget that it's about to tip so last second updates can be made, particularly nice for expensive tooltips

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=786834
This commit is contained in:
Aaron J. Seigo 2008-03-18 01:39:28 +00:00
parent 124f1da013
commit abf654c5c5
3 changed files with 13 additions and 1 deletions

View File

@ -135,6 +135,7 @@ void ToolTip::showToolTip()
return;
}
d->currentWidget->updateToolTip();
setData(*d->currentWidget->toolTip());
if( d->windowToPreview != 0 ) {

View File

@ -398,6 +398,10 @@ void Widget::setToolTip(const ToolTipData &tip)
}
}
void Widget::updateToolTip()
{
}
void Widget::paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(painter);

View File

@ -279,6 +279,13 @@ public:
*/
void setToolTip(const ToolTipData &dt);
/**
* Called when the tooltip data should be updated, e.g. right before
* a tooltip is shown. This allows tips that are more expensive to
* create ahead of time to be set at the last possible moment.
*/
virtual void updateToolTip();
/**
* Recomended position for a popup window like a menu or a tooltip
* given its size