diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-05-05 07:24:39 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-05-18 16:06:53 +0200 |
commit | c2d3f2833a3480d1254233a1c2a567b4e6b8bfdd (patch) | |
tree | 62350711df62cbfdaf8b27677f73ca287e9d6203 | |
parent | d882e195406ccedd418f529ecf6320659abf0b5e (diff) | |
download | qtsvg-c2d3f2833a3480d1254233a1c2a567b4e6b8bfdd.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++.
Change-Id: Ice068ecf269efaf5060d2457096417c7d0df0346
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 4b167ea939d8210982b0bdde17b73d9c9c8f1d4f)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r-- | examples/svg/svggenerator/forms/window.ui | 72 | ||||
-rw-r--r-- | examples/svg/svggenerator/window.cpp | 6 |
2 files changed, 6 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..3b983dd 100644 --- a/examples/svg/svggenerator/window.cpp +++ b/examples/svg/svggenerator/window.cpp @@ -59,6 +59,12 @@ Window::Window(QWidget *parent) : QWidget(parent) { setupUi(this); + connect(shapeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), + this, &Window::updateShape); + connect(colorButton, &QToolButton::clicked, this, &Window::updateColor); + connect(shapeComboBox_2, QOverload<int>::of(&QComboBox::currentIndexChanged), + this, &Window::updateBackground); + connect(toolButton_2, &QToolButton::clicked, this, &Window::saveSvg); } void Window::updateBackground(int background) |