@@ -94,6 +94,7 QChart::~QChart() | |||||
94 | */ |
|
94 | */ | |
95 | void QChart::addSeries(QSeries* series, QChartAxis* axisY) |
|
95 | void QChart::addSeries(QSeries* series, QChartAxis* axisY) | |
96 | { |
|
96 | { | |
|
97 | Q_ASSERT(series); | |||
97 | d_ptr->m_dataset->addSeries(series, axisY); |
|
98 | d_ptr->m_dataset->addSeries(series, axisY); | |
98 | } |
|
99 | } | |
99 |
|
100 | |||
@@ -105,6 +106,7 void QChart::addSeries(QSeries* series, QChartAxis* axisY) | |||||
105 | */ |
|
106 | */ | |
106 | void QChart::removeSeries(QSeries* series) |
|
107 | void QChart::removeSeries(QSeries* series) | |
107 | { |
|
108 | { | |
|
109 | Q_ASSERT(series); | |||
108 | d_ptr->m_dataset->removeSeries(series); |
|
110 | d_ptr->m_dataset->removeSeries(series); | |
109 | } |
|
111 | } | |
110 |
|
112 | |||
@@ -172,9 +174,9 QString QChart::title() const | |||||
172 | { |
|
174 | { | |
173 | //TODO: refactor me |
|
175 | //TODO: refactor me | |
174 | if (d_ptr->m_presenter->m_titleItem) |
|
176 | if (d_ptr->m_presenter->m_titleItem) | |
175 | return d_ptr->m_presenter->m_titleItem->text(); |
|
177 | return d_ptr->m_presenter->m_titleItem->text(); | |
176 | else |
|
178 | else | |
177 | return QString(); |
|
179 | return QString(); | |
178 | } |
|
180 | } | |
179 |
|
181 | |||
180 | /*! |
|
182 | /*! | |
@@ -188,6 +190,14 void QChart::setTitleFont(const QFont& font) | |||||
188 | d_ptr->m_presenter->updateLayout(); |
|
190 | d_ptr->m_presenter->updateLayout(); | |
189 | } |
|
191 | } | |
190 |
|
192 | |||
|
193 | QFont QChart::titleFont() const | |||
|
194 | { | |||
|
195 | if (d_ptr->m_presenter->m_titleItem) | |||
|
196 | return d_ptr->m_presenter->m_titleItem->font(); | |||
|
197 | else | |||
|
198 | return QFont(); | |||
|
199 | } | |||
|
200 | ||||
191 | /*! |
|
201 | /*! | |
192 | Sets the \a brush used for rendering the title text. |
|
202 | Sets the \a brush used for rendering the title text. | |
193 | */ |
|
203 | */ |
@@ -57,6 +57,7 QChartView::QChartView(QChart *chart,QWidget *parent) : | |||||
57 | QGraphicsView(parent), |
|
57 | QGraphicsView(parent), | |
58 | d_ptr(new QChartViewPrivate()) |
|
58 | d_ptr(new QChartViewPrivate()) | |
59 | { |
|
59 | { | |
|
60 | Q_ASSERT(chart); | |||
60 | d_ptr->m_scene = new QGraphicsScene(this); |
|
61 | d_ptr->m_scene = new QGraphicsScene(this); | |
61 | d_ptr->m_chart = chart; |
|
62 | d_ptr->m_chart = chart; | |
62 | setFrameShape(QFrame::NoFrame); |
|
63 | setFrameShape(QFrame::NoFrame); |
General Comments 0
You need to be logged in to leave comments.
Login now