##// END OF EJS Templates
Enabled building of qml auto test module on OSX
Enabled building of qml auto test module on OSX

File last commit:

r2194:659ade794246
r2211:7a0ee9611522
Show More
qpielegendmarker.cpp
95 lines | 2.5 KiB | text/x-c | CppLexer
/ src / legend / qpielegendmarker.cpp
sauimone
new legend example for testing new api. Currently using still the old one.
r2162 /****************************************************************************
**
** 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$
**
****************************************************************************/
#include "qpielegendmarker.h"
sauimone
QPieLegenmarkerPrivate added
r2166 #include "qpielegendmarker_p.h"
sauimone
new legend example for testing new api. Currently using still the old one.
r2162 #include <QPieSeries>
sauimone
tidying up legend marker code. Added QBarLegendMarker
r2174 #include <QPieSlice>
sauimone
new legend example for testing new api. Currently using still the old one.
r2162
QTCOMMERCIALCHART_BEGIN_NAMESPACE
sauimone
layout work started
r2168
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
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
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
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
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
refactoring
r2167 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
layout work started
r2168 m_item->setPen(m_slice->pen());
m_item->setBrush(m_slice->brush());
sauimone
tidying up legend marker code. Added QBarLegendMarker
r2174 m_item->setLabel(m_slice->label());
sauimone
fix to QTRD-1674: layout is not calculated correctly after the change in the text of legend marker
r2194 invalidateLegend();
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
QTCOMMERCIALCHART_END_NAMESPACE