The signalplotter needs to know when it is resized. Otherwise the plots are too short for the current width.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=757903
This commit is contained in:
Percy Leonhardt 2008-01-06 12:49:32 +00:00
parent 454d824d4f
commit 84f2fad73e
2 changed files with 13 additions and 0 deletions

View File

@ -516,6 +516,13 @@ QPixmap SignalPlotter::getSnapshotImage(uint w, uint height)
return image;
}
void SignalPlotter::setGeometry(const QRectF &geometry)
{
// First update our size, then update the data buffers accordingly.
Widget::setGeometry(geometry);
updateDataBuffers();
}
void SignalPlotter::paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option);

View File

@ -410,6 +410,12 @@ public:
*/
QPixmap getSnapshotImage(uint width, uint height);
/**
* Overwritten to be notified of size changes. Needed to update the
* data buffers that are used to store the samples.
*/
virtual void setGeometry(const QRectF &geometry);
protected:
void updateDataBuffers();
void calculateNiceRange();