summaryrefslogtreecommitdiffstats
path: root/examples/widget/main.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2013-08-12 14:26:41 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2013-08-13 07:43:29 +0300
commit018b9855f394271fa20f3e65fc1ca71c90f32384 (patch)
tree03314821a6808a26555f4ba01c8c91bc5e4b5662 /examples/widget/main.cpp
parentd67c87ec3deb99d52eaa71d1272d72ae77da6216 (diff)
Add some missing data manipulation methods to bar proxy
+ Related widget example changes + Changed shadow perspective to get rid of some artifacts + Accessor for sample space size Change-Id: I7c4d7038479b65016209624d8e2ea77794210005 Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples/widget/main.cpp')
-rw-r--r--examples/widget/main.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/examples/widget/main.cpp b/examples/widget/main.cpp
index 9614cc0f..1c537de5 100644
--- a/examples/widget/main.cpp
+++ b/examples/widget/main.cpp
@@ -82,6 +82,26 @@ int main(int argc, char **argv)
multiDataButton->setText(QStringLiteral("Insert many rows of data"));
multiDataButton->setEnabled(false);
+ QPushButton *changeSingleDataButton = new QPushButton(widget);
+ changeSingleDataButton->setText(QStringLiteral("Change selected bar value"));
+ changeSingleDataButton->setEnabled(false);
+
+ QPushButton *changeRowButton = new QPushButton(widget);
+ changeRowButton->setText(QStringLiteral("Change selected row values"));
+ changeRowButton->setEnabled(false);
+
+ QPushButton *changeRowsButton = new QPushButton(widget);
+ changeRowsButton->setText(QStringLiteral("Change three rows from selected"));
+ changeRowsButton->setEnabled(false);
+
+ QPushButton *removeRowButton = new QPushButton(widget);
+ removeRowButton->setText(QStringLiteral("Remove selected row"));
+ removeRowButton->setEnabled(false);
+
+ QPushButton *removeRowsButton = new QPushButton(widget);
+ removeRowsButton->setText(QStringLiteral("remove three rows from selected"));
+ removeRowsButton->setEnabled(false);
+
QPushButton *themeButton = new QPushButton(widget);
themeButton->setText(QStringLiteral("Change theme"));
@@ -190,6 +210,11 @@ int main(int argc, char **argv)
vLayout->addWidget(sampleSliderZ, 1, Qt::AlignTop);
vLayout->addWidget(dataButton, 0, Qt::AlignTop);
vLayout->addWidget(multiDataButton, 0, Qt::AlignTop);
+ vLayout->addWidget(changeSingleDataButton, 0, Qt::AlignTop);
+ vLayout->addWidget(changeRowButton, 0, Qt::AlignTop);
+ vLayout->addWidget(changeRowsButton, 0, Qt::AlignTop);
+ vLayout->addWidget(removeRowButton, 0, Qt::AlignTop);
+ vLayout->addWidget(removeRowsButton, 0, Qt::AlignTop);
vLayout->addWidget(themeButton, 0, Qt::AlignTop);
vLayout->addWidget(labelButton, 0, Qt::AlignTop);
vLayout->addWidget(styleButton, 0, Qt::AlignTop);
@@ -243,6 +268,11 @@ int main(int argc, char **argv)
&ChartModifier::changeTransparency);
QObject::connect(dataButton, &QPushButton::clicked, modifier, &ChartModifier::addRow);
QObject::connect(multiDataButton, &QPushButton::clicked, modifier, &ChartModifier::addRows);
+ QObject::connect(changeSingleDataButton, &QPushButton::clicked, modifier, &ChartModifier::changeItem);
+ QObject::connect(changeRowButton, &QPushButton::clicked, modifier, &ChartModifier::changeRow);
+ QObject::connect(changeRowsButton, &QPushButton::clicked, modifier, &ChartModifier::changeRows);
+ QObject::connect(removeRowButton, &QPushButton::clicked, modifier, &ChartModifier::removeRow);
+ QObject::connect(removeRowsButton, &QPushButton::clicked, modifier, &ChartModifier::removeRows);
QObject::connect(selectionButton, &QPushButton::clicked, modifier,
&ChartModifier::changeSelectionMode);
@@ -267,6 +297,16 @@ int main(int argc, char **argv)
&QPushButton::setEnabled);
QObject::connect(staticCheckBox, &QCheckBox::stateChanged, multiDataButton,
&QPushButton::setEnabled);
+ QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeSingleDataButton,
+ &QPushButton::setEnabled);
+ QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeRowButton,
+ &QPushButton::setEnabled);
+ QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeRowsButton,
+ &QPushButton::setEnabled);
+ QObject::connect(staticCheckBox, &QCheckBox::stateChanged, removeRowButton,
+ &QPushButton::setEnabled);
+ QObject::connect(staticCheckBox, &QCheckBox::stateChanged, removeRowsButton,
+ &QPushButton::setEnabled);
QObject::connect(staticCheckBox, &QCheckBox::stateChanged, sampleSliderX,
&QSlider::setEnabled);
QObject::connect(staticCheckBox, &QCheckBox::stateChanged, sampleSliderZ,