##// END OF EJS Templates
pie: add everything as a property in series...
pie: add everything as a property in series This makes is easy to use from qml (at least). Also added some tests for it.

File last commit:

r1252:4e92004ccd6b
r1255:419a2509ab1e
Show More
qxymodelmapper.h
53 lines | 1.2 KiB | text/x-c | CLexer
#ifndef QXYMODELMAPPER_H
#define QXYMODELMAPPER_H
#include "qchartglobal.h"
#include <QObject>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
class QTCOMMERCIALCHART_EXPORT QXYModelMapper : public QObject
{
Q_OBJECT
Q_PROPERTY(int xSection READ xSection WRITE setXSection)
Q_PROPERTY(int ySection READ ySection WRITE setYSection)
Q_PROPERTY(int first READ first WRITE setFirst)
Q_PROPERTY(int count READ count WRITE setCount)
Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
Q_ENUMS(Qt::Orientation)
public:
int first() const;
void setFirst(int first);
int count() const;
void setCount(int count);
protected:
explicit QXYModelMapper(QObject *parent = 0);
Qt::Orientation orientation() const;
void setOrientation(Qt::Orientation orientation);
int xSection() const;
void setXSection(int xSection);
int ySection() const;
void setYSection(int ySection);
void reset();
Q_SIGNALS:
void updated();
private:
int m_first;
int m_count;
Qt::Orientation m_orientation;
int m_xSection;
int m_ySection;
};
QTCOMMERCIALCHART_END_NAMESPACE
#endif // QXYMODELMAPPER_H