##// END OF EJS Templates
Improves build configuration...
Improves build configuration * adds local_build config option * adds developer_build config option * reanmes config files * removes debug stuff * fixes headers issues

File last commit:

r990:2f31b8379e5f
r996:ce5f1c868418
Show More
declarativebarseries.cpp
89 lines | 2.9 KiB | text/x-c | CppLexer
/ qmlplugin / declarativebarseries.cpp
Jani Honkonen
Add/modify license headers
r830 /****************************************************************************
**
** 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$
**
****************************************************************************/
Tero Ahola
Added QML api for bar series
r646 #include "declarativebarseries.h"
#include "declarativechart.h"
#include "qchart.h"
#include "qbarseries.h"
#include "qbarset.h"
QTCOMMERCIALCHART_BEGIN_NAMESPACE
DeclarativeBarSeries::DeclarativeBarSeries(QDeclarativeItem *parent) :
QDeclarativeItem(parent)
{
setFlag(QGraphicsItem::ItemHasNoContents, false);
}
Tero Ahola
QML bar series categories
r726 void DeclarativeBarSeries::componentComplete()
Tero Ahola
Added QML api for bar series
r646 {
if (!m_series) {
DeclarativeChart *declarativeChart = qobject_cast<DeclarativeChart *>(parent());
if (declarativeChart) {
QChart *chart = qobject_cast<QChart *>(declarativeChart->m_chart);
Q_ASSERT(chart);
Tero Ahola
QML bar series categories
r726 // QStringList categories;
// categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun";
// m_series = new QBarSeries(categories);
// m_series = new QBarSeries(m_categories);
m_series = new QBarSeries(m_categories);
Tero Ahola
Added QML api for bar series
r646
// TODO: use data from model
QBarSet *set0 = new QBarSet("Bub");
QBarSet *set1 = new QBarSet("Bob");
QBarSet *set2 = new QBarSet("Guybrush");
*set0 << 1 << 2 << 3 << 4 << 5 << 6;
Tero Ahola
QML test app's scatter and area into separate views
r918 *set1 << 5 << 1 << 2 << 4 << 1 << 7;
Tero Ahola
Added QML api for bar series
r646 *set2 << 3 << 5 << 8 << 13 << 8 << 5;
sauimone
const to getters, renamed addBarset to appendBarset
r776 m_series->appendBarSet(set0);
m_series->appendBarSet(set1);
m_series->appendBarSet(set2);
Tero Ahola
Added QML api for bar series
r646
chart->addSeries(m_series);
}
}
}
Marek Rosa
Removed all the unfinished model functionality from XYSeries and BarSeries
r990 void DeclarativeBarSeries::setBarCategories(QStringList /*categories*/)
Tero Ahola
QML bar series categories
r726 {
Marek Rosa
Removed all the unfinished model functionality from XYSeries and BarSeries
r990 // m_categories = categories;
// if (m_series) {
// // Replace categories of the QBarSeries with the new categories
// for (int i(0); i < m_categories.count(); i++) {
// if (m_series->categories().at(i) != m_categories.at(i))
// m_series->insertCategory(m_series->categoryCount(), m_categories.at(i));
// }
// while (m_series->categoryCount() > m_categories.count())
// m_series->removeCategory(m_series->categoryCount() - 1);
// }
Tero Ahola
QML bar series categories
r726 }
QStringList DeclarativeBarSeries::barCategories()
{
return m_categories;
}
Tero Ahola
Added QML api for bar series
r646 #include "moc_declarativebarseries.cpp"
QTCOMMERCIALCHART_END_NAMESPACE