summaryrefslogtreecommitdiffstats
path: root/examples/widget/main.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2013-08-28 14:55:50 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2013-08-29 08:24:43 +0300
commit89007c36f04fb965167501a0d473451976548da3 (patch)
tree7289354f1ed9b63ec14d78cd6664dd0d0bbba8af /examples/widget/main.cpp
parent5bbd3b72540fd24ecb4538627e01bffe3d03acc6 (diff)
Make axes ownership more useful
Chart can now own multiple axes while showing only one. Default axes are no longer modifiable by users. Task-number: QTRD-2212 Change-Id: I028f0d7539dbbf6e3474680290c7ec6bba5a4223 Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples/widget/main.cpp')
-rw-r--r--examples/widget/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/widget/main.cpp b/examples/widget/main.cpp
index 3c0e44cf..84e1565e 100644
--- a/examples/widget/main.cpp
+++ b/examples/widget/main.cpp
@@ -98,6 +98,10 @@ int main(int argc, char **argv)
QPushButton *setSelectedBarButton = new QPushButton(widget);
setSelectedBarButton->setText(QStringLiteral("Select/deselect bar at (5,5)"));
+ QPushButton *swapAxisButton = new QPushButton(widget);
+ swapAxisButton->setText(QStringLiteral("Swap value axis"));
+ swapAxisButton->setEnabled(false);
+
QCheckBox *backgroundCheckBox = new QCheckBox(widget);
backgroundCheckBox->setText(QStringLiteral("Show background"));
backgroundCheckBox->setChecked(true);
@@ -196,6 +200,7 @@ int main(int argc, char **argv)
vLayout->addWidget(cameraButton, 0, Qt::AlignTop);
vLayout->addWidget(selectionButton, 0, Qt::AlignTop);
vLayout->addWidget(setSelectedBarButton, 0, Qt::AlignTop);
+ vLayout->addWidget(swapAxisButton, 0, Qt::AlignTop);
vLayout->addWidget(backgroundCheckBox);
vLayout->addWidget(gridCheckBox);
vLayout->addWidget(new QLabel(QStringLiteral("Adjust shadow quality")));
@@ -254,6 +259,8 @@ int main(int argc, char **argv)
&ChartModifier::changeSelectionMode);
QObject::connect(setSelectedBarButton, &QPushButton::clicked, modifier,
&ChartModifier::selectBar);
+ QObject::connect(swapAxisButton, &QPushButton::clicked, modifier,
+ &ChartModifier::swapAxis);
QObject::connect(fontList, &QFontComboBox::currentFontChanged, modifier,
&ChartModifier::changeFont);
@@ -290,6 +297,8 @@ int main(int argc, char **argv)
&QSlider::setEnabled);
QObject::connect(staticCheckBox, &QCheckBox::stateChanged, sampleSliderZ,
&QSlider::setEnabled);
+ QObject::connect(staticCheckBox, &QCheckBox::stateChanged, swapAxisButton,
+ &QSlider::setEnabled);
QObject::connect(staticCheckBox, &QCheckBox::stateChanged, modifier, &ChartModifier::restart);
modifier->start();