Commit 6e82cc74 authored by Jan Möbius's avatar Jan Möbius

Some documentation and cleanup

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14083 383ad7c9-94d9-4d36-a494-682f7c89f535
parent b3d80e9f
......@@ -139,8 +139,7 @@ QwtDoubleRect HistogramItem::boundingRect() const
if ( d_data->attributes & Xfy )
{
rect = QwtDoubleRect( rect.y(), rect.x(),
rect.height(), rect.width() );
rect = QwtDoubleRect( rect.y(), rect.x(), rect.height(), rect.width() );
if ( rect.left() > d_data->reference )
rect.setLeft( d_data->reference );
......@@ -245,8 +244,7 @@ void HistogramItem::draw(QPainter *painter, const QwtScaleMap &xMap,
if ( x2 == qwtMin(xx1, xx2) )
{
const int yy2 = yMap.transform(iData.value(i+1));
if ( yy2 != y0 && ( (yy2 < y0 && y2 < y0) ||
(yy2 > y0 && y2 > y0) ) )
if ( yy2 != y0 && ( (yy2 < y0 && y2 < y0) || (yy2 > y0 && y2 > y0) ) )
{
// One pixel distance between neighboured bars
x2--;
......
......@@ -51,24 +51,50 @@
class QwtIntervalData;
class QString;
/** \brief Histogram plotting widget
*
* This widget can be used to render a plot. It provides a Qt widget with
* histogram bars. The data is supplied as QwtIntervalData via HistogramItem::setData().
* Additionally you can set colors for each bar, which are provided via
* HistogramItem::setColors()
*
*
* !!!!!!!!!!! This class is deprecated !!!!!!!!!!!
* !!!!!!!!! Use the one from ACG/QtWidgets which is for qwt6 !!!!!!!!!!!!!!!!!!
*/
class HistogramItem: public QwtPlotItem
{
public:
/// Constructor
explicit HistogramItem(const QString &title = QString::null);
/// Constructor
explicit HistogramItem(const QwtText &title);
/// Destructor
virtual ~HistogramItem();
/** \brief set data to render
*
* @param data data provided as QwtIntervalData
*/
void setData(const QwtIntervalData &data);
const QwtIntervalData &data() const;
/** \brief Set colors
*
* @param _colors A vector of colors. One for each interval in the same order.
*/
void setColors( std::vector< QColor >& _colors);
/// Function hat will return the datas bounding rectangle (for rendering)
virtual QwtDoubleRect boundingRect() const;
virtual int rtti() const;
virtual void draw(QPainter *, const QwtScaleMap &xMap,
const QwtScaleMap &yMap, const QRect &) const;
/// The actual draw function, drawing the bars inside the plot widget.
virtual void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &) const;
void setBaseline(double reference);
double baseline() const;
......@@ -83,11 +109,11 @@ public:
bool testHistogramAttribute(HistogramAttribute) const;
protected:
virtual void drawBar(QPainter *,
Qt::Orientation o, const QRect &) const;
/// Draws a single bar
virtual void drawBar(QPainter *, Qt::Orientation o, const QRect &) const;
private:
QColor color(uint i) const;
inline QColor color(uint i) const;
void init();
......
......@@ -67,7 +67,7 @@
#include <qwt_scale_engine.h>
#include <qwt_plot_marker.h>
// qmake users have to includepc
// qmake users have to include pc
#include <ui_QwtFunctionPlotBase.hh>
// ACGMake users have to include
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment