diff --git a/src/axis/qabstractaxis.cpp b/src/axis/qabstractaxis.cpp index 45771eb..f3669b5 100644 --- a/src/axis/qabstractaxis.cpp +++ b/src/axis/qabstractaxis.cpp @@ -84,6 +84,11 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \property QAbstractAxis::linePen + The pen of the line. +*/ + +/*! \property QAbstractAxis::labelsVisible Defines if axis labels are visible. */ @@ -93,6 +98,16 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \property QAbstractAxis::labelsPen + The pen of the labels. +*/ + +/*! + \property QAbstractAxis::labelsBrush + The brush of the labels. +*/ + +/*! \property QAbstractAxis::visible The visibility of the axis. */ @@ -120,6 +135,11 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \property QAbstractAxis::gridLinePen + The pen of the grid line. +*/ + +/*! \property QAbstractAxis::labelsFont The font of the axis labels. */ @@ -177,6 +197,16 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \property QAbstractAxis::shadesPen + The pen of the axis shades (area between grid lines). +*/ + +/*! + \property QAbstractAxis::shadesBrush + The brush of the axis shades (area between grid lines). +*/ + +/*! \property QAbstractAxis::titleVisible The visibility of the axis title. By default the value is true. */ @@ -186,21 +216,40 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \property QAbstractAxis::titleText + The title of the axis. Empty by default. +*/ +/*! + \qmlproperty String AbstractAxis::titleText + The title of the axis. Empty by default. +*/ + +/*! + \property QAbstractAxis::titlePen + The pen of the title text. +*/ + +/*! + \property QAbstractAxis::titleBrush + The brush of the title text. +*/ + +/*! \property QAbstractAxis::titleFont The font of the title of the axis. */ /*! - \qmlproperty Font AbstractAxis::title + \qmlproperty Font AbstractAxis::titleFont The font of the title of the axis. */ /*! - \property QAbstractAxis::title - The title of the axis. Empty by default. + \property QAbstractAxis::orientation + The orientation of the axis. Fixed to either Qt::Horizontal or Qt::Vertical when you add the axis to a chart. */ /*! - \qmlproperty string AbstractAxis::title - The title of the axis. Empty string by default. + \qmlproperty Qt.Orientation AbstractAxis::orientation + The orientation of the axis. Fixed to either Qt.Horizontal or Qt.Vertical when the axis is set to a Chart/Series. */ /*! @@ -222,6 +271,11 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \fn void QAbstractAxis::linePenChanged(const QPen& pen) + The pen of the line of the axis has changed to \a pen. +*/ + +/*! \fn void QAbstractAxis::lineVisibleChanged(bool visible) Visibility of the axis line has changed to \a visible. */ @@ -240,6 +294,34 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \fn void QAbstractAxis::labelsFontChanged(const QFont& font) + The font of the axis labels has changed to \a font. +*/ +/*! + \qmlsignal AbstractAxis::onLabelsFontChanged(Font font) + The font of the axis labels has changed to \a font. +*/ + +/*! + \fn void QAbstractAxis::labelsPenChanged(const QPen& pen) + The pen of the axis labels has changed to \a pen. +*/ + +/*! + \fn void QAbstractAxis::labelsBrushChanged(const QBrush& brush) + The brush of the axis labels has changed to \a brush. +*/ + +/*! + \fn void QAbstractAxis::labelsAngleChanged(int angle) + The angle of the axis labels has changed to \a angle. +*/ +/*! + \qmlsignal AbstractAxis::onLabelsAngleChanged(int angle) + The angle of the axis labels has changed to \a angle. +*/ + +/*! \fn void QAbstractAxis::gridVisibleChanged(bool visible) Visibility of the grid lines of the axis has changed to \a visible. */ @@ -249,6 +331,11 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \fn void QAbstractAxis::gridLinePenChanged(const QPen& pen) + The pen of the grid line has changed to \a pen. +*/ + +/*! \fn void QAbstractAxis::colorChanged(QColor color) Emitted if the \a color of the axis is changed. */ @@ -267,6 +354,43 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \fn void QAbstractAxis::titleVisibleChanged(bool visible) + Visibility of the title text of the axis has changed to \a visible. +*/ +/*! + \qmlsignal AbstractAxis::onTitleVisibleChanged(bool visible) + Visibility of the title text of the axis has changed to \a visible. +*/ + +/*! + \fn void QAbstractAxis::titleTextChanged(const QString& text) + The text of the axis title has changed to \a text. +*/ +/*! + \qmlsignal AbstractAxis::onTitleTextChanged(String text) + The text of the axis title has changed to \a text. +*/ + +/*! + \fn void QAbstractAxis::titlePenChanged(const QPen& pen) + The pen of the axis shades has changed to \a pen. +*/ + +/*! + \fn void QAbstractAxis::titleBrushChanged(const QBrush& brush) + The brush of the axis title has changed to \a brush. +*/ + +/*! + \fn void QAbstractAxis::titleFontChanged(const QFont& font) + The font of the axis title has changed to \a font. +*/ +/*! + \qmlsignal AbstractAxis::onTitleFontChanged(Font font) + The font of the axis title has changed to \a font. +*/ + +/*! \fn void QAbstractAxis::shadesVisibleChanged(bool) Emitted if the visibility of the axis shades is changed to \a visible. */ @@ -294,6 +418,16 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \fn void QAbstractAxis::shadesBrushChanged(const QBrush& brush) + The brush of the axis shades has changed to \a brush. +*/ + +/*! + \fn void QAbstractAxis::shadesPenChanged(const QPen& pen) + The pen of the axis shades has changed to \a pen. +*/ + +/*! \internal Constructs new axis object which is a child of \a parent. Ownership is taken by QChart when axis added. diff --git a/src/axis/qabstractaxis.h b/src/axis/qabstractaxis.h index 2675c1f..845b30c 100644 --- a/src/axis/qabstractaxis.h +++ b/src/axis/qabstractaxis.h @@ -38,23 +38,20 @@ class QTCOMMERCIALCHART_EXPORT QAbstractAxis : public QObject //arrow Q_PROPERTY(bool lineVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged) Q_PROPERTY(QPen linePen READ linePen WRITE setLinePen NOTIFY linePenChanged) - //TODO: make wrapping of color for qml Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged) //labels Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged) - Q_PROPERTY(QPen lablesPen READ labelsPen WRITE setLabelsPen NOTIFY labelsPenChanged) - Q_PROPERTY(QBrush lablesBrush READ labelsBrush WRITE setLabelsBrush NOTIFY labelsBrushChanged) + Q_PROPERTY(QPen labelsPen READ labelsPen WRITE setLabelsPen NOTIFY labelsPenChanged) + Q_PROPERTY(QBrush labelsBrush READ labelsBrush WRITE setLabelsBrush NOTIFY labelsBrushChanged) //TODO: fix labels angles to work with layout Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged) Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont NOTIFY labelsFontChanged) - //TODO: make wrapping of color for qml Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged) //grid Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged) - Q_PROPERTY(QPen girdLinePen READ gridLinePen WRITE setGridLinePen NOTIFY gridLinePenChanged) + Q_PROPERTY(QPen gridLinePen READ gridLinePen WRITE setGridLinePen NOTIFY gridLinePenChanged) //shades Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged) - //TODO: make wrapping of color for qml Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged) //TODO: make wrapping of border for qml Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged) @@ -173,14 +170,14 @@ Q_SIGNALS: void labelsColorChanged(QColor color); void titleTextChanged(const QString& title); void titlePenChanged(const QPen& pen); - void titleBrushChanged(const QBrush brush); + void titleBrushChanged(const QBrush& brush); void titleVisibleChanged(bool visible); void titleFontChanged(const QFont& font); void shadesVisibleChanged(bool visible); void shadesColorChanged(QColor color); void shadesBorderColorChanged(QColor color); void shadesPenChanged(const QPen& pen); - void shadesBrushChanged(const QBrush brush); + void shadesBrushChanged(const QBrush& brush); protected: QScopedPointer d_ptr; diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml b/tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml index a532e33..e376f83 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml @@ -28,22 +28,23 @@ Row { Flow { spacing: 5 flow: Flow.TopToBottom + height: parent.height Button { text: "axis visible" onClicked: axis.visible = !axis.visible; } Button { - text: "axis grid visible" - onClicked: axis.gridVisible = !axis.gridVisible; + text: "axis line visible" + onClicked: axis.lineVisible = !axis.lineVisible; } Button { text: "axis color" onClicked: axis.color = main.nextColor(); } Button { - text: "axis labels color" - onClicked: axis.labelsColor = main.nextColor(); + text: "axis labels visible" + onClicked: axis.labelsVisible = !axis.labelsVisible; } Button { text: "axis labels angle +" @@ -54,6 +55,14 @@ Row { onClicked: axis.labelsAngle -= 5; } Button { + text: "axis labels color" + onClicked: axis.labelsColor = main.nextColor(); + } + Button { + text: "axis grid visible" + onClicked: axis.gridVisible = !axis.gridVisible; + } + Button { text: "axis shades visible" onClicked: axis.shadesVisible = !axis.shadesVisible; } @@ -66,6 +75,14 @@ Row { onClicked: axis.shadesBorderColor = main.nextColor(); } Button { + text: "axis title text" + onClicked: axis.titleText = axis.titleText + "X"; + } + Button { + text: "axis title visible" + onClicked: axis.titleVisible = !axis.titleVisible; + } + Button { text: "axis max +" onClicked: axis.max += 0.1; } @@ -94,13 +111,21 @@ Row { text: "axis nice nmb" onClicked: axis.niceNumbersEnabled = !axis.niceNumbersEnabled; } - } - FontEditor { - id: fontEditor - fontDescription: "axis" - function editedFont() { - return axis.labelsFont; + FontEditor { + id: fontEditor + fontDescription: "axis" + function editedFont() { + return axis.labelsFont; + } + } + + FontEditor { + id: titleFontEditor + fontDescription: "title" + function editedFont() { + return axis.titleFont; + } } } }