From 84f2fad73e7cacf9c5c0c604c0e9e1664e20f446 Mon Sep 17 00:00:00 2001 From: Percy Leonhardt Date: Sun, 6 Jan 2008 12:49:32 +0000 Subject: [PATCH] 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 --- widgets/signalplotter.cpp | 7 +++++++ widgets/signalplotter.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/widgets/signalplotter.cpp b/widgets/signalplotter.cpp index 546824a08..8ee49702f 100644 --- a/widgets/signalplotter.cpp +++ b/widgets/signalplotter.cpp @@ -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); diff --git a/widgets/signalplotter.h b/widgets/signalplotter.h index bc1b17c0a..ca255b292 100644 --- a/widgets/signalplotter.h +++ b/widgets/signalplotter.h @@ -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();