summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-05-05 07:24:39 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-05-05 14:27:01 +0000
commit4b167ea939d8210982b0bdde17b73d9c9c8f1d4f (patch)
tree248d779db9ab107536dbc462e9bc94237dfd6db9 /examples
parent207e4468e700ef615a79bdd1b3bcf8a42d5c1d10 (diff)
downloadqtsvg-4b167ea939d8210982b0bdde17b73d9c9c8f1d4f.tar.gz
svggenerator example: Remove custom slot definitions
They are a rather obscure feature of Qt Designer and should not be used in examples. Remove custom slot definitions of the form class and move the connections to C++. Pick-to: 5.15 Change-Id: Ice068ecf269efaf5060d2457096417c7d0df0346 Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/svg/svggenerator/forms/window.ui72
-rw-r--r--examples/svg/svggenerator/window.cpp4
2 files changed, 4 insertions, 72 deletions
diff --git a/examples/svg/svggenerator/forms/window.ui b/examples/svg/svggenerator/forms/window.ui
index bf11908..13b613b 100644
--- a/examples/svg/svggenerator/forms/window.ui
+++ b/examples/svg/svggenerator/forms/window.ui
@@ -174,76 +174,4 @@
</customwidget>
</customwidgets>
<resources/>
- <connections>
- <connection>
- <sender>shapeComboBox</sender>
- <signal>currentIndexChanged(int)</signal>
- <receiver>Window</receiver>
- <slot>updateShape(int)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>288</x>
- <y>232</y>
- </hint>
- <hint type="destinationlabel">
- <x>336</x>
- <y>234</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>colorButton</sender>
- <signal>clicked()</signal>
- <receiver>Window</receiver>
- <slot>updateColor()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>301</x>
- <y>262</y>
- </hint>
- <hint type="destinationlabel">
- <x>337</x>
- <y>267</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>shapeComboBox_2</sender>
- <signal>currentIndexChanged(int)</signal>
- <receiver>Window</receiver>
- <slot>updateBackground(int)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>306</x>
- <y>299</y>
- </hint>
- <hint type="destinationlabel">
- <x>337</x>
- <y>311</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>toolButton_2</sender>
- <signal>clicked()</signal>
- <receiver>Window</receiver>
- <slot>saveSvg()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>298</x>
- <y>336</y>
- </hint>
- <hint type="destinationlabel">
- <x>307</x>
- <y>348</y>
- </hint>
- </hints>
- </connection>
- </connections>
- <slots>
- <slot>updateBackground(int)</slot>
- <slot>updateColor()</slot>
- <slot>updateShape(int)</slot>
- <slot>saveSvg()</slot>
- </slots>
</ui>
diff --git a/examples/svg/svggenerator/window.cpp b/examples/svg/svggenerator/window.cpp
index 0cba3e7..7f7ac7c 100644
--- a/examples/svg/svggenerator/window.cpp
+++ b/examples/svg/svggenerator/window.cpp
@@ -59,6 +59,10 @@ Window::Window(QWidget *parent)
: QWidget(parent)
{
setupUi(this);
+ connect(shapeComboBox, &QComboBox::currentIndexChanged, this, &Window::updateShape);
+ connect(colorButton, &QToolButton::clicked, this, &Window::updateColor);
+ connect(shapeComboBox_2, &QComboBox::currentIndexChanged, this, &Window::updateBackground);
+ connect(toolButton_2, &QToolButton::clicked, this, &Window::saveSvg);
}
void Window::updateBackground(int background)