signals for when the view is about to adjust its scene rect in response to the containment changing so that geometry changes made in view subclasses can be properly coordinated

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=782388
This commit is contained in:
Aaron J. Seigo 2008-03-05 00:02:37 +00:00
parent 56eda6927e
commit 9089d89b12
2 changed files with 24 additions and 0 deletions

View File

@ -160,7 +160,10 @@ bool View::drawWallpaper() const
void View::updateSceneRect()
{
//kDebug( )<< "!!!!!!!!!!!!!!!!! setting the scene rect to" << d->containment->sceneBoundingRect();
emit sceneRectAboutToChange();
setSceneRect(d->containment->sceneBoundingRect());
emit sceneRectChanged();
}
} // namespace Plasma

21
view.h
View File

@ -102,6 +102,27 @@ public:
*/
Containment* containment() const;
Q_SIGNALS:
/**
* This signal is emitted whenever the containment being viewed has
* changed its geometry, but before the View has shifted the viewd scene rect
* to the new geometry. This is useful for Views which want to keep
* their rect() in sync with the containment'sa
*
* @arg rect the new scene rect.
*/
void sceneRectAboutToChange();
/**
* This signal is emitted whenever the containment being viewed has
* changed its geometry, and after the View has shifted the viewd scene rect
* to the new geometry. This is useful for Views which want to keep
* their rect() in sync with the containment's.
*
* @arg rect the new scene rect.
*/
void sceneRectChanged();
protected Q_SLOTS:
void updateSceneRect();