##// END OF EJS Templates
Add possibility to set reverse values to axes...
Add possibility to set reverse values to axes Added support for reverse axis. This works with line, spline, scatter and area series with cartesian chart. QBarCategoryAxis is not supported, nor different bar series. Change-Id: I60f21372ea9cee7b49918d7d99de24671bdc42c3 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>

File last commit:

r2776:bc1f6aa59d42
r2781:7c9f8e5a27d8
Show More
qpielegendmarker.cpp
142 lines | 3.6 KiB | text/x-c | CppLexer
/ src / charts / legend / qpielegendmarker.cpp
sauimone
new legend example for testing new api. Currently using still the old one.
r2162 /****************************************************************************
**
Titta Heikkala
Copyright header changes...
r2776 ** Copyright (C) 2015 The Qt Company Ltd
sauimone
new legend example for testing new api. Currently using still the old one.
r2162 ** All rights reserved.
Titta Heikkala
Copyright header changes...
r2776 ** For any questions to The Qt Company, please use contact form at http://qt.io
sauimone
new legend example for testing new api. Currently using still the old one.
r2162 **
Titta Heikkala
Updated license headers...
r2740 ** This file is part of the Qt Charts module.
sauimone
new legend example for testing new api. Currently using still the old one.
r2162 **
Titta Heikkala
Updated license headers...
r2740 ** Licensees holding valid commercial license for Qt may use this file in
** accordance with the Qt License Agreement provided with the Software
** or, alternatively, in accordance with the terms contained in a written
Titta Heikkala
Copyright header changes...
r2776 ** agreement between you and The Qt Company.
sauimone
new legend example for testing new api. Currently using still the old one.
r2162 **
** If you have questions regarding the use of this file, please use
Titta Heikkala
Updated license headers...
r2740 ** contact form at http://qt.io
sauimone
new legend example for testing new api. Currently using still the old one.
r2162 **
****************************************************************************/
Titta Heikkala
Fix include syntax...
r2714 #include <QtCharts/QPieLegendMarker>
#include <private/qpielegendmarker_p.h>
#include <QtCharts/QPieSeries>
#include <QtCharts/QPieSlice>
sauimone
new legend example for testing new api. Currently using still the old one.
r2162
Titta Heikkala
Qt Charts project file structure change...
r2712 QT_CHARTS_BEGIN_NAMESPACE
sauimone
layout work started
r2168
sauimone
documentation of legendmarkers
r2216 /*!
\class QPieLegendMarker
Titta Heikkala
Fix Charts documentation...
r2639 \inmodule Qt Charts
Titta Heikkala
Qt Charts project file structure change...
r2712 \brief QLegendMarker subclass for pie series.
sauimone
documentation of legendmarkers
r2216 \mainclass
QPieLegendMarker is related to QPieSeries. With QPieSeries, each slice of pie is related to one marker in QLegend.
Titta Heikkala
Fix Charts documentation...
r2639 \sa QLegend, QPieSeries, QPieSlice
sauimone
documentation of legendmarkers
r2216 */
/*!
\fn virtual LegendMarkerType QPieLegendMarker::type()
Returns QLegendMarker::LegendMarkerTypePie
*/
/*!
Tero Ahola
Fixed several documentation issues
r2265 \internal
sauimone
documentation of legendmarkers
r2216 */
sauimone
optional series parameter to markers function. code style fixes
r2193 QPieLegendMarker::QPieLegendMarker(QPieSeries *series, QPieSlice *slice, QLegend *legend, QObject *parent) :
sauimone
removing old commented code. removing domain parameter from handleseriesadded of pimpl. adding QLegend parameter to marker construction
r2171 QLegendMarker(*new QPieLegendMarkerPrivate(this,series,slice,legend), parent)
sauimone
new legend example for testing new api. Currently using still the old one.
r2162 {
sauimone
fixed crash in legendmarker when calling update from private constructor
r2227 d_ptr->updated();
sauimone
new legend example for testing new api. Currently using still the old one.
r2162 }
sauimone
documentation of legendmarkers
r2216 /*!
Destructor
*/
sauimone
layout work started
r2168 QPieLegendMarker::~QPieLegendMarker()
sauimone
refactoring
r2167 {
}
/*!
\internal
*/
QPieLegendMarker::QPieLegendMarker(QPieLegendMarkerPrivate &d, QObject *parent) :
QLegendMarker(d, parent)
sauimone
added LegendMarkerItem. Updated new legend example to test clicked of LegendMarker
r2164 {
}
sauimone
documentation of legendmarkers
r2216 /*!
Returns the related series of marker.
*/
sauimone
tidying up legend marker code. Added QBarLegendMarker
r2174 QPieSeries* QPieLegendMarker::series()
sauimone
Added createLegendMarkers to private series. This will replace old createLegendMarker method. Notice the s in new method name. PIMPL for QLegendMarker. Newlegend example updated a bit
r2163 {
sauimone
refactoring
r2167 Q_D(QPieLegendMarker);
return d->m_series;
}
sauimone
documentation of legendmarkers
r2216 /*!
Returns the related slice of marker.
*/
sauimone
removed peer object solution. Introduced marker type solution
r2179 QPieSlice* QPieLegendMarker::slice()
sauimone
refactoring
r2167 {
Q_D(QPieLegendMarker);
return d->m_slice;
sauimone
Added createLegendMarkers to private series. This will replace old createLegendMarker method. Notice the s in new method name. PIMPL for QLegendMarker. Newlegend example updated a bit
r2163 }
sauimone
new legend example for testing new api. Currently using still the old one.
r2162
sauimone
QPieLegenmarkerPrivate added
r2166 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
sauimone
removing old commented code. removing domain parameter from handleseriesadded of pimpl. adding QLegend parameter to marker construction
r2171 QPieLegendMarkerPrivate::QPieLegendMarkerPrivate(QPieLegendMarker *q, QPieSeries *series, QPieSlice *slice, QLegend *legend) :
QLegendMarkerPrivate(q,legend),
sauimone
fixed crash in legendmarker when calling update from private constructor
r2227 q_ptr(q),
sauimone
refactoring
r2167 m_series(series),
m_slice(slice)
sauimone
QPieLegenmarkerPrivate added
r2166 {
sauimone
layout work started
r2168 QObject::connect(m_slice, SIGNAL(labelChanged()), this, SLOT(updated()));
QObject::connect(m_slice, SIGNAL(brushChanged()), this, SLOT(updated()));
sauimone
tidying up legend marker code. Added QBarLegendMarker
r2174 QObject::connect(m_slice, SIGNAL(penChanged()), this, SLOT(updated()));
sauimone
QPieLegenmarkerPrivate added
r2166 }
QPieLegendMarkerPrivate::~QPieLegendMarkerPrivate()
{
}
sauimone
Better handling for new or removed markers
r2182 QPieSeries* QPieLegendMarkerPrivate::series()
{
return m_series;
}
QObject* QPieLegendMarkerPrivate::relatedObject()
{
return m_slice;
}
sauimone
refactoring
r2167 void QPieLegendMarkerPrivate::updated()
{
sauimone
signals for properties in legendmarker
r2225 bool labelChanged = false;
bool brushChanged = false;
bool penChanged = false;
Mika Salmela
Fix for not overriding user settings for legend markers....
r2429 if (!m_customPen && (m_item->pen() != m_slice->pen())) {
sauimone
signals for properties in legendmarker
r2225 m_item->setPen(m_slice->pen());
penChanged = true;
}
Mika Salmela
Fix for not overriding user settings for legend markers....
r2429 if (!m_customBrush && (m_item->brush() != m_slice->brush())) {
sauimone
signals for properties in legendmarker
r2225 m_item->setBrush(m_slice->brush());
brushChanged = true;
}
Mika Salmela
Fix for not overriding user settings for legend markers....
r2429 if (!m_customLabel && (m_item->label() != m_slice->label())) {
sauimone
signals for properties in legendmarker
r2225 m_item->setLabel(m_slice->label());
labelChanged = true;
}
sauimone
fix to QTRD-1674: layout is not calculated correctly after the change in the text of legend marker
r2194 invalidateLegend();
sauimone
signals for properties in legendmarker
r2225
if (labelChanged)
emit q_ptr->labelChanged();
if (brushChanged)
emit q_ptr->brushChanged();
if (penChanged)
emit q_ptr->penChanged();
sauimone
refactoring
r2167 }
sauimone
new legend example for testing new api. Currently using still the old one.
r2162 #include "moc_qpielegendmarker.cpp"
sauimone
QPieLegenmarkerPrivate added
r2166 #include "moc_qpielegendmarker_p.cpp"
sauimone
new legend example for testing new api. Currently using still the old one.
r2162
Titta Heikkala
Qt Charts project file structure change...
r2712 QT_CHARTS_END_NAMESPACE