##// END OF EJS Templates
Adds axis scoped pointers (to be checked on windows)
Adds axis scoped pointers (to be checked on windows)

File last commit:

r776:2e4d7bdf36a4
r788:bfedfc6138fd
Show More
qbarset.cpp
206 lines | 3.8 KiB | text/x-c | CppLexer
sauimone
proof of concept implementation for barset and barcategory
r169 #include "qbarset.h"
sauimone
signals and slots for bars and sets
r239 #include <QDebug>
sauimone
tooltip for barcharts
r283 #include <QToolTip>
sauimone
proof of concept implementation for barset and barcategory
r169
QTCOMMERCIALCHART_BEGIN_NAMESPACE
sauimone
Documentation for bar charts
r313 /*!
\class QBarSet
\brief part of QtCommercial chart API.
QBarSet represents one set of bars. Set of bars contains one data value for each category.
First value of set is assumed to belong to first category, second to second category and so on.
If set has fewer values than there are categories, then the missing values are assumed to be
at the end of set. For missing values in middle of a set, numerical value of zero is used.
sauimone
updated documentation and examples for barcharts
r325 \mainclass
sauimone
replaced qbarcategory with qstringlist
r377 \sa QBarSeries, QStackedBarSeries, QPercentBarSeries
sauimone
Documentation for bar charts
r313 */
/*!
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425 \fn void QBarSet::clicked(QString category)
sauimone
Documentation for bar charts
r313 \brief signals that set has been clicked
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425 Parameter \a category describes on which category was clicked
sauimone
Documentation for bar charts
r313 */
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425
/*!
\fn void QBarSet::rightClicked(QString category)
\brief signals that set has been clicked with right mouse button
Parameter \a category describes on which category was clicked
*/
sauimone
Documentation for bar charts
r313 /*!
\fn void QBarSet::hoverEnter(QPoint pos)
\brief signals that mouse has entered over the set at position \a pos.
*/
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425
sauimone
Documentation for bar charts
r313 /*!
\fn void QBarSet::hoverLeave()
\brief signals that mouse has left from the set.
*/
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425
sauimone
Documentation for bar charts
r313 /*!
\fn void QBarSet::toggleFloatingValues()
sauimone
Updated barchart documentation
r319 \brief \internal
sauimone
Documentation for bar charts
r313 */
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425
sauimone
Documentation for bar charts
r313 /*!
\fn void QBarSet::showToolTip(QPoint pos, QString tip)
sauimone
Updated barchart documentation
r319 \brief \internal \a pos \a tip
sauimone
Documentation for bar charts
r313 */
/*!
Constructs QBarSet with a name of \a name and with parent of \a parent
*/
sauimone
barcharts: added legend to model. added signals for hover events (for tooltip). updated examples
r280 QBarSet::QBarSet(QString name, QObject *parent)
sauimone
updated barchart examples. minor fixes
r276 : QObject(parent)
sauimone
minor code review fixes, part n
r763 ,m_name(name)
sauimone
proof of concept implementation for barset and barcategory
r169 {
}
sauimone
Documentation for bar charts
r313 /*!
Sets new \a name for set.
*/
sauimone
proof of concept implementation for barset and barcategory
r169 void QBarSet::setName(QString name)
{
sauimone
minor code review fixes, part n
r763 m_name = name;
sauimone
proof of concept implementation for barset and barcategory
r169 }
sauimone
Documentation for bar charts
r313
/*!
Returns name of the set.
*/
sauimone
const to getters, renamed addBarset to appendBarset
r776 QString QBarSet::name() const
sauimone
Barset and barcategory implememtation. Updated test application
r171 {
sauimone
minor code review fixes, part n
r763 return m_name;
sauimone
Barset and barcategory implememtation. Updated test application
r171 }
sauimone
proof of concept implementation for barset and barcategory
r169
sauimone
Documentation for bar charts
r313 /*!
Appends new value \a value to the end of set.
*/
sauimone
proof of concept implementation for barset and barcategory
r169 QBarSet& QBarSet::operator << (const qreal &value)
{
sauimone
minor code review fixes, part n
r763 m_values.append(value);
Marek Rosa
Barchart updates on BarSet->SetValue now
r655 emit structureChanged();
sauimone
proof of concept implementation for barset and barcategory
r169 return *this;
}
Marek Rosa
Adding data to BarSet through model added
r662 void QBarSet::insertValue(int i, qreal value)
{
sauimone
minor code review fixes, part n
r763 m_values.insert(i, value);
Marek Rosa
Adding data to BarSet through model added
r662 }
Marek Rosa
Removing data from BarSeries through model added
r663 void QBarSet::removeValue(int i)
{
sauimone
minor code review fixes, part n
r763 m_values.removeAt(i);
Marek Rosa
Removing data from BarSeries through model added
r663 }
sauimone
Documentation for bar charts
r313 /*!
Returns count of values in set.
*/
sauimone
const to getters, renamed addBarset to appendBarset
r776 int QBarSet::count() const
sauimone
Barset and barcategory implememtation. Updated test application
r171 {
sauimone
minor code review fixes, part n
r763 return m_values.count();
sauimone
Barset and barcategory implememtation. Updated test application
r171 }
sauimone
Documentation for bar charts
r313 /*!
Returns value of set indexed by \a index
*/
sauimone
const to getters, renamed addBarset to appendBarset
r776 qreal QBarSet::valueAt(int index) const
sauimone
Barset and barcategory implememtation. Updated test application
r171 {
sauimone
minor code review fixes, part n
r763 return m_values.at(index);
sauimone
Barset and barcategory implememtation. Updated test application
r171 }
sauimone
Documentation for bar charts
r313 /*!
Sets a new value \a value to set, indexed by \a index
*/
sauimone
brush support for bargroups
r183 void QBarSet::setValue(int index, qreal value)
{
sauimone
minor code review fixes, part n
r763 m_values.replace(index,value);
Marek Rosa
Barchart updates on BarSet->SetValue now
r655 emit valueChanged();
sauimone
brush support for bargroups
r183 }
sauimone
fixed example paths in barchart documentation
r492 /*!
Returns total sum of all values in barset.
*/
sauimone
const to getters, renamed addBarset to appendBarset
r776 qreal QBarSet::total() const
sauimone
updating drilldown example. Needs some more thinking
r438 {
qreal total(0);
sauimone
minor code review fixes, part n
r763 for (int i=0; i < m_values.count(); i++) {
total += m_values.at(i);
sauimone
updating drilldown example. Needs some more thinking
r438 }
return total;
}
sauimone
Documentation for bar charts
r313 /*!
Sets pen for set. Bars of this set are drawn using \a pen
*/
sauimone
minor code review fixes, part n
r763 void QBarSet::setPen(const QPen &pen)
sauimone
Added pen & brush to QBarSet
r214 {
sauimone
minor code review fixes, part n
r763 m_pen = pen;
Marek Rosa
Barchart updates on BarSet->SetValue now
r655 emit valueChanged();
sauimone
Added pen & brush to QBarSet
r214 }
sauimone
Documentation for bar charts
r313 /*!
Returns pen of the set.
*/
sauimone
Fixed layout for barcharts
r473 QPen QBarSet::pen() const
sauimone
Added pen & brush to QBarSet
r214 {
sauimone
minor code review fixes, part n
r763 return m_pen;
sauimone
Added pen & brush to QBarSet
r214 }
sauimone
Documentation for bar charts
r313 /*!
Sets brush for the set. Bars of this set are drawn using \a brush
*/
sauimone
minor code review fixes, part n
r763 void QBarSet::setBrush(const QBrush &brush)
sauimone
Added pen & brush to QBarSet
r214 {
sauimone
minor code review fixes, part n
r763 m_brush = brush;
Marek Rosa
Barchart updates on BarSet->SetValue now
r655 emit valueChanged();
sauimone
Added pen & brush to QBarSet
r214 }
sauimone
Documentation for bar charts
r313 /*!
Returns brush of the set.
*/
sauimone
Fixed layout for barcharts
r473 QBrush QBarSet::brush() const
sauimone
Added pen & brush to QBarSet
r214 {
sauimone
minor code review fixes, part n
r763 return m_brush;
sauimone
Added pen & brush to QBarSet
r214 }
sauimone
better use of gradients in barcharts
r512 /*!
Sets the pen for floating values that are drawn on top of this set
*/
sauimone
minor code review fixes, part n
r763 void QBarSet::setFloatingValuePen(const QPen &pen)
sauimone
better use of gradients in barcharts
r512 {
sauimone
minor code review fixes, part n
r763 m_floatingValuePen = pen;
sauimone
better use of gradients in barcharts
r512 }
/*!
Returns the pen for floating values that are drawn on top of this set
*/
QPen QBarSet::floatingValuePen() const
{
sauimone
minor code review fixes, part n
r763 return m_floatingValuePen;
sauimone
better use of gradients in barcharts
r512 }
sauimone
Documentation for bar charts
r313 /*!
sauimone
Updated barchart documentation
r319 \internal \a pos
sauimone
Documentation for bar charts
r313 */
sauimone
right click feature for bar series. Enables drilldown
r412 void QBarSet::barHoverEnterEvent(QPoint pos)
sauimone
updated barchart examples. minor fixes
r276 {
sauimone
minor code review fixes, part n
r763 emit showToolTip(pos, m_name);
sauimone
moved tooltip to presenter
r288 emit hoverEnter(pos);
sauimone
updated barchart examples. minor fixes
r276 }
sauimone
Documentation for bar charts
r313 /*!
sauimone
Updated barchart documentation
r319 \internal
sauimone
Documentation for bar charts
r313 */
sauimone
right click feature for bar series. Enables drilldown
r412 void QBarSet::barHoverLeaveEvent()
sauimone
updated barchart examples. minor fixes
r276 {
sauimone
moved tooltip to presenter
r288 // Emit signal to user of charts
emit hoverLeave();
sauimone
updated barchart examples. minor fixes
r276 }
sauimone
signals and slots for bars and sets
r239 #include "moc_qbarset.cpp"
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737
sauimone
proof of concept implementation for barset and barcategory
r169 QTCOMMERCIALCHART_END_NAMESPACE