barlabel_p.h
70 lines
| 1.8 KiB
| text/x-c
|
CLexer
Jani Honkonen
|
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
|
r820 | #ifndef BARLABEL_P_H | ||
#define BARLABEL_P_H | ||||
sauimone
|
r263 | |||
#include "qchartglobal.h" | ||||
sauimone
|
r273 | #include <QGraphicsObject> | ||
sauimone
|
r263 | #include <QPen> | ||
sauimone
|
r811 | class QGraphicsSimpleTextItem; | ||
sauimone
|
r263 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
sauimone
|
r267 | class QBarSet; | ||
sauimone
|
r263 | |||
sauimone
|
r817 | // Visual class for bar values | ||
sauimone
|
r263 | // By default these are not visible. | ||
sauimone
|
r820 | class BarLabel : public QGraphicsObject | ||
sauimone
|
r263 | { | ||
sauimone
|
r273 | Q_OBJECT | ||
sauimone
|
r263 | public: | ||
Michal Klocek
|
r970 | explicit BarLabel(QBarSet &barSet, QGraphicsItem *parent = 0); | ||
sauimone
|
r263 | |||
sauimone
|
r776 | void setText(QString str); | ||
QString text() const; | ||||
sauimone
|
r263 | |||
sauimone
|
r776 | void setPen(const QPen &pen); | ||
sauimone
|
r473 | QPen pen() const; | ||
sauimone
|
r263 | |||
sauimone
|
r820 | void setBrush(const QBrush &brush); | ||
QBrush brush() const; | ||||
sauimone
|
r811 | void setFont(const QFont &font); | ||
QFont font() const; | ||||
sauimone
|
r263 | void setPos(qreal x, qreal y); | ||
// From QGraphicsItem | ||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | ||||
QRectF boundingRect() const; | ||||
sauimone
|
r273 | public Q_SLOTS: | ||
sauimone
|
r820 | void labelsVisibleChanged(bool visible); | ||
sauimone
|
r273 | |||
sauimone
|
r263 | private: | ||
sauimone
|
r763 | QBarSet &m_barSet; | ||
sauimone
|
r811 | QGraphicsSimpleTextItem *m_textItem; | ||
sauimone
|
r263 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
sauimone
|
r820 | #endif // BARLABEL_P_H | ||