##// END OF EJS Templates
Add minimum size back to chartview and qchart
Add minimum size back to chartview and qchart

File last commit:

r907:e81fc8ea1ebf
r913:d1751eb423f7
Show More
qlegend.h
170 lines | 4.1 KiB | text/x-c | CLexer
Jani Honkonen
Add license headers
r794 /****************************************************************************
**
** Copyright (C) 2012 Digia Plc
** All rights reserved.
** For any questions to Digia, please use contact form at http://qt.digia.com
**
** This file is part of the Qt Commercial Charts Add-on.
**
** $QT_BEGIN_LICENSE$
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
** contact form at http://qt.digia.com
** $QT_END_LICENSE$
**
****************************************************************************/
sauimone
framework for legend
r524 #ifndef QLEGEND_H
#define QLEGEND_H
Michal Klocek
Fix attempt to wrong graphics items hadnling
r790 #include <QChartGlobal>
#include <QGraphicsWidget>
sauimone
minor code review fixes
r762 #include <QPen>
#include <QBrush>
Michal Klocek
Removes not used legendscrollbutton
r860 #include "private/scroller_p.h" //TODO fixme
sauimone
framework for legend
r524
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
legend refactoring.
r792 class QAreaSeries;
sauimone
Scrolling logic to legend
r716 class LegendScrollButton;
sauimone
minor code review fixes
r762 class QSeries;
Michal Klocek
Fix attempt to wrong graphics items hadnling
r790 class QChart;
sauimone
framework for legend
r524
Michal Klocek
Fix attempt to wrong graphics items hadnling
r790 class QTCOMMERCIALCHART_EXPORT QLegend : public QGraphicsWidget
sauimone
framework for legend
r524 {
Q_OBJECT
public:
sauimone
legend fixes
r766 // We only support these alignments (for now)
sauimone
legend layout with padding
r799 enum Alignment {
AlignmentTop = Qt::AlignTop,
AlignmentBottom = Qt::AlignBottom,
AlignmentLeft = Qt::AlignLeft,
AlignmentRight = Qt::AlignRight
sauimone
legend layouting change
r616 };
sauimone
legend pos to theme example, legend padding
r803
Q_DECLARE_FLAGS(Alignments, Alignment)
Michal Klocek
Fix attempt to wrong graphics items hadnling
r790 private:
explicit QLegend(QChart *chart);
sauimone
legend layouting change
r616
Michal Klocek
Fix attempt to wrong graphics items hadnling
r790 public:
sauimone
framework for legend
r524 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
QRectF boundingRect() const;
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 void setBrush(const QBrush &brush);
Michal Klocek
Adds force option to chartTheme...
r645 QBrush brush() const;
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 void setPen(const QPen &pen);
Michal Klocek
Adds force option to chartTheme...
r645 QPen pen() const;
sauimone
background to legend, theme applies
r540
Jani Honkonen
Spelling fix QLegend::setAlignmnent -> setAlignment
r907 void setAlignment(QLegend::Alignments alignment);
sauimone
legend pos to theme example, legend padding
r803 QLegend::Alignments alignment() const;
sauimone
legend layouting change
r616
sauimone
legend layout with padding
r799 void detachFromChart();
void attachToChart();
Michal Klocek
Refactor qledgend handling...
r855 bool isAttachedToChart();
sauimone
fixed typo in minWidth function name. Updated documentationof legend
r888 qreal minWidth() const { return m_minWidth;}
Michal Klocek
Refactor qledgend handling...
r855 qreal minHeight() const { return m_minHeight;}
sauimone
legend layout with padding
r799
sauimone
changed legend default visibility
r882 void setBackgroundVisible(bool visible = true);
Michal Klocek
Refactor qledgend handling...
r855 bool isBackgroundVisible() const;
void setOffset(const QPointF& point);
QPointF offset() const;
protected:
void resizeEvent(QGraphicsSceneResizeEvent *event);
void hideEvent(QHideEvent *event);
void showEvent(QShowEvent *event);
sauimone
Separated legend marker to private header. Added signals for left and right mouse click
r547
sauimone
Q_SIGNALS and Q_SLOTS
r775 public Q_SLOTS:
sauimone
layout fix to legend. Documented legend functions.
r724 // PIMPL --->
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 void handleSeriesAdded(QSeries *series, Domain *domain);
void handleSeriesRemoved(QSeries *series);
void handleAdded(QList<QPieSlice *> slices);
void handleRemoved(QList<QPieSlice *> slices);
sauimone
layout fix to legend. Documented legend functions.
r724 // PIMPL <---
sauimone
framework for legend
r524
private:
sauimone
more intelligent legend. fixed compiler warning in bar.cpp
r565 // PIMPL --->
sauimone
legend refactoring.
r792 void appendMarkers(QAreaSeries *series);
void appendMarkers(QXYSeries *series);
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 void appendMarkers(QBarSeries *series);
void appendMarkers(QPieSeries *series);
void deleteMarkers(QSeries *series);
sauimone
layout fix to legend. Documented legend functions.
r724 void updateLayout();
sauimone
more intelligent legend. fixed compiler warning in bar.cpp
r565
Michal Klocek
Refactor qledgend handling...
r855 private:
sauimone
improved legend layout
r783 qreal m_margin;
sauimone
Adaptive layout to legend. Tries to fit all items inside given maximum size
r626
Michal Klocek
Refactor qledgend handling...
r855 QRectF m_rect;
qreal m_offsetX;
qreal m_offsetY;
//QList<LegendMarker *> m_markers;
sauimone
background to legend, theme applies
r540
Michal Klocek
Adds force option to chartTheme...
r645 QBrush m_brush;
QPen m_pen;
sauimone
legend pos to theme example, legend padding
r803 QLegend::Alignments m_alignment;
Michal Klocek
Refactor qledgend handling...
r855 QGraphicsItemGroup* m_markers;
sauimone
Scrolling logic to legend
r716
sauimone
legend layout with padding
r799 bool m_attachedToChart;
sauimone
legend pos to theme example, legend padding
r803 QChart *m_chart;
Michal Klocek
Refactor qledgend handling...
r855 qreal m_minWidth;
qreal m_minHeight;
qreal m_width;
qreal m_height;
sauimone
changed legend default visibility
r882 bool m_backgroundVisible;
Michal Klocek
Adds ScrolledQLegend...
r859 friend class ScrolledQLegend;
sauimone
Scrolling logic to legend
r716 // <--- PIMPL
sauimone
framework for legend
r524 };
Michal Klocek
Adds ScrolledQLegend...
r859 class ScrolledQLegend: public QLegend, public Scroller
{
public:
ScrolledQLegend(QChart *chart):QLegend(chart)
{
}
void setOffset(const QPointF& point)
{
QLegend::setOffset(point);
}
QPointF offset() const
{
return QLegend::offset();
}
void mousePressEvent(QGraphicsSceneMouseEvent* event){
Scroller::mousePressEvent(event);
//QLegend::mousePressEvent(event);
}
void mouseMoveEvent(QGraphicsSceneMouseEvent* event){
Scroller::mouseMoveEvent(event);
//QLegend::mouseMoveEvent(event);
}
void mouseReleaseEvent(QGraphicsSceneMouseEvent* event){
Scroller::mouseReleaseEvent(event);
//QLegend::mouseReleaseEvent(event);
}
};
sauimone
framework for legend
r524 QTCOMMERCIALCHART_END_NAMESPACE
#endif // QLEGEND_H