qlegend.h
107 lines
| 3.1 KiB
| text/x-c
|
CLexer
Jani Honkonen
|
r794 | /**************************************************************************** | ||
** | ||||
Miikka Heikkinen
|
r2432 | ** Copyright (C) 2013 Digia Plc | ||
Jani Honkonen
|
r794 | ** All rights reserved. | ||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
Miikka Heikkinen
|
r2574 | ** This file is part of the Qt Enterprise Charts Add-on. | ||
Jani Honkonen
|
r794 | ** | ||
** $QT_BEGIN_LICENSE$ | ||||
Miikka Heikkinen
|
r2574 | ** Licensees holding valid Qt Enterprise licenses may use this file in | ||
** accordance with the Qt Enterprise License Agreement provided with the | ||||
Jani Honkonen
|
r794 | ** 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
|
r524 | #ifndef QLEGEND_H | ||
#define QLEGEND_H | ||||
Tero Ahola
|
r1836 | #include <qchartglobal.h> | ||
Michal Klocek
|
r790 | #include <QGraphicsWidget> | ||
sauimone
|
r762 | #include <QPen> | ||
#include <QBrush> | ||||
sauimone
|
r524 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
Michal Klocek
|
r790 | class QChart; | ||
Michal Klocek
|
r950 | class QLegendPrivate; | ||
sauimone
|
r2160 | class QLegendMarker; | ||
sauimone
|
r2167 | class QAbstractSeries; | ||
sauimone
|
r524 | |||
Michal Klocek
|
r790 | class QTCOMMERCIALCHART_EXPORT QLegend : public QGraphicsWidget | ||
sauimone
|
r524 | { | ||
Q_OBJECT | ||||
Tero Ahola
|
r1481 | Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment) | ||
Tero Ahola
|
r1452 | Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible NOTIFY backgroundVisibleChanged) | ||
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) | ||||
Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged) | ||||
sauimone
|
r1522 | Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) | ||
sauimone
|
r1527 | Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor NOTIFY labelColorChanged) | ||
sauimone
|
r803 | |||
Michal Klocek
|
r790 | private: | ||
explicit QLegend(QChart *chart); | ||||
sauimone
|
r616 | |||
Michal Klocek
|
r790 | public: | ||
Michal Klocek
|
r950 | ~QLegend(); | ||
sauimone
|
r524 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); | ||
Tero Ahola
|
r737 | void setBrush(const QBrush &brush); | ||
Michal Klocek
|
r645 | QBrush brush() const; | ||
Tero Ahola
|
r1452 | void setColor(QColor color); | ||
QColor color(); | ||||
Michal Klocek
|
r645 | |||
Tero Ahola
|
r737 | void setPen(const QPen &pen); | ||
Michal Klocek
|
r645 | QPen pen() const; | ||
Tero Ahola
|
r1452 | void setBorderColor(QColor color); | ||
QColor borderColor(); | ||||
sauimone
|
r540 | |||
sauimone
|
r1522 | void setFont(const QFont &font); | ||
QFont font() const; | ||||
sauimone
|
r1527 | void setLabelBrush(const QBrush &brush); | ||
QBrush labelBrush() const; | ||||
void setLabelColor(QColor color); | ||||
QColor labelColor() const; | ||||
sauimone
|
r1522 | |||
Tero Ahola
|
r1357 | void setAlignment(Qt::Alignment alignment); | ||
Qt::Alignment alignment() const; | ||||
sauimone
|
r616 | |||
sauimone
|
r799 | void detachFromChart(); | ||
void attachToChart(); | ||||
Michal Klocek
|
r855 | bool isAttachedToChart(); | ||
sauimone
|
r882 | void setBackgroundVisible(bool visible = true); | ||
Michal Klocek
|
r855 | bool isBackgroundVisible() const; | ||
sauimone
|
r2193 | QList <QLegendMarker*> markers(QAbstractSeries *series = 0) const; | ||
sauimone
|
r2160 | |||
Michal Klocek
|
r855 | protected: | ||
void hideEvent(QHideEvent *event); | ||||
void showEvent(QShowEvent *event); | ||||
sauimone
|
r547 | |||
Tero Ahola
|
r1357 | Q_SIGNALS: | ||
Tero Ahola
|
r1452 | void backgroundVisibleChanged(bool visible); | ||
void colorChanged(QColor color); | ||||
void borderColorChanged(QColor color); | ||||
sauimone
|
r1522 | void fontChanged(QFont font); | ||
sauimone
|
r1527 | void labelColorChanged(QColor color); | ||
Tero Ahola
|
r1357 | |||
Michal Klocek
|
r855 | private: | ||
Michal Klocek
|
r950 | QScopedPointer<QLegendPrivate> d_ptr; | ||
Tero Ahola
|
r1452 | Q_DISABLE_COPY(QLegend) | ||
Michal Klocek
|
r950 | friend class LegendScroller; | ||
Michal Klocek
|
r1534 | friend class LegendLayout; | ||
friend class ChartLayout; | ||||
sauimone
|
r2183 | friend class LegendMarkerItem; | ||
sauimone
|
r2194 | friend class QLegendMarkerPrivate; | ||
Michal Klocek
|
r859 | }; | ||
sauimone
|
r524 | QTCOMMERCIALCHART_END_NAMESPACE | ||
#endif // QLEGEND_H | ||||