@@ -44,7 +44,6 ChartView { | |||||
44 | titleText: "EUR" |
|
44 | titleText: "EUR" | |
45 | min: 0 |
|
45 | min: 0 | |
46 | max: 40000 |
|
46 | max: 40000 | |
47 | niceNumbersEnabled: true |
|
|||
48 | labelFormat: "%.0f" |
|
47 | labelFormat: "%.0f" | |
49 | tickCount: 5 |
|
48 | tickCount: 5 | |
50 | } |
|
49 | } | |
@@ -70,6 +69,7 ChartView { | |||||
70 | } |
|
69 | } | |
71 | chartViewHighlighted.title = selectedSeries.name; |
|
70 | chartViewHighlighted.title = selectedSeries.name; | |
72 | axisY.max = maxVal; |
|
71 | axisY.max = maxVal; | |
|
72 | axisY.applyNiceNumbers() | |||
73 | } |
|
73 | } | |
74 | } |
|
74 | } | |
75 |
|
75 |
@@ -80,7 +80,6 void ChartAxisElement::connectSlots() | |||||
80 | QObject::connect(axis(), SIGNAL(shadesVisibleChanged(bool)), this, SLOT(handleShadesVisibleChanged(bool))); |
|
80 | QObject::connect(axis(), SIGNAL(shadesVisibleChanged(bool)), this, SLOT(handleShadesVisibleChanged(bool))); | |
81 | QObject::connect(axis(), SIGNAL(labelsAngleChanged(int)), this, SLOT(handleLabelsAngleChanged(int))); |
|
81 | QObject::connect(axis(), SIGNAL(labelsAngleChanged(int)), this, SLOT(handleLabelsAngleChanged(int))); | |
82 | QObject::connect(axis(), SIGNAL(linePenChanged(const QPen&)), this, SLOT(handleArrowPenChanged(const QPen&))); |
|
82 | QObject::connect(axis(), SIGNAL(linePenChanged(const QPen&)), this, SLOT(handleArrowPenChanged(const QPen&))); | |
83 | QObject::connect(axis(), SIGNAL(labelsPenChanged(const QPen&)), this, SLOT(handleLabelsPenChanged(const QPen&))); |
|
|||
84 | QObject::connect(axis(), SIGNAL(labelsBrushChanged(const QBrush&)), this, SLOT(handleLabelsBrushChanged(const QBrush&))); |
|
83 | QObject::connect(axis(), SIGNAL(labelsBrushChanged(const QBrush&)), this, SLOT(handleLabelsBrushChanged(const QBrush&))); | |
85 | QObject::connect(axis(), SIGNAL(labelsFontChanged(const QFont&)), this, SLOT(handleLabelsFontChanged(const QFont&))); |
|
84 | QObject::connect(axis(), SIGNAL(labelsFontChanged(const QFont&)), this, SLOT(handleLabelsFontChanged(const QFont&))); | |
86 | QObject::connect(axis(), SIGNAL(gridLinePenChanged(const QPen&)), this, SLOT(handleGridPenChanged(const QPen&))); |
|
85 | QObject::connect(axis(), SIGNAL(gridLinePenChanged(const QPen&)), this, SLOT(handleGridPenChanged(const QPen&))); | |
@@ -88,7 +87,6 void ChartAxisElement::connectSlots() | |||||
88 | QObject::connect(axis(), SIGNAL(shadesBrushChanged(const QBrush&)), this, SLOT(handleShadesBrushChanged(const QBrush&))); |
|
87 | QObject::connect(axis(), SIGNAL(shadesBrushChanged(const QBrush&)), this, SLOT(handleShadesBrushChanged(const QBrush&))); | |
89 | QObject::connect(axis(), SIGNAL(titleTextChanged(const QString&)), this, SLOT(handleTitleTextChanged(const QString&))); |
|
88 | QObject::connect(axis(), SIGNAL(titleTextChanged(const QString&)), this, SLOT(handleTitleTextChanged(const QString&))); | |
90 | QObject::connect(axis(), SIGNAL(titleFontChanged(const QFont&)), this, SLOT(handleTitleFontChanged(const QFont&))); |
|
89 | QObject::connect(axis(), SIGNAL(titleFontChanged(const QFont&)), this, SLOT(handleTitleFontChanged(const QFont&))); | |
91 | QObject::connect(axis(), SIGNAL(titlePenChanged(const QPen&)), this, SLOT(handleTitlePenChanged(const QPen&))); |
|
|||
92 | QObject::connect(axis(), SIGNAL(titleBrushChanged(const QBrush&)), this, SLOT(handleTitleBrushChanged(const QBrush&))); |
|
90 | QObject::connect(axis(), SIGNAL(titleBrushChanged(const QBrush&)), this, SLOT(handleTitleBrushChanged(const QBrush&))); | |
93 | QObject::connect(axis(), SIGNAL(titleVisibleChanged(bool)), this, SLOT(handleTitleVisibleChanged(bool))); |
|
91 | QObject::connect(axis(), SIGNAL(titleVisibleChanged(bool)), this, SLOT(handleTitleVisibleChanged(bool))); | |
94 | QObject::connect(axis()->d_ptr.data(), SIGNAL(rangeChanged(qreal, qreal)), this, SLOT(handleRangeChanged(qreal, qreal))); |
|
92 | QObject::connect(axis()->d_ptr.data(), SIGNAL(rangeChanged(qreal, qreal)), this, SLOT(handleRangeChanged(qreal, qreal))); | |
@@ -132,11 +130,6 void ChartAxisElement::handleLabelsAngleChanged(int angle) | |||||
132 | presenter()->layout()->invalidate(); |
|
130 | presenter()->layout()->invalidate(); | |
133 | } |
|
131 | } | |
134 |
|
132 | |||
135 | void ChartAxisElement::handleLabelsPenChanged(const QPen &pen) |
|
|||
136 | { |
|
|||
137 | Q_UNUSED(pen) |
|
|||
138 | } |
|
|||
139 |
|
||||
140 | void ChartAxisElement::handleLabelsBrushChanged(const QBrush &brush) |
|
133 | void ChartAxisElement::handleLabelsBrushChanged(const QBrush &brush) | |
141 | { |
|
134 | { | |
142 | foreach (QGraphicsItem *item, m_labels->childItems()) |
|
135 | foreach (QGraphicsItem *item, m_labels->childItems()) | |
@@ -159,11 +152,6 void ChartAxisElement::handleTitleTextChanged(const QString &title) | |||||
159 | m_title->setHtml(title); |
|
152 | m_title->setHtml(title); | |
160 | } |
|
153 | } | |
161 |
|
154 | |||
162 | void ChartAxisElement::handleTitlePenChanged(const QPen &pen) |
|
|||
163 | { |
|
|||
164 | Q_UNUSED(pen) |
|
|||
165 | } |
|
|||
166 |
|
||||
167 | void ChartAxisElement::handleTitleBrushChanged(const QBrush &brush) |
|
155 | void ChartAxisElement::handleTitleBrushChanged(const QBrush &brush) | |
168 | { |
|
156 | { | |
169 | m_title->setDefaultTextColor(brush.color()); |
|
157 | m_title->setDefaultTextColor(brush.color()); |
@@ -116,10 +116,8 public Q_SLOTS: | |||||
116 | virtual void handleShadesPenChanged(const QPen &pen) = 0; |
|
116 | virtual void handleShadesPenChanged(const QPen &pen) = 0; | |
117 | virtual void handleArrowPenChanged(const QPen &pen) = 0; |
|
117 | virtual void handleArrowPenChanged(const QPen &pen) = 0; | |
118 | virtual void handleGridPenChanged(const QPen &pen) = 0; |
|
118 | virtual void handleGridPenChanged(const QPen &pen) = 0; | |
119 | void handleLabelsPenChanged(const QPen &pen); |
|
|||
120 | void handleLabelsBrushChanged(const QBrush &brush); |
|
119 | void handleLabelsBrushChanged(const QBrush &brush); | |
121 | void handleLabelsFontChanged(const QFont &font); |
|
120 | void handleLabelsFontChanged(const QFont &font); | |
122 | void handleTitlePenChanged(const QPen &pen); |
|
|||
123 | void handleTitleBrushChanged(const QBrush &brush); |
|
121 | void handleTitleBrushChanged(const QBrush &brush); | |
124 | void handleTitleFontChanged(const QFont &font); |
|
122 | void handleTitleFontChanged(const QFont &font); | |
125 | void handleTitleTextChanged(const QString &title); |
|
123 | void handleTitleTextChanged(const QString &title); |
@@ -92,12 +92,6 QT_CHARTS_BEGIN_NAMESPACE | |||||
92 | */ |
|
92 | */ | |
93 |
|
93 | |||
94 | /*! |
|
94 | /*! | |
95 | \property QAbstractAxis::labelsPen |
|
|||
96 | \deprecated |
|
|||
97 | The pen of the labels. |
|
|||
98 | */ |
|
|||
99 |
|
||||
100 | /*! |
|
|||
101 | \property QAbstractAxis::labelsBrush |
|
95 | \property QAbstractAxis::labelsBrush | |
102 | The brush of the labels. Only the color of the brush is relevant. |
|
96 | The brush of the labels. Only the color of the brush is relevant. | |
103 | */ |
|
97 | */ | |
@@ -220,12 +214,6 QT_CHARTS_BEGIN_NAMESPACE | |||||
220 | */ |
|
214 | */ | |
221 |
|
215 | |||
222 | /*! |
|
216 | /*! | |
223 | \property QAbstractAxis::titlePen |
|
|||
224 | \deprecated |
|
|||
225 | The pen of the title text. |
|
|||
226 | */ |
|
|||
227 |
|
||||
228 | /*! |
|
|||
229 | \property QAbstractAxis::titleBrush |
|
217 | \property QAbstractAxis::titleBrush | |
230 | The brush of the title text. Only the color of the brush is relevant. |
|
218 | The brush of the title text. Only the color of the brush is relevant. | |
231 | */ |
|
219 | */ | |
@@ -299,12 +287,6 QT_CHARTS_BEGIN_NAMESPACE | |||||
299 | */ |
|
287 | */ | |
300 |
|
288 | |||
301 | /*! |
|
289 | /*! | |
302 | \fn void QAbstractAxis::labelsPenChanged(const QPen& pen) |
|
|||
303 | \deprecated |
|
|||
304 | The pen of the axis labels has changed to \a pen. |
|
|||
305 | */ |
|
|||
306 |
|
||||
307 | /*! |
|
|||
308 | \fn void QAbstractAxis::labelsBrushChanged(const QBrush& brush) |
|
290 | \fn void QAbstractAxis::labelsBrushChanged(const QBrush& brush) | |
309 | The brush of the axis labels has changed to \a brush. |
|
291 | The brush of the axis labels has changed to \a brush. | |
310 | */ |
|
292 | */ | |
@@ -369,12 +351,6 QT_CHARTS_BEGIN_NAMESPACE | |||||
369 | */ |
|
351 | */ | |
370 |
|
352 | |||
371 | /*! |
|
353 | /*! | |
372 | \fn void QAbstractAxis::titlePenChanged(const QPen& pen) |
|
|||
373 | \deprecated |
|
|||
374 | The pen of the axis shades has changed to \a pen. |
|
|||
375 | */ |
|
|||
376 |
|
||||
377 | /*! |
|
|||
378 | \fn void QAbstractAxis::titleBrushChanged(const QBrush& brush) |
|
354 | \fn void QAbstractAxis::titleBrushChanged(const QBrush& brush) | |
379 | The brush of the axis title has changed to \a brush. |
|
355 | The brush of the axis title has changed to \a brush. | |
380 | */ |
|
356 | */ | |
@@ -548,22 +524,6 bool QAbstractAxis::labelsVisible() const | |||||
548 | return d_ptr->m_labelsVisible; |
|
524 | return d_ptr->m_labelsVisible; | |
549 | } |
|
525 | } | |
550 |
|
526 | |||
551 | void QAbstractAxis::setLabelsPen(const QPen &pen) |
|
|||
552 | { |
|
|||
553 | if (d_ptr->m_labelsPen != pen) { |
|
|||
554 | d_ptr->m_labelsPen = pen; |
|
|||
555 | emit labelsPenChanged(pen); |
|
|||
556 | } |
|
|||
557 | } |
|
|||
558 |
|
||||
559 | QPen QAbstractAxis::labelsPen() const |
|
|||
560 | { |
|
|||
561 | if (d_ptr->m_labelsPen == QChartPrivate::defaultPen()) |
|
|||
562 | return QPen(); |
|
|||
563 | else |
|
|||
564 | return d_ptr->m_labelsPen; |
|
|||
565 | } |
|
|||
566 |
|
||||
567 | /*! |
|
527 | /*! | |
568 | Sets \a brush used to draw labels. |
|
528 | Sets \a brush used to draw labels. | |
569 | */ |
|
529 | */ | |
@@ -648,22 +608,6 bool QAbstractAxis::isTitleVisible() const | |||||
648 | return d_ptr->m_titleVisible; |
|
608 | return d_ptr->m_titleVisible; | |
649 | } |
|
609 | } | |
650 |
|
610 | |||
651 | void QAbstractAxis::setTitlePen(const QPen &pen) |
|
|||
652 | { |
|
|||
653 | if (d_ptr->m_titlePen != pen) { |
|
|||
654 | d_ptr->m_titlePen = pen; |
|
|||
655 | emit titlePenChanged(pen); |
|
|||
656 | } |
|
|||
657 | } |
|
|||
658 |
|
||||
659 | QPen QAbstractAxis::titlePen() const |
|
|||
660 | { |
|
|||
661 | if (d_ptr->m_titlePen == QChartPrivate::defaultPen()) |
|
|||
662 | return QPen(); |
|
|||
663 | else |
|
|||
664 | return d_ptr->m_titlePen; |
|
|||
665 | } |
|
|||
666 |
|
||||
667 | /*! |
|
611 | /*! | |
668 | Sets \a brush used to draw title. |
|
612 | Sets \a brush used to draw title. | |
669 | */ |
|
613 | */ | |
@@ -877,7 +821,7 void QAbstractAxis::setRange(const QVariant &min, const QVariant &max) | |||||
877 | /*! |
|
821 | /*! | |
878 | Returns the orientation in which the axis is being used (Vertical or Horizontal) |
|
822 | Returns the orientation in which the axis is being used (Vertical or Horizontal) | |
879 | */ |
|
823 | */ | |
880 | Qt::Orientation QAbstractAxis::orientation() |
|
824 | Qt::Orientation QAbstractAxis::orientation() const | |
881 | { |
|
825 | { | |
882 | return d_ptr->orientation(); |
|
826 | return d_ptr->orientation(); | |
883 | } |
|
827 | } | |
@@ -901,12 +845,10 QAbstractAxisPrivate::QAbstractAxisPrivate(QAbstractAxis *q) | |||||
901 | m_gridLineVisible(true), |
|
845 | m_gridLineVisible(true), | |
902 | m_gridLinePen(QChartPrivate::defaultPen()), |
|
846 | m_gridLinePen(QChartPrivate::defaultPen()), | |
903 | m_labelsVisible(true), |
|
847 | m_labelsVisible(true), | |
904 | m_labelsPen(QChartPrivate::defaultPen()), |
|
|||
905 | m_labelsBrush(QChartPrivate::defaultBrush()), |
|
848 | m_labelsBrush(QChartPrivate::defaultBrush()), | |
906 | m_labelsFont(QChartPrivate::defaultFont()), |
|
849 | m_labelsFont(QChartPrivate::defaultFont()), | |
907 | m_labelsAngle(0), |
|
850 | m_labelsAngle(0), | |
908 | m_titleVisible(true), |
|
851 | m_titleVisible(true), | |
909 | m_titlePen(QChartPrivate::defaultPen()), |
|
|||
910 | m_titleBrush(QChartPrivate::defaultBrush()), |
|
852 | m_titleBrush(QChartPrivate::defaultBrush()), | |
911 | m_titleFont(QChartPrivate::defaultFont()), |
|
853 | m_titleFont(QChartPrivate::defaultFont()), | |
912 | m_shadesVisible(false), |
|
854 | m_shadesVisible(false), | |
@@ -949,15 +891,11 void QAbstractAxisPrivate::initializeTheme(ChartTheme* theme, bool forced) | |||||
949 |
|
891 | |||
950 | if (forced || QChartPrivate::defaultBrush() == m_labelsBrush) |
|
892 | if (forced || QChartPrivate::defaultBrush() == m_labelsBrush) | |
951 | q_ptr->setLabelsBrush(theme->labelBrush()); |
|
893 | q_ptr->setLabelsBrush(theme->labelBrush()); | |
952 | if (forced || QChartPrivate::defaultPen() == m_labelsPen) |
|
|||
953 | q_ptr->setLabelsPen(Qt::NoPen); // NoPen for performance reasons |
|
|||
954 | if (forced || QChartPrivate::defaultFont() == m_labelsFont) |
|
894 | if (forced || QChartPrivate::defaultFont() == m_labelsFont) | |
955 | q_ptr->setLabelsFont(theme->labelFont()); |
|
895 | q_ptr->setLabelsFont(theme->labelFont()); | |
956 |
|
896 | |||
957 | if (forced || QChartPrivate::defaultBrush() == m_titleBrush) |
|
897 | if (forced || QChartPrivate::defaultBrush() == m_titleBrush) | |
958 | q_ptr->setTitleBrush(theme->labelBrush()); |
|
898 | q_ptr->setTitleBrush(theme->labelBrush()); | |
959 | if (forced || QChartPrivate::defaultPen() == m_titlePen) |
|
|||
960 | q_ptr->setTitlePen(Qt::NoPen); // NoPen for performance reasons |
|
|||
961 | if (forced || QChartPrivate::defaultFont() == m_titleFont) { |
|
899 | if (forced || QChartPrivate::defaultFont() == m_titleFont) { | |
962 | QFont font(m_labelsFont); |
|
900 | QFont font(m_labelsFont); | |
963 | font.setBold(true); |
|
901 | font.setBold(true); |
@@ -39,7 +39,6 class QT_CHARTS_EXPORT QAbstractAxis : public QObject | |||||
39 | Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged) |
|
39 | Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged) | |
40 | //labels |
|
40 | //labels | |
41 | Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged) |
|
41 | Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged) | |
42 | Q_PROPERTY(QPen labelsPen READ labelsPen WRITE setLabelsPen NOTIFY labelsPenChanged) |
|
|||
43 | Q_PROPERTY(QBrush labelsBrush READ labelsBrush WRITE setLabelsBrush NOTIFY labelsBrushChanged) |
|
42 | Q_PROPERTY(QBrush labelsBrush READ labelsBrush WRITE setLabelsBrush NOTIFY labelsBrushChanged) | |
44 | Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged) |
|
43 | Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged) | |
45 | Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont NOTIFY labelsFontChanged) |
|
44 | Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont NOTIFY labelsFontChanged) | |
@@ -55,7 +54,6 class QT_CHARTS_EXPORT QAbstractAxis : public QObject | |||||
55 | Q_PROPERTY(QBrush shadesBrush READ shadesBrush WRITE setShadesBrush NOTIFY shadesBrushChanged) |
|
54 | Q_PROPERTY(QBrush shadesBrush READ shadesBrush WRITE setShadesBrush NOTIFY shadesBrushChanged) | |
56 | //title |
|
55 | //title | |
57 | Q_PROPERTY(QString titleText READ titleText WRITE setTitleText NOTIFY titleTextChanged) |
|
56 | Q_PROPERTY(QString titleText READ titleText WRITE setTitleText NOTIFY titleTextChanged) | |
58 | Q_PROPERTY(QPen titlePen READ titlePen WRITE setTitlePen NOTIFY titlePenChanged) |
|
|||
59 | Q_PROPERTY(QBrush titleBrush READ titleBrush WRITE setTitleBrush NOTIFY titleBrushChanged) |
|
57 | Q_PROPERTY(QBrush titleBrush READ titleBrush WRITE setTitleBrush NOTIFY titleBrushChanged) | |
60 | Q_PROPERTY(bool titleVisible READ isTitleVisible WRITE setTitleVisible NOTIFY titleVisibleChanged) |
|
58 | Q_PROPERTY(bool titleVisible READ isTitleVisible WRITE setTitleVisible NOTIFY titleVisibleChanged) | |
61 | Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont NOTIFY titleFontChanged) |
|
59 | Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont NOTIFY titleFontChanged) | |
@@ -108,8 +106,6 public: | |||||
108 | //labels handling |
|
106 | //labels handling | |
109 | bool labelsVisible() const; |
|
107 | bool labelsVisible() const; | |
110 | void setLabelsVisible(bool visible = true); |
|
108 | void setLabelsVisible(bool visible = true); | |
111 | void setLabelsPen(const QPen &pen); |
|
|||
112 | QPen labelsPen() const; |
|
|||
113 | void setLabelsBrush(const QBrush &brush); |
|
109 | void setLabelsBrush(const QBrush &brush); | |
114 | QBrush labelsBrush() const; |
|
110 | QBrush labelsBrush() const; | |
115 | void setLabelsFont(const QFont &font); |
|
111 | void setLabelsFont(const QFont &font); | |
@@ -122,8 +118,6 public: | |||||
122 | //title handling |
|
118 | //title handling | |
123 | bool isTitleVisible() const; |
|
119 | bool isTitleVisible() const; | |
124 | void setTitleVisible(bool visible = true); |
|
120 | void setTitleVisible(bool visible = true); | |
125 | void setTitlePen(const QPen &pen); |
|
|||
126 | QPen titlePen() const; |
|
|||
127 | void setTitleBrush(const QBrush &brush); |
|
121 | void setTitleBrush(const QBrush &brush); | |
128 | QBrush titleBrush() const; |
|
122 | QBrush titleBrush() const; | |
129 | void setTitleFont(const QFont &font); |
|
123 | void setTitleFont(const QFont &font); | |
@@ -143,7 +137,7 public: | |||||
143 | void setShadesBorderColor(QColor color); |
|
137 | void setShadesBorderColor(QColor color); | |
144 | QColor shadesBorderColor() const; |
|
138 | QColor shadesBorderColor() const; | |
145 |
|
139 | |||
146 | Qt::Orientation orientation(); |
|
140 | Qt::Orientation orientation() const; | |
147 | Qt::Alignment alignment() const; |
|
141 | Qt::Alignment alignment() const; | |
148 |
|
142 | |||
149 | //range handling |
|
143 | //range handling | |
@@ -156,7 +150,6 Q_SIGNALS: | |||||
156 | void linePenChanged(const QPen &pen); |
|
150 | void linePenChanged(const QPen &pen); | |
157 | void lineVisibleChanged(bool visible); |
|
151 | void lineVisibleChanged(bool visible); | |
158 | void labelsVisibleChanged(bool visible); |
|
152 | void labelsVisibleChanged(bool visible); | |
159 | void labelsPenChanged(const QPen &pen); |
|
|||
160 | void labelsBrushChanged(const QBrush &brush); |
|
153 | void labelsBrushChanged(const QBrush &brush); | |
161 | void labelsFontChanged(const QFont &pen); |
|
154 | void labelsFontChanged(const QFont &pen); | |
162 | void labelsAngleChanged(int angle); |
|
155 | void labelsAngleChanged(int angle); | |
@@ -165,7 +158,6 Q_SIGNALS: | |||||
165 | void colorChanged(QColor color); |
|
158 | void colorChanged(QColor color); | |
166 | void labelsColorChanged(QColor color); |
|
159 | void labelsColorChanged(QColor color); | |
167 | void titleTextChanged(const QString &title); |
|
160 | void titleTextChanged(const QString &title); | |
168 | void titlePenChanged(const QPen &pen); |
|
|||
169 | void titleBrushChanged(const QBrush &brush); |
|
161 | void titleBrushChanged(const QBrush &brush); | |
170 | void titleVisibleChanged(bool visible); |
|
162 | void titleVisibleChanged(bool visible); | |
171 | void titleFontChanged(const QFont &font); |
|
163 | void titleFontChanged(const QFont &font); |
@@ -100,13 +100,11 private: | |||||
100 | QPen m_gridLinePen; |
|
100 | QPen m_gridLinePen; | |
101 |
|
101 | |||
102 | bool m_labelsVisible; |
|
102 | bool m_labelsVisible; | |
103 | QPen m_labelsPen; |
|
|||
104 | QBrush m_labelsBrush; |
|
103 | QBrush m_labelsBrush; | |
105 | QFont m_labelsFont; |
|
104 | QFont m_labelsFont; | |
106 | int m_labelsAngle; |
|
105 | int m_labelsAngle; | |
107 |
|
106 | |||
108 | bool m_titleVisible; |
|
107 | bool m_titleVisible; | |
109 | QPen m_titlePen; |
|
|||
110 | QBrush m_titleBrush; |
|
108 | QBrush m_titleBrush; | |
111 | QFont m_titleFont; |
|
109 | QFont m_titleFont; | |
112 | QString m_title; |
|
110 | QString m_title; |
@@ -172,17 +172,6 QT_CHARTS_BEGIN_NAMESPACE | |||||
172 | */ |
|
172 | */ | |
173 |
|
173 | |||
174 | /*! |
|
174 | /*! | |
175 | \property QValueAxis::niceNumbersEnabled |
|
|||
176 | \obsolete |
|
|||
177 | Using this function can lead to unexpected behavior. Use applyNiceNumbers() instead. |
|
|||
178 | */ |
|
|||
179 |
|
||||
180 | /*! |
|
|||
181 | \qmlproperty bool ValueAxis::niceNumbersEnabled |
|
|||
182 | Deprecated; Using this function can lead to unexpected behavior. Use applyNiceNumbers() instead. |
|
|||
183 | */ |
|
|||
184 |
|
||||
185 | /*! |
|
|||
186 | Constructs an axis object which is a child of \a parent. |
|
175 | Constructs an axis object which is a child of \a parent. | |
187 | */ |
|
176 | */ | |
188 | QValueAxis::QValueAxis(QObject *parent) : |
|
177 | QValueAxis::QValueAxis(QObject *parent) : | |
@@ -259,31 +248,6 int QValueAxis::tickCount() const | |||||
259 | return d->m_tickCount; |
|
248 | return d->m_tickCount; | |
260 | } |
|
249 | } | |
261 |
|
250 | |||
262 | void QValueAxis::setNiceNumbersEnabled(bool enable) |
|
|||
263 | { |
|
|||
264 | Q_D(QValueAxis); |
|
|||
265 | qWarning() << "Deprecated; Using this function can lead to unexpected behavior. " \ |
|
|||
266 | "Use applyNiceNumbers() instead."; |
|
|||
267 | if(enable) { |
|
|||
268 | QObject::connect(this,SIGNAL(rangeChanged(qreal,qreal)),this,SLOT(applyNiceNumbers())); |
|
|||
269 | QObject::connect(this,SIGNAL(tickCountChanged(int)),this,SLOT(applyNiceNumbers())); |
|
|||
270 | applyNiceNumbers(); |
|
|||
271 | } |
|
|||
272 | else { |
|
|||
273 | QObject::disconnect(this,SIGNAL(rangeChanged(qreal,qreal)),this,SLOT(applyNiceNumbers())); |
|
|||
274 | QObject::disconnect(this,SIGNAL(tickCountChanged(int)),this,SLOT(applyNiceNumbers())); |
|
|||
275 | } |
|
|||
276 | d->m_niceNumbersEnabled=enable; |
|
|||
277 | } |
|
|||
278 |
|
||||
279 | bool QValueAxis::niceNumbersEnabled() const |
|
|||
280 | { |
|
|||
281 | Q_D(const QValueAxis); |
|
|||
282 | qWarning() << "Deprecated; Using this function can lead to unexpected behavior. " \ |
|
|||
283 | "Use applyNiceNumbers() instead."; |
|
|||
284 | return d->m_niceNumbersEnabled; |
|
|||
285 | } |
|
|||
286 |
|
||||
287 | void QValueAxis::setLabelFormat(const QString &format) |
|
251 | void QValueAxis::setLabelFormat(const QString &format) | |
288 | { |
|
252 | { | |
289 | Q_D(QValueAxis); |
|
253 | Q_D(QValueAxis); | |
@@ -333,8 +297,7 QValueAxisPrivate::QValueAxisPrivate(QValueAxis *q) | |||||
333 | m_max(0), |
|
297 | m_max(0), | |
334 | m_tickCount(5), |
|
298 | m_tickCount(5), | |
335 | m_format(QString::null), |
|
299 | m_format(QString::null), | |
336 |
m_applying(false) |
|
300 | m_applying(false) | |
337 | m_niceNumbersEnabled(false) |
|
|||
338 | { |
|
301 | { | |
339 |
|
302 | |||
340 | } |
|
303 | } |
@@ -29,7 +29,6 class QT_CHARTS_EXPORT QValueAxis : public QAbstractAxis | |||||
29 | { |
|
29 | { | |
30 | Q_OBJECT |
|
30 | Q_OBJECT | |
31 | Q_PROPERTY(int tickCount READ tickCount WRITE setTickCount NOTIFY tickCountChanged) |
|
31 | Q_PROPERTY(int tickCount READ tickCount WRITE setTickCount NOTIFY tickCountChanged) | |
32 | Q_PROPERTY(bool niceNumbersEnabled READ niceNumbersEnabled WRITE setNiceNumbersEnabled) |
|
|||
33 | Q_PROPERTY(qreal min READ min WRITE setMin NOTIFY minChanged) |
|
32 | Q_PROPERTY(qreal min READ min WRITE setMin NOTIFY minChanged) | |
34 | Q_PROPERTY(qreal max READ max WRITE setMax NOTIFY maxChanged) |
|
33 | Q_PROPERTY(qreal max READ max WRITE setMax NOTIFY maxChanged) | |
35 | Q_PROPERTY(QString labelFormat READ labelFormat WRITE setLabelFormat NOTIFY labelFormatChanged) |
|
34 | Q_PROPERTY(QString labelFormat READ labelFormat WRITE setLabelFormat NOTIFY labelFormatChanged) | |
@@ -58,9 +57,6 public: | |||||
58 | void setLabelFormat(const QString &format); |
|
57 | void setLabelFormat(const QString &format); | |
59 | QString labelFormat() const; |
|
58 | QString labelFormat() const; | |
60 |
|
59 | |||
61 | void setNiceNumbersEnabled(bool enable = true); |
|
|||
62 | bool niceNumbersEnabled() const; |
|
|||
63 |
|
||||
64 | public Q_SLOTS: |
|
60 | public Q_SLOTS: | |
65 | void applyNiceNumbers(); |
|
61 | void applyNiceNumbers(); | |
66 |
|
62 |
@@ -44,8 +44,8 public: | |||||
44 | void initializeGraphics(QGraphicsItem* parent); |
|
44 | void initializeGraphics(QGraphicsItem* parent); | |
45 | void initializeDomain(AbstractDomain *domain); |
|
45 | void initializeDomain(AbstractDomain *domain); | |
46 |
|
46 | |||
47 |
qreal min() { return m_min; } |
|
47 | qreal min() { return m_min; } | |
48 |
qreal max() { return m_max; } |
|
48 | qreal max() { return m_max; } | |
49 | void setRange(qreal min,qreal max); |
|
49 | void setRange(qreal min,qreal max); | |
50 |
|
50 | |||
51 | protected: |
|
51 | protected: | |
@@ -59,7 +59,6 private: | |||||
59 | int m_tickCount; |
|
59 | int m_tickCount; | |
60 | QString m_format; |
|
60 | QString m_format; | |
61 | bool m_applying; |
|
61 | bool m_applying; | |
62 | bool m_niceNumbersEnabled; |
|
|||
63 | Q_DECLARE_PUBLIC(QValueAxis) |
|
62 | Q_DECLARE_PUBLIC(QValueAxis) | |
64 | }; |
|
63 | }; | |
65 |
|
64 |
@@ -102,14 +102,6 QT_CHARTS_BEGIN_NAMESPACE | |||||
102 | */ |
|
102 | */ | |
103 |
|
103 | |||
104 | /*! |
|
104 | /*! | |
105 | \property QChart::minimumMargins |
|
|||
106 | Minimum margins between the plot area (axes) and the edge of the chart widget. |
|
|||
107 | This property is deprecated; use margins property instead. |
|
|||
108 |
|
||||
109 | \sa margins |
|
|||
110 | */ |
|
|||
111 |
|
||||
112 | /*! |
|
|||
113 | \property QChart::margins |
|
105 | \property QChart::margins | |
114 | Margins between the plot area (axes) and the edge of the chart widget. |
|
106 | Margins between the plot area (axes) and the edge of the chart widget. | |
115 | */ |
|
107 | */ | |
@@ -503,18 +495,6 QLegend *QChart::legend() const | |||||
503 | return d_ptr->m_legend; |
|
495 | return d_ptr->m_legend; | |
504 | } |
|
496 | } | |
505 |
|
497 | |||
506 | void QChart::setMinimumMargins(const QMargins &margins) |
|
|||
507 | { |
|
|||
508 | qWarning() << "QChart::setMinimumMargins is deprecated. Use QChart::setMargins instead."; |
|
|||
509 | d_ptr->m_presenter->layout()->setMargins(margins); |
|
|||
510 | } |
|
|||
511 |
|
||||
512 | QMargins QChart::minimumMargins() const |
|
|||
513 | { |
|
|||
514 | qWarning() << "QChart::minimumMargins is deprecated. Use QChart::margins instead."; |
|
|||
515 | return d_ptr->m_presenter->layout()->margins(); |
|
|||
516 | } |
|
|||
517 |
|
||||
518 | void QChart::setMargins(const QMargins &margins) |
|
498 | void QChart::setMargins(const QMargins &margins) | |
519 | { |
|
499 | { | |
520 | d_ptr->m_presenter->layout()->setMargins(margins); |
|
500 | d_ptr->m_presenter->layout()->setMargins(margins); |
@@ -43,7 +43,6 class QT_CHARTS_EXPORT QChart : public QGraphicsWidget | |||||
43 | Q_PROPERTY(bool dropShadowEnabled READ isDropShadowEnabled WRITE setDropShadowEnabled) |
|
43 | Q_PROPERTY(bool dropShadowEnabled READ isDropShadowEnabled WRITE setDropShadowEnabled) | |
44 | Q_PROPERTY(qreal backgroundRoundness READ backgroundRoundness WRITE setBackgroundRoundness) |
|
44 | Q_PROPERTY(qreal backgroundRoundness READ backgroundRoundness WRITE setBackgroundRoundness) | |
45 | Q_PROPERTY(QChart::AnimationOptions animationOptions READ animationOptions WRITE setAnimationOptions) |
|
45 | Q_PROPERTY(QChart::AnimationOptions animationOptions READ animationOptions WRITE setAnimationOptions) | |
46 | Q_PROPERTY(QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins) |
|
|||
47 | Q_PROPERTY(QMargins margins READ margins WRITE setMargins) |
|
46 | Q_PROPERTY(QMargins margins READ margins WRITE setMargins) | |
48 | Q_PROPERTY(QChart::ChartType chartType READ chartType) |
|
47 | Q_PROPERTY(QChart::ChartType chartType READ chartType) | |
49 | Q_PROPERTY(bool plotAreaBackgroundVisible READ isPlotAreaBackgroundVisible WRITE setPlotAreaBackgroundVisible) |
|
48 | Q_PROPERTY(bool plotAreaBackgroundVisible READ isPlotAreaBackgroundVisible WRITE setPlotAreaBackgroundVisible) | |
@@ -139,9 +138,6 public: | |||||
139 |
|
138 | |||
140 | QLegend *legend() const; |
|
139 | QLegend *legend() const; | |
141 |
|
140 | |||
142 | void setMinimumMargins(const QMargins& margins); |
|
|||
143 | QMargins minimumMargins() const; |
|
|||
144 |
|
||||
145 | void setMargins(const QMargins &margins); |
|
141 | void setMargins(const QMargins &margins); | |
146 | QMargins margins() const; |
|
142 | QMargins margins() const; | |
147 |
|
143 |
@@ -29,7 +29,7 | |||||
29 |
|
29 | |||
30 | \value NoRubberBand |
|
30 | \value NoRubberBand | |
31 | \value VerticalRubberBand |
|
31 | \value VerticalRubberBand | |
32 | \value HorizonalRubberBand |
|
32 | \value HorizontalRubberBand | |
33 | \value RectangleRubberBand |
|
33 | \value RectangleRubberBand | |
34 | */ |
|
34 | */ | |
35 |
|
35 | |||
@@ -170,7 +170,7 void QChartView::mouseMoveEvent(QMouseEvent *event) | |||||
170 | d_ptr->m_rubberBandOrigin.setY(rect.top()); |
|
170 | d_ptr->m_rubberBandOrigin.setY(rect.top()); | |
171 | height = rect.height(); |
|
171 | height = rect.height(); | |
172 | } |
|
172 | } | |
173 | if (!d_ptr->m_rubberBandFlags.testFlag(HorizonalRubberBand)) { |
|
173 | if (!d_ptr->m_rubberBandFlags.testFlag(HorizontalRubberBand)) { | |
174 | d_ptr->m_rubberBandOrigin.setX(rect.left()); |
|
174 | d_ptr->m_rubberBandOrigin.setX(rect.left()); | |
175 | width = rect.width(); |
|
175 | width = rect.width(); | |
176 | } |
|
176 | } | |
@@ -201,7 +201,7 void QChartView::mouseReleaseEvent(QMouseEvent *event) | |||||
201 | if (d_ptr->m_rubberBandFlags == VerticalRubberBand) { |
|
201 | if (d_ptr->m_rubberBandFlags == VerticalRubberBand) { | |
202 | rect.setX(d_ptr->m_chart->plotArea().x()); |
|
202 | rect.setX(d_ptr->m_chart->plotArea().x()); | |
203 | rect.setWidth(d_ptr->m_chart->plotArea().width()); |
|
203 | rect.setWidth(d_ptr->m_chart->plotArea().width()); | |
204 | } else if (d_ptr->m_rubberBandFlags == HorizonalRubberBand) { |
|
204 | } else if (d_ptr->m_rubberBandFlags == HorizontalRubberBand) { | |
205 | rect.setY(d_ptr->m_chart->plotArea().y()); |
|
205 | rect.setY(d_ptr->m_chart->plotArea().y()); | |
206 | rect.setHeight(d_ptr->m_chart->plotArea().height()); |
|
206 | rect.setHeight(d_ptr->m_chart->plotArea().height()); | |
207 | } |
|
207 | } | |
@@ -214,12 +214,12 void QChartView::mouseReleaseEvent(QMouseEvent *event) | |||||
214 | // Since there is no suitable API for that, use zoomIn with rect bigger than the |
|
214 | // Since there is no suitable API for that, use zoomIn with rect bigger than the | |
215 | // plot area. |
|
215 | // plot area. | |
216 | if (d_ptr->m_rubberBandFlags == VerticalRubberBand |
|
216 | if (d_ptr->m_rubberBandFlags == VerticalRubberBand | |
217 | || d_ptr->m_rubberBandFlags == HorizonalRubberBand) { |
|
217 | || d_ptr->m_rubberBandFlags == HorizontalRubberBand) { | |
218 | QRectF rect = d_ptr->m_chart->plotArea(); |
|
218 | QRectF rect = d_ptr->m_chart->plotArea(); | |
219 | if (d_ptr->m_rubberBandFlags == VerticalRubberBand) { |
|
219 | if (d_ptr->m_rubberBandFlags == VerticalRubberBand) { | |
220 | qreal adjustment = rect.height() / 2; |
|
220 | qreal adjustment = rect.height() / 2; | |
221 | rect.adjust(0, -adjustment, 0, adjustment); |
|
221 | rect.adjust(0, -adjustment, 0, adjustment); | |
222 | } else if (d_ptr->m_rubberBandFlags == HorizonalRubberBand) { |
|
222 | } else if (d_ptr->m_rubberBandFlags == HorizontalRubberBand) { | |
223 | qreal adjustment = rect.width() / 2; |
|
223 | qreal adjustment = rect.width() / 2; | |
224 | rect.adjust(-adjustment, 0, adjustment, 0); |
|
224 | rect.adjust(-adjustment, 0, adjustment, 0); | |
225 | } |
|
225 | } |
@@ -40,7 +40,7 public: | |||||
40 | enum RubberBand { |
|
40 | enum RubberBand { | |
41 | NoRubberBand = 0x0, |
|
41 | NoRubberBand = 0x0, | |
42 | VerticalRubberBand = 0x1, |
|
42 | VerticalRubberBand = 0x1, | |
43 | HorizonalRubberBand = 0x2, |
|
43 | HorizontalRubberBand = 0x2, | |
44 | RectangleRubberBand = 0x3 |
|
44 | RectangleRubberBand = 0x3 | |
45 | }; |
|
45 | }; | |
46 |
|
46 |
@@ -132,40 +132,10 QT_CHARTS_BEGIN_NAMESPACE | |||||
132 | */ |
|
132 | */ | |
133 |
|
133 | |||
134 | /*! |
|
134 | /*! | |
135 | \qmlproperty real ChartView::topMargin |
|
|||
136 | Deprecated; use margins instead. |
|
|||
137 | */ |
|
|||
138 |
|
||||
139 | /*! |
|
|||
140 | \qmlproperty real ChartView::bottomMargin |
|
|||
141 | Deprecated; use margins instead. |
|
|||
142 | */ |
|
|||
143 |
|
||||
144 | /*! |
|
|||
145 | \qmlproperty real ChartView::leftMargin |
|
|||
146 | Deprecated; use margins instead. |
|
|||
147 | */ |
|
|||
148 |
|
||||
149 | /*! |
|
|||
150 | \qmlproperty real ChartView::rightMargin |
|
|||
151 | Deprecated; use margins instead. |
|
|||
152 | */ |
|
|||
153 |
|
||||
154 | /*! |
|
|||
155 | \qmlproperty Margins ChartView::minimumMargins |
|
|||
156 | Deprecated; use margins instead. |
|
|||
157 | The minimum margins allowed between the outer bounds and the plotArea of the ChartView. Margins |
|
|||
158 | area of ChartView is used for drawing title, axes and legend. Please note that setting the |
|
|||
159 | properties of minimumMargins may be bigger than the defined value, depending on other ChartView |
|
|||
160 | properties that affect it's layout. If you need to know the actual plotting area used at any |
|
|||
161 | given time, you can check ChartView::plotArea instead. |
|
|||
162 | */ |
|
|||
163 |
|
||||
164 | /*! |
|
|||
165 | \qmlproperty rect ChartView::plotArea |
|
135 | \qmlproperty rect ChartView::plotArea | |
166 | The area on the ChartView that is used for drawing series. This is the ChartView rect without the |
|
136 | The area on the ChartView that is used for drawing series. This is the ChartView rect without the | |
167 | margins. |
|
137 | margins. | |
168 |
\sa ChartView::m |
|
138 | \sa ChartView::margins | |
169 | */ |
|
139 | */ | |
170 |
|
140 | |||
171 | /*! |
|
141 | /*! | |
@@ -314,10 +284,14 void DeclarativeChart::initChart(QChart::ChartType type) | |||||
314 | m_margins->setLeft(m_chart->margins().left()); |
|
284 | m_margins->setLeft(m_chart->margins().left()); | |
315 | m_margins->setRight(m_chart->margins().right()); |
|
285 | m_margins->setRight(m_chart->margins().right()); | |
316 | m_margins->setBottom(m_chart->margins().bottom()); |
|
286 | m_margins->setBottom(m_chart->margins().bottom()); | |
317 |
connect(m_margins, SIGNAL(topChanged(int,int,int,int)), |
|
287 | connect(m_margins, SIGNAL(topChanged(int,int,int,int)), | |
318 | connect(m_margins, SIGNAL(bottomChanged(int,int,int,int)), this, SLOT(changeMinimumMargins(int,int,int,int))); |
|
288 | this, SLOT(changeMargins(int,int,int,int))); | |
319 |
connect(m_margins, SIGNAL( |
|
289 | connect(m_margins, SIGNAL(bottomChanged(int,int,int,int)), | |
320 | connect(m_margins, SIGNAL(rightChanged(int,int,int,int)), this, SLOT(changeMinimumMargins(int,int,int,int))); |
|
290 | this, SLOT(changeMargins(int,int,int,int))); | |
|
291 | connect(m_margins, SIGNAL(leftChanged(int,int,int,int)), | |||
|
292 | this, SLOT(changeMargins(int,int,int,int))); | |||
|
293 | connect(m_margins, SIGNAL(rightChanged(int,int,int,int)), | |||
|
294 | this, SLOT(changeMargins(int,int,int,int))); | |||
321 | connect(m_chart->d_ptr->m_dataset, SIGNAL(seriesAdded(QAbstractSeries*)), this, SLOT(handleSeriesAdded(QAbstractSeries*))); |
|
295 | connect(m_chart->d_ptr->m_dataset, SIGNAL(seriesAdded(QAbstractSeries*)), this, SLOT(handleSeriesAdded(QAbstractSeries*))); | |
322 | connect(m_chart->d_ptr->m_dataset, SIGNAL(seriesRemoved(QAbstractSeries*)), this, SIGNAL(seriesRemoved(QAbstractSeries*))); |
|
296 | connect(m_chart->d_ptr->m_dataset, SIGNAL(seriesRemoved(QAbstractSeries*)), this, SIGNAL(seriesRemoved(QAbstractSeries*))); | |
323 | connect(m_chart, &QChart::plotAreaChanged, this, &DeclarativeChart::plotAreaChanged); |
|
297 | connect(m_chart, &QChart::plotAreaChanged, this, &DeclarativeChart::plotAreaChanged); | |
@@ -328,10 +302,10 void DeclarativeChart::handleSeriesAdded(QAbstractSeries *series) | |||||
328 | emit seriesAdded(series); |
|
302 | emit seriesAdded(series); | |
329 | } |
|
303 | } | |
330 |
|
304 | |||
331 |
void DeclarativeChart::changeM |
|
305 | void DeclarativeChart::changeMargins(int top, int bottom, int left, int right) | |
332 | { |
|
306 | { | |
333 | m_chart->setMargins(QMargins(left, top, right, bottom)); |
|
307 | m_chart->setMargins(QMargins(left, top, right, bottom)); | |
334 |
emit m |
|
308 | emit marginsChanged(); | |
335 | } |
|
309 | } | |
336 |
|
310 | |||
337 | DeclarativeChart::~DeclarativeChart() |
|
311 | DeclarativeChart::~DeclarativeChart() | |
@@ -793,30 +767,6 void DeclarativeChart::setBackgroundRoundness(qreal diameter) | |||||
793 | } |
|
767 | } | |
794 | } |
|
768 | } | |
795 |
|
769 | |||
796 | qreal DeclarativeChart::topMargin() |
|
|||
797 | { |
|
|||
798 | qWarning() << "ChartView.topMargin is deprecated. Use margins instead."; |
|
|||
799 | return m_chart->margins().top(); |
|
|||
800 | } |
|
|||
801 |
|
||||
802 | qreal DeclarativeChart::bottomMargin() |
|
|||
803 | { |
|
|||
804 | qWarning() << "ChartView.bottomMargin is deprecated. Use margins instead."; |
|
|||
805 | return m_chart->margins().bottom(); |
|
|||
806 | } |
|
|||
807 |
|
||||
808 | qreal DeclarativeChart::leftMargin() |
|
|||
809 | { |
|
|||
810 | qWarning() << "ChartView.leftMargin is deprecated. Use margins instead."; |
|
|||
811 | return m_chart->margins().left(); |
|
|||
812 | } |
|
|||
813 |
|
||||
814 | qreal DeclarativeChart::rightMargin() |
|
|||
815 | { |
|
|||
816 | qWarning() << "ChartView.rightMargin is deprecated. Use margins instead."; |
|
|||
817 | return m_chart->margins().right(); |
|
|||
818 | } |
|
|||
819 |
|
||||
820 | void DeclarativeChart::zoom(qreal factor) |
|
770 | void DeclarativeChart::zoom(qreal factor) | |
821 | { |
|
771 | { | |
822 | m_chart->zoom(factor); |
|
772 | m_chart->zoom(factor); | |
@@ -995,11 +945,6 void DeclarativeChart::setAxisY(QAbstractAxis *axis, QAbstractSeries *series) | |||||
995 | seriesAxisAttachHelper(series, axis, Qt::Vertical, Qt::AlignLeft); |
|
945 | seriesAxisAttachHelper(series, axis, Qt::Vertical, Qt::AlignLeft); | |
996 | } |
|
946 | } | |
997 |
|
947 | |||
998 | void DeclarativeChart::createDefaultAxes() |
|
|||
999 | { |
|
|||
1000 | qWarning() << "ChartView.createDefaultAxes() is deprecated. Axes are created automatically."; |
|
|||
1001 | } |
|
|||
1002 |
|
||||
1003 | QAbstractAxis *DeclarativeChart::defaultAxis(Qt::Orientation orientation, QAbstractSeries *series) |
|
948 | QAbstractAxis *DeclarativeChart::defaultAxis(Qt::Orientation orientation, QAbstractSeries *series) | |
1004 | { |
|
949 | { | |
1005 | if (!series) { |
|
950 | if (!series) { |
@@ -47,11 +47,6 class DeclarativeChart : public QQuickPaintedItem | |||||
47 | Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged) |
|
47 | Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged) | |
48 | Q_PROPERTY(bool dropShadowEnabled READ dropShadowEnabled WRITE setDropShadowEnabled NOTIFY dropShadowEnabledChanged) |
|
48 | Q_PROPERTY(bool dropShadowEnabled READ dropShadowEnabled WRITE setDropShadowEnabled NOTIFY dropShadowEnabledChanged) | |
49 | Q_PROPERTY(qreal backgroundRoundness READ backgroundRoundness WRITE setBackgroundRoundness NOTIFY backgroundRoundnessChanged REVISION 3) |
|
49 | Q_PROPERTY(qreal backgroundRoundness READ backgroundRoundness WRITE setBackgroundRoundness NOTIFY backgroundRoundnessChanged REVISION 3) | |
50 | Q_PROPERTY(qreal topMargin READ topMargin) |
|
|||
51 | Q_PROPERTY(qreal bottomMargin READ bottomMargin) |
|
|||
52 | Q_PROPERTY(qreal leftMargin READ leftMargin) |
|
|||
53 | Q_PROPERTY(qreal rightMargin READ rightMargin) |
|
|||
54 | Q_PROPERTY(DeclarativeMargins *minimumMargins READ minimumMargins NOTIFY minimumMarginsChanged REVISION 1) |
|
|||
55 | Q_PROPERTY(DeclarativeMargins *margins READ margins NOTIFY marginsChanged REVISION 2) |
|
50 | Q_PROPERTY(DeclarativeMargins *margins READ margins NOTIFY marginsChanged REVISION 2) | |
56 | Q_PROPERTY(QRectF plotArea READ plotArea NOTIFY plotAreaChanged REVISION 1) |
|
51 | Q_PROPERTY(QRectF plotArea READ plotArea NOTIFY plotAreaChanged REVISION 1) | |
57 | Q_PROPERTY(QColor plotAreaColor READ plotAreaColor WRITE setPlotAreaColor NOTIFY plotAreaColorChanged REVISION 3) |
|
52 | Q_PROPERTY(QColor plotAreaColor READ plotAreaColor WRITE setPlotAreaColor NOTIFY plotAreaColorChanged REVISION 3) | |
@@ -144,11 +139,6 public: | |||||
144 | void setBackgroundRoundness(qreal diameter); |
|
139 | void setBackgroundRoundness(qreal diameter); | |
145 |
|
140 | |||
146 | // Margins & plotArea |
|
141 | // Margins & plotArea | |
147 | qreal topMargin(); |
|
|||
148 | qreal bottomMargin(); |
|
|||
149 | qreal leftMargin(); |
|
|||
150 | qreal rightMargin(); |
|
|||
151 | DeclarativeMargins *minimumMargins() { return m_margins; } |
|
|||
152 | DeclarativeMargins *margins() { return m_margins; } |
|
142 | DeclarativeMargins *margins() { return m_margins; } | |
153 | QRectF plotArea() { return m_chart->plotArea(); } |
|
143 | QRectF plotArea() { return m_chart->plotArea(); } | |
154 |
|
144 | |||
@@ -170,7 +160,6 public: | |||||
170 | Q_INVOKABLE void removeAllSeries() { m_chart->removeAllSeries(); } |
|
160 | Q_INVOKABLE void removeAllSeries() { m_chart->removeAllSeries(); } | |
171 | Q_INVOKABLE void setAxisX(QAbstractAxis *axis, QAbstractSeries *series = 0); |
|
161 | Q_INVOKABLE void setAxisX(QAbstractAxis *axis, QAbstractSeries *series = 0); | |
172 | Q_INVOKABLE void setAxisY(QAbstractAxis *axis, QAbstractSeries *series = 0); |
|
162 | Q_INVOKABLE void setAxisY(QAbstractAxis *axis, QAbstractSeries *series = 0); | |
173 | Q_INVOKABLE void createDefaultAxes(); |
|
|||
174 | Q_INVOKABLE QAbstractAxis *axisX(QAbstractSeries *series = 0); |
|
163 | Q_INVOKABLE QAbstractAxis *axisX(QAbstractSeries *series = 0); | |
175 | Q_INVOKABLE QAbstractAxis *axisY(QAbstractSeries *series = 0); |
|
164 | Q_INVOKABLE QAbstractAxis *axisY(QAbstractSeries *series = 0); | |
176 | Q_INVOKABLE void zoom(qreal factor); |
|
165 | Q_INVOKABLE void zoom(qreal factor); | |
@@ -184,7 +173,6 Q_SIGNALS: | |||||
184 | void titleColorChanged(QColor color); |
|
173 | void titleColorChanged(QColor color); | |
185 | void backgroundColorChanged(); |
|
174 | void backgroundColorChanged(); | |
186 | void dropShadowEnabledChanged(bool enabled); |
|
175 | void dropShadowEnabledChanged(bool enabled); | |
187 | void minimumMarginsChanged(); |
|
|||
188 | Q_REVISION(2) void marginsChanged(); |
|
176 | Q_REVISION(2) void marginsChanged(); | |
189 | void plotAreaChanged(QRectF plotArea); |
|
177 | void plotAreaChanged(QRectF plotArea); | |
190 | void seriesAdded(QAbstractSeries *series); |
|
178 | void seriesAdded(QAbstractSeries *series); | |
@@ -195,7 +183,7 Q_SIGNALS: | |||||
195 | Q_REVISION(4) void localeChanged(); |
|
183 | Q_REVISION(4) void localeChanged(); | |
196 |
|
184 | |||
197 | private Q_SLOTS: |
|
185 | private Q_SLOTS: | |
198 |
void changeM |
|
186 | void changeMargins(int top, int bottom, int left, int right); | |
199 | void handleAxisXSet(QAbstractAxis *axis); |
|
187 | void handleAxisXSet(QAbstractAxis *axis); | |
200 | void handleAxisYSet(QAbstractAxis *axis); |
|
188 | void handleAxisYSet(QAbstractAxis *axis); | |
201 | void handleAxisXTopSet(QAbstractAxis *axis); |
|
189 | void handleAxisXTopSet(QAbstractAxis *axis); |
@@ -522,17 +522,6 Module { | |||||
522 | Property { name: "backgroundColor"; type: "QColor" } |
|
522 | Property { name: "backgroundColor"; type: "QColor" } | |
523 | Property { name: "dropShadowEnabled"; type: "bool" } |
|
523 | Property { name: "dropShadowEnabled"; type: "bool" } | |
524 | Property { name: "backgroundRoundness"; revision: 3; type: "double" } |
|
524 | Property { name: "backgroundRoundness"; revision: 3; type: "double" } | |
525 | Property { name: "topMargin"; type: "double"; isReadonly: true } |
|
|||
526 | Property { name: "bottomMargin"; type: "double"; isReadonly: true } |
|
|||
527 | Property { name: "leftMargin"; type: "double"; isReadonly: true } |
|
|||
528 | Property { name: "rightMargin"; type: "double"; isReadonly: true } |
|
|||
529 | Property { |
|
|||
530 | name: "minimumMargins" |
|
|||
531 | revision: 1 |
|
|||
532 | type: "DeclarativeMargins" |
|
|||
533 | isReadonly: true |
|
|||
534 | isPointer: true |
|
|||
535 | } |
|
|||
536 | Property { |
|
525 | Property { | |
537 | name: "margins" |
|
526 | name: "margins" | |
538 | revision: 2 |
|
527 | revision: 2 | |
@@ -634,7 +623,6 Module { | |||||
634 | name: "setAxisY" |
|
623 | name: "setAxisY" | |
635 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
624 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
636 | } |
|
625 | } | |
637 | Method { name: "createDefaultAxes" } |
|
|||
638 | Method { |
|
626 | Method { | |
639 | name: "axisX" |
|
627 | name: "axisX" | |
640 | type: "QAbstractAxis*" |
|
628 | type: "QAbstractAxis*" | |
@@ -1500,7 +1488,6 Module { | |||||
1500 | Property { name: "linePen"; type: "QPen" } |
|
1488 | Property { name: "linePen"; type: "QPen" } | |
1501 | Property { name: "color"; type: "QColor" } |
|
1489 | Property { name: "color"; type: "QColor" } | |
1502 | Property { name: "labelsVisible"; type: "bool" } |
|
1490 | Property { name: "labelsVisible"; type: "bool" } | |
1503 | Property { name: "labelsPen"; type: "QPen" } |
|
|||
1504 | Property { name: "labelsBrush"; type: "QBrush" } |
|
1491 | Property { name: "labelsBrush"; type: "QBrush" } | |
1505 | Property { name: "labelsAngle"; type: "int" } |
|
1492 | Property { name: "labelsAngle"; type: "int" } | |
1506 | Property { name: "labelsFont"; type: "QFont" } |
|
1493 | Property { name: "labelsFont"; type: "QFont" } | |
@@ -1513,7 +1500,6 Module { | |||||
1513 | Property { name: "shadesPen"; type: "QPen" } |
|
1500 | Property { name: "shadesPen"; type: "QPen" } | |
1514 | Property { name: "shadesBrush"; type: "QBrush" } |
|
1501 | Property { name: "shadesBrush"; type: "QBrush" } | |
1515 | Property { name: "titleText"; type: "string" } |
|
1502 | Property { name: "titleText"; type: "string" } | |
1516 | Property { name: "titlePen"; type: "QPen" } |
|
|||
1517 | Property { name: "titleBrush"; type: "QBrush" } |
|
1503 | Property { name: "titleBrush"; type: "QBrush" } | |
1518 | Property { name: "titleVisible"; type: "bool" } |
|
1504 | Property { name: "titleVisible"; type: "bool" } | |
1519 | Property { name: "titleFont"; type: "QFont" } |
|
1505 | Property { name: "titleFont"; type: "QFont" } | |
@@ -1536,10 +1522,6 Module { | |||||
1536 | Parameter { name: "visible"; type: "bool" } |
|
1522 | Parameter { name: "visible"; type: "bool" } | |
1537 | } |
|
1523 | } | |
1538 | Signal { |
|
1524 | Signal { | |
1539 | name: "labelsPenChanged" |
|
|||
1540 | Parameter { name: "pen"; type: "QPen" } |
|
|||
1541 | } |
|
|||
1542 | Signal { |
|
|||
1543 | name: "labelsBrushChanged" |
|
1525 | name: "labelsBrushChanged" | |
1544 | Parameter { name: "brush"; type: "QBrush" } |
|
1526 | Parameter { name: "brush"; type: "QBrush" } | |
1545 | } |
|
1527 | } | |
@@ -1572,10 +1554,6 Module { | |||||
1572 | Parameter { name: "title"; type: "string" } |
|
1554 | Parameter { name: "title"; type: "string" } | |
1573 | } |
|
1555 | } | |
1574 | Signal { |
|
1556 | Signal { | |
1575 | name: "titlePenChanged" |
|
|||
1576 | Parameter { name: "pen"; type: "QPen" } |
|
|||
1577 | } |
|
|||
1578 | Signal { |
|
|||
1579 | name: "titleBrushChanged" |
|
1557 | name: "titleBrushChanged" | |
1580 | Parameter { name: "brush"; type: "QBrush" } |
|
1558 | Parameter { name: "brush"; type: "QBrush" } | |
1581 | } |
|
1559 | } | |
@@ -2297,7 +2275,6 Module { | |||||
2297 | ] |
|
2275 | ] | |
2298 | exportMetaObjectRevisions: [0, 0, 0] |
|
2276 | exportMetaObjectRevisions: [0, 0, 0] | |
2299 | Property { name: "tickCount"; type: "int" } |
|
2277 | Property { name: "tickCount"; type: "int" } | |
2300 | Property { name: "niceNumbersEnabled"; type: "bool" } |
|
|||
2301 | Property { name: "min"; type: "double" } |
|
2278 | Property { name: "min"; type: "double" } | |
2302 | Property { name: "max"; type: "double" } |
|
2279 | Property { name: "max"; type: "double" } | |
2303 | Property { name: "labelFormat"; type: "string" } |
|
2280 | Property { name: "labelFormat"; type: "string" } |
@@ -56,7 +56,6 void tst_QAbstractAxis::qabstractaxis() | |||||
56 | QCOMPARE(m_axis->labelsAngle(), 0); |
|
56 | QCOMPARE(m_axis->labelsAngle(), 0); | |
57 | QCOMPARE(m_axis->labelsBrush(), QBrush()); |
|
57 | QCOMPARE(m_axis->labelsBrush(), QBrush()); | |
58 | QCOMPARE(m_axis->labelsFont(), QFont()); |
|
58 | QCOMPARE(m_axis->labelsFont(), QFont()); | |
59 | QCOMPARE(m_axis->labelsPen(), QPen()); |
|
|||
60 | QCOMPARE(m_axis->labelsVisible(), true); |
|
59 | QCOMPARE(m_axis->labelsVisible(), true); | |
61 | QCOMPARE(m_axis->orientation(), Qt::Orientation(0)); |
|
60 | QCOMPARE(m_axis->orientation(), Qt::Orientation(0)); | |
62 | m_axis->setLineVisible(false); |
|
61 | m_axis->setLineVisible(false); | |
@@ -68,7 +67,6 void tst_QAbstractAxis::qabstractaxis() | |||||
68 | m_axis->setLabelsBrush(QBrush()); |
|
67 | m_axis->setLabelsBrush(QBrush()); | |
69 | m_axis->setLabelsColor(QColor()); |
|
68 | m_axis->setLabelsColor(QColor()); | |
70 | m_axis->setLabelsFont(QFont()); |
|
69 | m_axis->setLabelsFont(QFont()); | |
71 | m_axis->setLabelsPen(QPen()); |
|
|||
72 | m_axis->setLabelsVisible(false); |
|
70 | m_axis->setLabelsVisible(false); | |
73 | m_axis->setMax(QVariant()); |
|
71 | m_axis->setMax(QVariant()); | |
74 | m_axis->setMin(QVariant()); |
|
72 | m_axis->setMin(QVariant()); | |
@@ -443,48 +441,6 void tst_QAbstractAxis::labelsFont() | |||||
443 |
|
441 | |||
444 | } |
|
442 | } | |
445 |
|
443 | |||
446 | void tst_QAbstractAxis::labelsPen_data() |
|
|||
447 | { |
|
|||
448 | QTest::addColumn<QPen>("labelsPen"); |
|
|||
449 | QTest::newRow("null") << QPen(); |
|
|||
450 | QTest::newRow("blue") << QPen(Qt::blue); |
|
|||
451 | QTest::newRow("black") << QPen(Qt::black); |
|
|||
452 | QTest::newRow("red") << QPen(Qt::red); |
|
|||
453 | } |
|
|||
454 |
|
||||
455 | void tst_QAbstractAxis::labelsPen() |
|
|||
456 | { |
|
|||
457 | QFETCH(QPen, labelsPen); |
|
|||
458 |
|
||||
459 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
|||
460 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
|||
461 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
|||
462 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
|||
463 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
|||
464 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
|||
465 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
|||
466 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
|||
467 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
|||
468 |
|
||||
469 | m_axis->setLabelsPen(labelsPen); |
|
|||
470 | QCOMPARE(m_axis->labelsPen(), labelsPen); |
|
|||
471 |
|
||||
472 | QCOMPARE(spy0.count(), 0); |
|
|||
473 | QCOMPARE(spy1.count(), 0); |
|
|||
474 | QCOMPARE(spy2.count(), 0); |
|
|||
475 | QCOMPARE(spy3.count(), 0); |
|
|||
476 | QCOMPARE(spy4.count(), 0); |
|
|||
477 | QCOMPARE(spy5.count(), 0); |
|
|||
478 | QCOMPARE(spy6.count(), 0); |
|
|||
479 | QCOMPARE(spy7.count(), 0); |
|
|||
480 | QCOMPARE(spy8.count(), 0); |
|
|||
481 |
|
||||
482 | m_chart->setAxisX(m_axis, m_series); |
|
|||
483 | m_view->show(); |
|
|||
484 | QTest::qWaitForWindowShown(m_view); |
|
|||
485 | //TODO QCOMPARE(m_axis->labelsPen(), labelsPen); |
|
|||
486 | } |
|
|||
487 |
|
||||
488 | void tst_QAbstractAxis::labelsVisible_data() |
|
444 | void tst_QAbstractAxis::labelsVisible_data() | |
489 | { |
|
445 | { | |
490 | QTest::addColumn<bool>("labelsVisible"); |
|
446 | QTest::addColumn<bool>("labelsVisible"); |
@@ -57,8 +57,6 private slots: | |||||
57 | void labelsColor(); |
|
57 | void labelsColor(); | |
58 | void labelsFont_data(); |
|
58 | void labelsFont_data(); | |
59 | void labelsFont(); |
|
59 | void labelsFont(); | |
60 | void labelsPen_data(); |
|
|||
61 | void labelsPen(); |
|
|||
62 | void labelsVisible_data(); |
|
60 | void labelsVisible_data(); | |
63 | void labelsVisible(); |
|
61 | void labelsVisible(); | |
64 | void orientation_data(); |
|
62 | void orientation_data(); |
@@ -120,11 +120,11 void tst_QChartView::rubberBand_data() | |||||
120 | QTest::addColumn<QPoint>("max"); |
|
120 | QTest::addColumn<QPoint>("max"); | |
121 |
|
121 | |||
122 | if (isPolarTest()) { |
|
122 | if (isPolarTest()) { | |
123 | QTest::newRow("HorizonalRubberBand") << QChartView::RubberBands(QChartView::HorizonalRubberBand) << 0 << 0 << QPoint(5,5) << QPoint(5,5); |
|
123 | QTest::newRow("HorizontalRubberBand") << QChartView::RubberBands(QChartView::HorizontalRubberBand) << 0 << 0 << QPoint(5,5) << QPoint(5,5); | |
124 | QTest::newRow("VerticalRubberBand") << QChartView::RubberBands(QChartView::VerticalRubberBand) << 0 << 0 << QPoint(5,5) << QPoint(5,5); |
|
124 | QTest::newRow("VerticalRubberBand") << QChartView::RubberBands(QChartView::VerticalRubberBand) << 0 << 0 << QPoint(5,5) << QPoint(5,5); | |
125 | QTest::newRow("RectangleRubberBand") << QChartView::RubberBands(QChartView::RectangleRubberBand) << 0 << 0 << QPoint(5,5) << QPoint(5,5); |
|
125 | QTest::newRow("RectangleRubberBand") << QChartView::RubberBands(QChartView::RectangleRubberBand) << 0 << 0 << QPoint(5,5) << QPoint(5,5); | |
126 | } else { |
|
126 | } else { | |
127 | QTest::newRow("HorizonalRubberBand") << QChartView::RubberBands(QChartView::HorizonalRubberBand) << 0 << 1 << QPoint(5,5) << QPoint(5,5); |
|
127 | QTest::newRow("HorizontalRubberBand") << QChartView::RubberBands(QChartView::HorizontalRubberBand) << 0 << 1 << QPoint(5,5) << QPoint(5,5); | |
128 | QTest::newRow("VerticalRubberBand") << QChartView::RubberBands(QChartView::VerticalRubberBand) << 1 << 0 << QPoint(5,5) << QPoint(5,5); |
|
128 | QTest::newRow("VerticalRubberBand") << QChartView::RubberBands(QChartView::VerticalRubberBand) << 1 << 0 << QPoint(5,5) << QPoint(5,5); | |
129 | QTest::newRow("RectangleRubberBand") << QChartView::RubberBands(QChartView::RectangleRubberBand) << 1 << 1 << QPoint(5,5) << QPoint(5,5); |
|
129 | QTest::newRow("RectangleRubberBand") << QChartView::RubberBands(QChartView::RectangleRubberBand) << 1 << 1 << QPoint(5,5) << QPoint(5,5); | |
130 | } |
|
130 | } |
@@ -32,10 +32,6 Rectangle { | |||||
32 | function test_chartViewProperties() { |
|
32 | function test_chartViewProperties() { | |
33 | compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions"); |
|
33 | compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions"); | |
34 | verify(chartView.backgroundColor != undefined); |
|
34 | verify(chartView.backgroundColor != undefined); | |
35 | verify(chartView.bottomMargin > 0, "ChartView.bottomMargin"); |
|
|||
36 | verify(chartView.topMargin > 0, "ChartView.topMargin"); |
|
|||
37 | verify(chartView.leftMargin > 0, "ChartView.leftMargin"); |
|
|||
38 | verify(chartView.rightMargin > 0, "ChartView.rightMargin"); |
|
|||
39 | compare(chartView.count, 0, "ChartView.count"); |
|
35 | compare(chartView.count, 0, "ChartView.count"); | |
40 | compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled"); |
|
36 | compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled"); | |
41 | verify(chartView.plotArea.height > 0, "ChartView.plotArea.height"); |
|
37 | verify(chartView.plotArea.height > 0, "ChartView.plotArea.height"); |
@@ -103,7 +103,6 void tst_QValueAxis::qvalueaxis() | |||||
103 |
|
103 | |||
104 | QVERIFY(qFuzzyCompare(m_valuesaxis->max(), 0)); |
|
104 | QVERIFY(qFuzzyCompare(m_valuesaxis->max(), 0)); | |
105 | QVERIFY(qFuzzyCompare(m_valuesaxis->min(), 0)); |
|
105 | QVERIFY(qFuzzyCompare(m_valuesaxis->min(), 0)); | |
106 | QCOMPARE(m_valuesaxis->niceNumbersEnabled(), false); |
|
|||
107 | QCOMPARE(m_valuesaxis->tickCount(), 5); |
|
106 | QCOMPARE(m_valuesaxis->tickCount(), 5); | |
108 | QCOMPARE(m_valuesaxis->type(), QAbstractAxis::AxisTypeValue); |
|
107 | QCOMPARE(m_valuesaxis->type(), QAbstractAxis::AxisTypeValue); | |
109 |
|
108 | |||
@@ -113,7 +112,6 void tst_QValueAxis::qvalueaxis() | |||||
113 |
|
112 | |||
114 | QVERIFY(!qFuzzyCompare(m_valuesaxis->max(), 0)); |
|
113 | QVERIFY(!qFuzzyCompare(m_valuesaxis->max(), 0)); | |
115 | QVERIFY(!qFuzzyCompare(m_valuesaxis->min(), 0)); |
|
114 | QVERIFY(!qFuzzyCompare(m_valuesaxis->min(), 0)); | |
116 | QCOMPARE(m_valuesaxis->niceNumbersEnabled(), false); |
|
|||
117 | QCOMPARE(m_valuesaxis->tickCount(), 5); |
|
115 | QCOMPARE(m_valuesaxis->tickCount(), 5); | |
118 | } |
|
116 | } | |
119 |
|
117 |
@@ -68,7 +68,7 MainWidget::MainWidget(QWidget *parent) : | |||||
68 |
|
68 | |||
69 | // Create chart view with the chart |
|
69 | // Create chart view with the chart | |
70 | m_chartView = new QChartView(m_chart, this); |
|
70 | m_chartView = new QChartView(m_chart, this); | |
71 | m_chartView->setRubberBand(QChartView::HorizonalRubberBand); |
|
71 | m_chartView->setRubberBand(QChartView::HorizontalRubberBand); | |
72 |
|
72 | |||
73 | // Another grid layout as a main layout |
|
73 | // Another grid layout as a main layout | |
74 | QGridLayout *mainLayout = new QGridLayout(); |
|
74 | QGridLayout *mainLayout = new QGridLayout(); |
@@ -60,8 +60,6 MainWindow::MainWindow(QWidget *parent) : | |||||
60 | m_plotAreaBackgroundBrush(new QBrush(Qt::NoBrush)), |
|
60 | m_plotAreaBackgroundBrush(new QBrush(Qt::NoBrush)), | |
61 | m_angularShadesPen(new QPen(Qt::NoPen)), |
|
61 | m_angularShadesPen(new QPen(Qt::NoPen)), | |
62 | m_radialShadesPen(new QPen(Qt::NoPen)), |
|
62 | m_radialShadesPen(new QPen(Qt::NoPen)), | |
63 | m_labelPen(new QPen(Qt::NoPen)), |
|
|||
64 | m_titlePen(new QPen(Qt::NoPen)), |
|
|||
65 | m_gridPen(new QPen(QRgb(0x010101))), // Note: Pure black is default color, so it gets overridden by |
|
63 | m_gridPen(new QPen(QRgb(0x010101))), // Note: Pure black is default color, so it gets overridden by | |
66 | m_arrowPen(new QPen(QRgb(0x010101))), // default theme if set to that initially. This is an example of workaround. |
|
64 | m_arrowPen(new QPen(QRgb(0x010101))), // default theme if set to that initially. This is an example of workaround. | |
67 | m_backgroundPen(new QPen(Qt::NoPen)), |
|
65 | m_backgroundPen(new QPen(Qt::NoPen)), | |
@@ -429,14 +427,12 void MainWindow::setAngularAxis(MainWindow::AxisMode mode) | |||||
429 | m_angularAxis->setLabelsAngle(m_labelsAngle); |
|
427 | m_angularAxis->setLabelsAngle(m_labelsAngle); | |
430 | m_angularAxis->setLabelsFont(m_currentLabelFont); |
|
428 | m_angularAxis->setLabelsFont(m_currentLabelFont); | |
431 | m_angularAxis->setLabelsBrush(*m_labelBrush); |
|
429 | m_angularAxis->setLabelsBrush(*m_labelBrush); | |
432 | m_angularAxis->setLabelsPen(*m_labelPen); |
|
|||
433 | m_angularAxis->setLabelsVisible(m_labelsVisible); |
|
430 | m_angularAxis->setLabelsVisible(m_labelsVisible); | |
434 | m_angularAxis->setShadesBrush(*m_angularShadesBrush); |
|
431 | m_angularAxis->setShadesBrush(*m_angularShadesBrush); | |
435 | m_angularAxis->setShadesPen(*m_angularShadesPen); |
|
432 | m_angularAxis->setShadesPen(*m_angularShadesPen); | |
436 | m_angularAxis->setShadesVisible(m_angularShadesVisible); |
|
433 | m_angularAxis->setShadesVisible(m_angularShadesVisible); | |
437 | m_angularAxis->setTitleFont(m_currentTitleFont); |
|
434 | m_angularAxis->setTitleFont(m_currentTitleFont); | |
438 | m_angularAxis->setTitleBrush(*m_titleBrush); |
|
435 | m_angularAxis->setTitleBrush(*m_titleBrush); | |
439 | m_angularAxis->setTitlePen(*m_titlePen); |
|
|||
440 | m_angularAxis->setTitleVisible(m_titleVisible); |
|
436 | m_angularAxis->setTitleVisible(m_titleVisible); | |
441 | m_angularAxis->setTitleText(m_angularTitle); |
|
437 | m_angularAxis->setTitleText(m_angularTitle); | |
442 | m_angularAxis->setGridLinePen(*m_gridPen); |
|
438 | m_angularAxis->setGridLinePen(*m_gridPen); | |
@@ -499,14 +495,12 void MainWindow::setRadialAxis(MainWindow::AxisMode mode) | |||||
499 | m_radialAxis->setLabelsAngle(m_labelsAngle); |
|
495 | m_radialAxis->setLabelsAngle(m_labelsAngle); | |
500 | m_radialAxis->setLabelsFont(m_currentLabelFont); |
|
496 | m_radialAxis->setLabelsFont(m_currentLabelFont); | |
501 | m_radialAxis->setLabelsBrush(*m_labelBrush); |
|
497 | m_radialAxis->setLabelsBrush(*m_labelBrush); | |
502 | m_radialAxis->setLabelsPen(*m_labelPen); |
|
|||
503 | m_radialAxis->setLabelsVisible(m_labelsVisible); |
|
498 | m_radialAxis->setLabelsVisible(m_labelsVisible); | |
504 | m_radialAxis->setShadesBrush(*m_radialShadesBrush); |
|
499 | m_radialAxis->setShadesBrush(*m_radialShadesBrush); | |
505 | m_radialAxis->setShadesPen(*m_radialShadesPen); |
|
500 | m_radialAxis->setShadesPen(*m_radialShadesPen); | |
506 | m_radialAxis->setShadesVisible(m_radialShadesVisible); |
|
501 | m_radialAxis->setShadesVisible(m_radialShadesVisible); | |
507 | m_radialAxis->setTitleFont(m_currentTitleFont); |
|
502 | m_radialAxis->setTitleFont(m_currentTitleFont); | |
508 | m_radialAxis->setTitleBrush(*m_titleBrush); |
|
503 | m_radialAxis->setTitleBrush(*m_titleBrush); | |
509 | m_radialAxis->setTitlePen(*m_titlePen); |
|
|||
510 | m_radialAxis->setTitleVisible(m_titleVisible); |
|
504 | m_radialAxis->setTitleVisible(m_titleVisible); | |
511 | m_radialAxis->setTitleText(m_radialTitle); |
|
505 | m_radialAxis->setTitleText(m_radialTitle); | |
512 | m_radialAxis->setGridLinePen(*m_gridPen); |
|
506 | m_radialAxis->setGridLinePen(*m_gridPen); | |
@@ -750,22 +744,18 void MainWindow::animationIndexChanged(int index) | |||||
750 | void MainWindow::labelsIndexChanged(int index) |
|
744 | void MainWindow::labelsIndexChanged(int index) | |
751 | { |
|
745 | { | |
752 | delete m_labelBrush; |
|
746 | delete m_labelBrush; | |
753 | delete m_labelPen; |
|
|||
754 |
|
747 | |||
755 | switch (index) { |
|
748 | switch (index) { | |
756 | case 0: |
|
749 | case 0: | |
757 | m_labelBrush = new QBrush(Qt::NoBrush); |
|
750 | m_labelBrush = new QBrush(Qt::NoBrush); | |
758 | m_labelPen = new QPen(Qt::NoPen); |
|
|||
759 | m_labelsVisible = false; |
|
751 | m_labelsVisible = false; | |
760 | break; |
|
752 | break; | |
761 | case 1: |
|
753 | case 1: | |
762 | m_labelBrush = new QBrush(Qt::black); |
|
754 | m_labelBrush = new QBrush(Qt::black); | |
763 | m_labelPen = new QPen(Qt::NoPen); |
|
|||
764 | m_labelsVisible = true; |
|
755 | m_labelsVisible = true; | |
765 | break; |
|
756 | break; | |
766 | case 2: |
|
757 | case 2: | |
767 | m_labelBrush = new QBrush(Qt::white); |
|
758 | m_labelBrush = new QBrush(Qt::white); | |
768 | m_labelPen = new QPen(Qt::blue); |
|
|||
769 | m_labelsVisible = true; |
|
759 | m_labelsVisible = true; | |
770 | break; |
|
760 | break; | |
771 | default: |
|
761 | default: | |
@@ -773,50 +763,42 void MainWindow::labelsIndexChanged(int index) | |||||
773 | } |
|
763 | } | |
774 |
|
764 | |||
775 | m_radialAxis->setLabelsBrush(*m_labelBrush); |
|
765 | m_radialAxis->setLabelsBrush(*m_labelBrush); | |
776 | m_radialAxis->setLabelsPen(*m_labelPen); |
|
|||
777 | m_radialAxis->setLabelsVisible(m_labelsVisible); |
|
766 | m_radialAxis->setLabelsVisible(m_labelsVisible); | |
778 | m_angularAxis->setLabelsBrush(*m_labelBrush); |
|
767 | m_angularAxis->setLabelsBrush(*m_labelBrush); | |
779 | m_angularAxis->setLabelsPen(*m_labelPen); |
|
|||
780 | m_angularAxis->setLabelsVisible(m_labelsVisible); |
|
768 | m_angularAxis->setLabelsVisible(m_labelsVisible); | |
781 | } |
|
769 | } | |
782 |
|
770 | |||
783 | void MainWindow::titleIndexChanged(int index) |
|
771 | void MainWindow::titleIndexChanged(int index) | |
784 | { |
|
772 | { | |
785 | delete m_titleBrush; |
|
773 | delete m_titleBrush; | |
786 | delete m_titlePen; |
|
|||
787 |
|
774 | |||
788 | switch (index) { |
|
775 | switch (index) { | |
789 | case 0: |
|
776 | case 0: | |
790 | m_titleBrush = new QBrush(Qt::NoBrush); |
|
777 | m_titleBrush = new QBrush(Qt::NoBrush); | |
791 | m_titlePen = new QPen(Qt::NoPen); |
|
|||
792 | m_titleVisible = false; |
|
778 | m_titleVisible = false; | |
793 | m_angularTitle = QString(); |
|
779 | m_angularTitle = QString(); | |
794 | m_radialTitle = QString(); |
|
780 | m_radialTitle = QString(); | |
795 | break; |
|
781 | break; | |
796 | case 1: |
|
782 | case 1: | |
797 | m_titleBrush = new QBrush(Qt::NoBrush); |
|
783 | m_titleBrush = new QBrush(Qt::NoBrush); | |
798 | m_titlePen = new QPen(Qt::NoPen); |
|
|||
799 | m_titleVisible = true; |
|
784 | m_titleVisible = true; | |
800 | m_angularTitle = QString(); |
|
785 | m_angularTitle = QString(); | |
801 | m_radialTitle = QString(); |
|
786 | m_radialTitle = QString(); | |
802 | break; |
|
787 | break; | |
803 | case 2: |
|
788 | case 2: | |
804 | m_titleBrush = new QBrush(Qt::NoBrush); |
|
789 | m_titleBrush = new QBrush(Qt::NoBrush); | |
805 | m_titlePen = new QPen(Qt::NoPen); |
|
|||
806 | m_titleVisible = false; |
|
790 | m_titleVisible = false; | |
807 | m_angularTitle = QString("Invisible Ang. Title!"); |
|
791 | m_angularTitle = QString("Invisible Ang. Title!"); | |
808 | m_radialTitle = QString("Invisible Rad. Title!"); |
|
792 | m_radialTitle = QString("Invisible Rad. Title!"); | |
809 | break; |
|
793 | break; | |
810 | case 3: |
|
794 | case 3: | |
811 | m_titleBrush = new QBrush(Qt::black); |
|
795 | m_titleBrush = new QBrush(Qt::black); | |
812 | m_titlePen = new QPen(Qt::NoPen); |
|
|||
813 | m_titleVisible = true; |
|
796 | m_titleVisible = true; | |
814 | m_angularTitle = QString("Angular Title"); |
|
797 | m_angularTitle = QString("Angular Title"); | |
815 | m_radialTitle = QString("Radial Title"); |
|
798 | m_radialTitle = QString("Radial Title"); | |
816 | break; |
|
799 | break; | |
817 | case 4: |
|
800 | case 4: | |
818 | m_titleBrush = new QBrush(Qt::white); |
|
801 | m_titleBrush = new QBrush(Qt::white); | |
819 | m_titlePen = new QPen(Qt::blue); |
|
|||
820 | m_titleVisible = true; |
|
802 | m_titleVisible = true; | |
821 | m_angularTitle = QString("Angular Blue Title"); |
|
803 | m_angularTitle = QString("Angular Blue Title"); | |
822 | m_radialTitle = QString("Radial Blue Title"); |
|
804 | m_radialTitle = QString("Radial Blue Title"); | |
@@ -826,11 +808,9 void MainWindow::titleIndexChanged(int index) | |||||
826 | } |
|
808 | } | |
827 |
|
809 | |||
828 | m_radialAxis->setTitleBrush(*m_titleBrush); |
|
810 | m_radialAxis->setTitleBrush(*m_titleBrush); | |
829 | m_radialAxis->setTitlePen(*m_titlePen); |
|
|||
830 | m_radialAxis->setTitleVisible(m_titleVisible); |
|
811 | m_radialAxis->setTitleVisible(m_titleVisible); | |
831 | m_radialAxis->setTitleText(m_radialTitle); |
|
812 | m_radialAxis->setTitleText(m_radialTitle); | |
832 | m_angularAxis->setTitleBrush(*m_titleBrush); |
|
813 | m_angularAxis->setTitleBrush(*m_titleBrush); | |
833 | m_angularAxis->setTitlePen(*m_titlePen); |
|
|||
834 | m_angularAxis->setTitleVisible(m_titleVisible); |
|
814 | m_angularAxis->setTitleVisible(m_titleVisible); | |
835 | m_angularAxis->setTitleText(m_angularTitle); |
|
815 | m_angularAxis->setTitleText(m_angularTitle); | |
836 | } |
|
816 | } |
@@ -125,8 +125,6 private: | |||||
125 | QBrush *m_plotAreaBackgroundBrush; |
|
125 | QBrush *m_plotAreaBackgroundBrush; | |
126 | QPen *m_angularShadesPen; |
|
126 | QPen *m_angularShadesPen; | |
127 | QPen *m_radialShadesPen; |
|
127 | QPen *m_radialShadesPen; | |
128 | QPen *m_labelPen; |
|
|||
129 | QPen *m_titlePen; |
|
|||
130 | QPen *m_gridPen; |
|
128 | QPen *m_gridPen; | |
131 | QPen *m_arrowPen; |
|
129 | QPen *m_arrowPen; | |
132 | QPen *m_backgroundPen; |
|
130 | QPen *m_backgroundPen; |
@@ -85,10 +85,6 Rectangle { | |||||
85 | text: "Default + User defined" |
|
85 | text: "Default + User defined" | |
86 | onClicked: viewName = "DefaultAndUserDefined"; |
|
86 | onClicked: viewName = "DefaultAndUserDefined"; | |
87 | } |
|
87 | } | |
88 | Button { |
|
|||
89 | text: "Legacy" |
|
|||
90 | onClicked: viewName = "Legacy"; |
|
|||
91 | } |
|
|||
92 | } |
|
88 | } | |
93 | } |
|
89 | } | |
94 | } |
|
90 | } |
@@ -13,6 +13,5 | |||||
13 | <file>qml/qmlchartaxis/CreatingDynamically.qml</file> |
|
13 | <file>qml/qmlchartaxis/CreatingDynamically.qml</file> | |
14 | <file>qml/qmlchartaxis/SwitchingDynamically.qml</file> |
|
14 | <file>qml/qmlchartaxis/SwitchingDynamically.qml</file> | |
15 | <file>qml/qmlchartaxis/DefaultAndUserDefined.qml</file> |
|
15 | <file>qml/qmlchartaxis/DefaultAndUserDefined.qml</file> | |
16 | <file>qml/qmlchartaxis/Legacy.qml</file> |
|
|||
17 | </qresource> |
|
16 | </qresource> | |
18 | </RCC> |
|
17 | </RCC> |
@@ -95,10 +95,10 ChartView { | |||||
95 | color: "transparent" |
|
95 | color: "transparent" | |
96 | border.color: "red" |
|
96 | border.color: "red" | |
97 | anchors.fill: parent |
|
97 | anchors.fill: parent | |
98 |
anchors.topMargin: chartView.m |
|
98 | anchors.topMargin: chartView.margins.top | |
99 |
anchors.bottomMargin: chartView.m |
|
99 | anchors.bottomMargin: chartView.margins.bottom | |
100 |
anchors.leftMargin: chartView.m |
|
100 | anchors.leftMargin: chartView.margins.left | |
101 |
anchors.rightMargin: chartView.m |
|
101 | anchors.rightMargin: chartView.margins.right | |
102 | opacity: 0.0 |
|
102 | opacity: 0.0 | |
103 | onOpacityChanged: if (opacity > 0.9) opacity = 0.0; |
|
103 | onOpacityChanged: if (opacity > 0.9) opacity = 0.0; | |
104 | Behavior on opacity { |
|
104 | Behavior on opacity { |
@@ -105,10 +105,6 Row { | |||||
105 |
|
105 | |||
106 | onClicked: axis.tickCount--; |
|
106 | onClicked: axis.tickCount--; | |
107 | } |
|
107 | } | |
108 | Button { |
|
|||
109 | text: "axis nice nmb" |
|
|||
110 | onClicked: axis.niceNumbersEnabled = !axis.niceNumbersEnabled; |
|
|||
111 | } |
|
|||
112 |
|
108 | |||
113 | FontEditor { |
|
109 | FontEditor { | |
114 | id: fontEditor |
|
110 | id: fontEditor |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now