diff options
author | Tomi Korpipää <tomi.korpipaa@digia.com> | 2013-09-24 11:30:10 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@digia.com> | 2013-09-24 11:32:14 +0300 |
commit | 7bc0b11a81b7cd1eccd48c222e4fa96dda0182cc (patch) | |
tree | 0eeda58cd8ec8641e91328c1adea6c8221eca06c /src/datavisualization/engine/q3dsurface.cpp | |
parent | f842e21c7fa44d806c06a1463c723632b10e6172 (diff) |
Gradient setting API added to Surface
Task-number: QTRD-2288
Change-Id: Ibe8db55cb0435db71c1d2a9081e2dab746b46c07
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'src/datavisualization/engine/q3dsurface.cpp')
-rw-r--r-- | src/datavisualization/engine/q3dsurface.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
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 @@ -198,6 +198,11 @@ QT_DATAVISUALIZATION_BEGIN_NAMESPACE */ /*! + * \qmlproperty var Surface3D::gradient + * The current surface gradient. Setting this property replaces the previous gradient. + */ + +/*! * Constructs a new 3D surface window. */ Q3DSurface::Q3DSurface() @@ -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 * @@ -372,6 +384,22 @@ bool Q3DSurface::isSurfaceGridEnabled() const } /*! + * \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 * * Sets the \a font for labels. It is preset to \c Arial by default. |