summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/engine/q3dbars.cpp
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2013-11-05 09:43:49 +0200
committerTomi Korpipää <tomi.korpipaa@digia.com>2013-11-05 10:00:54 +0200
commit2cd0924e7f0147ecbba1197f7d0d32260434a2fd (patch)
treeff7b72fb9120daa7513ab93c47ba5bdd1b5a4b13 /src/datavisualization/engine/q3dbars.cpp
parenta6c8a0cca08b4f19c66b55c8c778229ea0b3c85d (diff)
Q_PROPERTY NOTIFY addition, part 2
Task-number: QTRD-2534 Change-Id: I243f1457aef986d54cb27a5a24b411b2291d8c0d Change-Id: I243f1457aef986d54cb27a5a24b411b2291d8c0d Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'src/datavisualization/engine/q3dbars.cpp')
-rw-r--r--src/datavisualization/engine/q3dbars.cpp43
1 files changed, 38 insertions, 5 deletions
diff --git a/src/datavisualization/engine/q3dbars.cpp b/src/datavisualization/engine/q3dbars.cpp
index 086bfc82..17a3a6ad 100644
--- a/src/datavisualization/engine/q3dbars.cpp
+++ b/src/datavisualization/engine/q3dbars.cpp
@@ -102,6 +102,22 @@ Q3DBars::Q3DBars()
{
setVisualController(d_ptr->m_shared);
d_ptr->m_shared->initializeOpenGL();
+ QObject::connect(d_ptr->m_shared, &Abstract3DController::selectionModeChanged, this,
+ &Q3DBars::selectionModeChanged);
+ QObject::connect(d_ptr->m_shared, &Abstract3DController::labelStyleChanged, this,
+ &Q3DBars::labelStyleChanged);
+ QObject::connect(d_ptr->m_shared, &Abstract3DController::shadowQualityChanged, this,
+ &Q3DBars::shadowQualityChanged);
+ QObject::connect(d_ptr->m_shared, &Abstract3DController::meshFileNameChanged, this,
+ &Q3DBars::meshFileNameChanged);
+ QObject::connect(d_ptr->m_shared, &Abstract3DController::fontChanged, this,
+ &Q3DBars::fontChanged);
+ QObject::connect(d_ptr->m_shared, &Abstract3DController::themeChanged, this,
+ &Q3DBars::themeChanged);
+ QObject::connect(d_ptr->m_shared, &Abstract3DController::gridVisibleChanged, this,
+ &Q3DBars::gridVisibleChanged);
+ QObject::connect(d_ptr->m_shared, &Abstract3DController::backgroundVisibleChanged, this,
+ &Q3DBars::backgroundVisibleChanged);
QObject::connect(d_ptr->m_shared, &Bars3DController::selectedBarChanged, this,
&Q3DBars::selectedBarChanged);
QObject::connect(d_ptr->m_shared, &Abstract3DController::needRender, this,
@@ -198,7 +214,10 @@ void Q3DBars::setHeight(const int height)
*/
void Q3DBars::setBarThickness(qreal thicknessRatio)
{
- d_ptr->m_shared->setBarSpecs(GLfloat(thicknessRatio), barSpacing(), isBarSpacingRelative());
+ if (thicknessRatio != barThickness()) {
+ d_ptr->m_shared->setBarSpecs(GLfloat(thicknessRatio), barSpacing(), isBarSpacingRelative());
+ emit barThicknessChanged(thicknessRatio);
+ }
}
qreal Q3DBars::barThickness()
@@ -216,7 +235,10 @@ qreal Q3DBars::barThickness()
*/
void Q3DBars::setBarSpacing(QSizeF spacing)
{
- d_ptr->m_shared->setBarSpecs(GLfloat(barThickness()), spacing, isBarSpacingRelative());
+ if (spacing != barSpacing()) {
+ d_ptr->m_shared->setBarSpecs(GLfloat(barThickness()), spacing, isBarSpacingRelative());
+ emit barSpacingChanged(spacing);
+ }
}
QSizeF Q3DBars::barSpacing()
@@ -233,7 +255,10 @@ QSizeF Q3DBars::barSpacing()
*/
void Q3DBars::setBarSpacingRelative(bool relative)
{
- d_ptr->m_shared->setBarSpecs(GLfloat(barThickness()), barSpacing(), relative);
+ if (relative != isBarSpacingRelative()) {
+ d_ptr->m_shared->setBarSpecs(GLfloat(barThickness()), barSpacing(), relative);
+ emit barSpacingRelativeChanged(relative);
+ }
}
bool Q3DBars::isBarSpacingRelative()
@@ -254,19 +279,27 @@ void Q3DBars::setBarType(QDataVis::MeshStyle style, bool smooth)
}
/*!
- * Sets a predefined \a theme from \c QDataVis::Theme. It is preset to \c QDataVis::ThemeQt by
- * default. Theme affects bar colors, label colors, text color, background color, window color and
+ * \property Q3DBars::theme
+ *
+ * A predefined \a theme from \c QDataVis::Theme. 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.
*
* \sa setBarColor()
*
* \preliminary
*/
+
void Q3DBars::setTheme(QDataVis::Theme theme)
{
d_ptr->m_shared->setTheme(theme);
}
+QDataVis::Theme Q3DBars::theme() const
+{
+ return d_ptr->m_shared->theme().theme();
+}
+
/*!
* Set bar color using your own color. \a baseColor sets the base color of a bar. The \a uniform
* -flag is used to define if color needs to be uniform throughout bar's length, or will the colors