From 7bc0b11a81b7cd1eccd48c222e4fa96dda0182cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Tue, 24 Sep 2013 11:30:10 +0300 Subject: Gradient setting API added to Surface Task-number: QTRD-2288 Change-Id: Ibe8db55cb0435db71c1d2a9081e2dab746b46c07 Reviewed-by: Miikka Heikkinen --- src/datavisualization/engine/q3dsurface.cpp | 32 +++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'src/datavisualization/engine/q3dsurface.cpp') diff --git a/src/datavisualization/engine/q3dsurface.cpp b/src/datavisualization/engine/q3dsurface.cpp index e066f717..78ec70d4 100644 --- a/src/datavisualization/engine/q3dsurface.cpp +++ b/src/datavisualization/engine/q3dsurface.cpp @@ -197,6 +197,11 @@ QT_DATAVISUALIZATION_BEGIN_NAMESPACE * Label format of single item labels, e.g. a selected bar. */ +/*! + * \qmlproperty var Surface3D::gradient + * The current surface gradient. Setting this property replaces the previous gradient. + */ + /*! * Constructs a new 3D surface window. */ @@ -307,17 +312,24 @@ bool Q3DSurface::isBackgroundVisible() const } /*! - * Sets a predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeQt by + * \property Q3DSurface::theme + * + * A predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeQt by * default. Theme affects label colors, text color, background color, window color and * grid color. Lighting is also adjusted by themes. * - * \warning This method is subject to change. + * \warning This property is subject to change. */ void Q3DSurface::setTheme(QDataVis::ColorTheme theme) { d_ptr->m_shared->setColorTheme(theme); } +QDataVis::ColorTheme Q3DSurface::theme() const +{ + return d_ptr->m_shared->theme().colorTheme(); +} + /*! * \property Q3DSurface::shadowQuality * @@ -371,6 +383,22 @@ bool Q3DSurface::isSurfaceGridEnabled() const return d_ptr->m_shared->surfaceGrid(); } +/*! + * \property Q3DSurface::gradient + * + * The current surface gradient. Setting this property replaces the previous gradient with + * the given \a gradient. + */ +void Q3DSurface::setGradient(const QLinearGradient &gradient) +{ + d_ptr->m_shared->setGradient(gradient); +} + +QLinearGradient Q3DSurface::gradient() const +{ + return d_ptr->m_shared->gradient(); +} + /*! * \property Q3DSurface::font * -- cgit v1.2.3