From c2d3f2833a3480d1254233a1c2a567b4e6b8bfdd Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 5 May 2020 07:24:39 +0200 Subject: 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 (cherry picked from commit 4b167ea939d8210982b0bdde17b73d9c9c8f1d4f) Reviewed-by: Volker Hilsheimer --- examples/svg/svggenerator/forms/window.ui | 72 ------------------------------- 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 @@ - - - shapeComboBox - currentIndexChanged(int) - Window - updateShape(int) - - - 288 - 232 - - - 336 - 234 - - - - - colorButton - clicked() - Window - updateColor() - - - 301 - 262 - - - 337 - 267 - - - - - shapeComboBox_2 - currentIndexChanged(int) - Window - updateBackground(int) - - - 306 - 299 - - - 337 - 311 - - - - - toolButton_2 - clicked() - Window - saveSvg() - - - 298 - 336 - - - 307 - 348 - - - - - - updateBackground(int) - updateColor() - updateShape(int) - saveSvg() - 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::of(&QComboBox::currentIndexChanged), + this, &Window::updateShape); + connect(colorButton, &QToolButton::clicked, this, &Window::updateColor); + connect(shapeComboBox_2, QOverload::of(&QComboBox::currentIndexChanged), + this, &Window::updateBackground); + connect(toolButton_2, &QToolButton::clicked, this, &Window::saveSvg); } void Window::updateBackground(int background) -- cgit v1.2.1