##// END OF EJS Templates
legend layouting change
legend layouting change

File last commit:

r616:4f2467dfeb41
r616:4f2467dfeb41
Show More
qlegend.h
77 lines | 1.9 KiB | text/x-c | CLexer
sauimone
framework for legend
r524 #ifndef QLEGEND_H
#define QLEGEND_H
#include "qchartglobal.h"
#include "qseries.h"
#include <QGraphicsObject>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
class Domain;
sauimone
First version of legend. Simple markers and serie names. Using drilldown as example for now.
r529 class LegendMarker;
sauimone
more intelligent legend. fixed compiler warning in bar.cpp
r565 class QPieSlice;
class QXYSeries;
class QBarSet;
class QBarSeries;
class QPieSeries;
sauimone
framework for legend
r524
sauimone
First version of legend. Simple markers and serie names. Using drilldown as example for now.
r529 class QTCOMMERCIALCHART_EXPORT QLegend : public QGraphicsObject
sauimone
framework for legend
r524 {
Q_OBJECT
public:
sauimone
legend layouting change
r616 enum PreferredLayout {
PreferredLayoutHorizontal,
PreferredLayoutVertical
};
sauimone
framework for legend
r524 explicit QLegend(QGraphicsItem *parent = 0);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
QRectF boundingRect() const;
sauimone
background to legend, theme applies
r540 void setBackgroundBrush(const QBrush& brush);
QBrush backgroundBrush() const;
sauimone
legend layouting change
r616 void setPreferredLayout(QLegend::PreferredLayout preferred);
sauimone
legend scaling with chart
r582 QSizeF minimumSize() const;
void setMinimumSize(const QSizeF size);
sauimone
legend layouting change
r616 QSizeF maximumSize() const;
void setMaximumSize(const QSizeF size);
sauimone
legend scaling with chart
r582
sauimone
framework for legend
r524 signals:
sauimone
Separated legend marker to private header. Added signals for left and right mouse click
r547 // for interactions.
sauimone
combined clicked and rightclicked events of legend to one event with parameter
r567 void clicked(QSeries* series, Qt::MouseButton button);
void clicked(QBarSet* barset, Qt::MouseButton button);
void clicked(QPieSlice* slice, Qt::MouseButton button);
sauimone
Separated legend marker to private header. Added signals for left and right mouse click
r547
sauimone
framework for legend
r524 public slots:
void handleSeriesAdded(QSeries* series,Domain* domain);
void handleSeriesRemoved(QSeries* series);
sauimone
First version of legend. Simple markers and serie names. Using drilldown as example for now.
r529 void handleGeometryChanged(const QRectF& size);
sauimone
framework for legend
r524
private:
sauimone
more intelligent legend. fixed compiler warning in bar.cpp
r565 // PIMPL --->
sauimone
handleThemeChanged slot to legend.
r586 void createMarkers(QSeries* series);
void appendMarkers(QXYSeries* series);
void appendMarkers(QBarSeries* series);
void appendMarkers(QPieSeries* series);
sauimone
Legend can handle removing of series
r576 void deleteMarkers(QSeries* series);
sauimone
legend layouting change
r616 void layoutChanged(); // TODO: rename this to layoutChanged and remove original layoutChanged, when ready
sauimone
more intelligent legend. fixed compiler warning in bar.cpp
r565 // <--- PIMPL
sauimone
framework for legend
r524
QRectF mBoundingRect;
QList<QSeries*> mSeriesList;
sauimone
First version of legend. Simple markers and serie names. Using drilldown as example for now.
r529 QList<LegendMarker*> mMarkers;
sauimone
background to legend, theme applies
r540
QBrush mBackgroundBrush;
sauimone
legend scaling with chart
r582 QSizeF mMinimumSize;
sauimone
legend layouting change
r616 QSizeF mMaximumSize;
QLegend::PreferredLayout mPreferredLayout;
sauimone
framework for legend
r524 };
QTCOMMERCIALCHART_END_NAMESPACE
#endif // QLEGEND_H