qpiemodelmapper_p.h
102 lines
| 2.8 KiB
| text/x-c
|
CLexer
|
r2845 | /****************************************************************************** | ||
|
r1309 | ** | ||
|
r2845 | ** Copyright (C) 2015 The Qt Company Ltd. | ||
** Contact: http://www.qt.io/licensing/ | ||||
|
r1309 | ** | ||
|
r2740 | ** This file is part of the Qt Charts module. | ||
|
r1309 | ** | ||
|
r2845 | ** $QT_BEGIN_LICENSE:COMM$ | ||
|
r1309 | ** | ||
|
r2845 | ** Commercial License Usage | ||
** Licensees holding valid commercial Qt licenses may use this file in | ||||
** accordance with the commercial license agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and The Qt Company. For licensing terms | ||||
** and conditions see http://www.qt.io/terms-conditions. For further | ||||
** information use the contact form at http://www.qt.io/contact-us. | ||||
|
r1309 | ** | ||
|
r2845 | ** $QT_END_LICENSE$ | ||
** | ||||
******************************************************************************/ | ||||
|
r1309 | |||
// W A R N I N G | ||||
// ------------- | ||||
// | ||||
|
r2807 | // This file is not part of the Qt Chart API. It exists purely as an | ||
|
r1309 | // implementation detail. This header file may change from version to | ||
// version without notice, or even be removed. | ||||
// | ||||
// We mean it. | ||||
|
r1229 | #ifndef QPIEMODELMAPPER_P_H | ||
#define QPIEMODELMAPPER_P_H | ||||
|
r2714 | #include <QtCore/QObject> | ||
#include <QtCharts/QPieModelMapper> | ||||
|
r1229 | |||
|
r2774 | QT_BEGIN_NAMESPACE | ||
|
r1229 | class QModelIndex; | ||
|
r2774 | QT_END_NAMESPACE | ||
|
r1229 | |||
|
r2712 | QT_CHARTS_BEGIN_NAMESPACE | ||
|
r1229 | |||
|
r1230 | class QPieSlice; | ||
|
r1229 | |||
class QPieModelMapperPrivate : public QObject | ||||
{ | ||||
Q_OBJECT | ||||
public: | ||||
|
r1668 | explicit QPieModelMapperPrivate(QPieModelMapper *q); | ||
|
r1229 | |||
public Q_SLOTS: | ||||
// for the model | ||||
void modelUpdated(QModelIndex topLeft, QModelIndex bottomRight); | ||||
|
r1230 | void modelRowsAdded(QModelIndex parent, int start, int end); | ||
void modelRowsRemoved(QModelIndex parent, int start, int end); | ||||
void modelColumnsAdded(QModelIndex parent, int start, int end); | ||||
void modelColumnsRemoved(QModelIndex parent, int start, int end); | ||||
|
r1656 | void handleModelDestroyed(); | ||
|
r1229 | |||
// for the series | ||||
|
r2104 | void slicesAdded(QList<QPieSlice *> slices); | ||
void slicesRemoved(QList<QPieSlice *> slices); | ||||
|
r1236 | void sliceLabelChanged(); | ||
void sliceValueChanged(); | ||||
|
r1656 | void handleSeriesDestroyed(); | ||
|
r1229 | |||
|
r1230 | void initializePieFromModel(); | ||
|
r1229 | |||
private: | ||||
|
r2104 | QPieSlice *pieSlice(QModelIndex index) const; | ||
|
r1251 | bool isLabelIndex(QModelIndex index) const; | ||
bool isValueIndex(QModelIndex index) const; | ||||
|
r1230 | QModelIndex valueModelIndex(int slicePos); | ||
QModelIndex labelModelIndex(int slicePos); | ||||
void insertData(int start, int end); | ||||
void removeData(int start, int end); | ||||
|
r1229 | |||
|
r1231 | void blockModelSignals(bool block = true); | ||
void blockSeriesSignals(bool block = true); | ||||
|
r1229 | private: | ||
|
r1230 | QPieSeries *m_series; | ||
|
r2104 | QList<QPieSlice *> m_slices; | ||
|
r1230 | QAbstractItemModel *m_model; | ||
|
r1229 | int m_first; | ||
int m_count; | ||||
Qt::Orientation m_orientation; | ||||
|
r1320 | int m_valuesSection; | ||
int m_labelsSection; | ||||
|
r1249 | bool m_seriesSignalsBlock; | ||
bool m_modelSignalsBlock; | ||||
|
r1229 | |||
private: | ||||
|
r1230 | |||
|
r1229 | QPieModelMapper *q_ptr; | ||
Q_DECLARE_PUBLIC(QPieModelMapper) | ||||
}; | ||||
|
r2712 | QT_CHARTS_END_NAMESPACE | ||
|
r1229 | |||
#endif // QPIEMODELMAPPER_P_H | ||||