summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tools/undoframework
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-12-07 14:17:38 +0100
committerLuca Beldi <v.ronin@yahoo.it>2019-01-03 08:29:56 +0000
commit8c04aab8966611e96c64f469b7a1c6afe67e3fca (patch)
tree40fe2bc3f4d945a65828d49586292ea6c72440a1 /examples/widgets/tools/undoframework
parent451ebdff824cad329b40aad9a10cec5e5cb464cc (diff)
Cleanup Widgets examples - new signal/slot syntax
Cleanup the Widget examples - use the new signal/slot syntax where possible - layout, statemachine, tools and touch subdirectory Change-Id: I466b309b643ef7ffc27be7591fa10f4c75cfd3f8 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'examples/widgets/tools/undoframework')
-rw-r--r--examples/widgets/tools/undoframework/mainwindow.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/examples/widgets/tools/undoframework/mainwindow.cpp b/examples/widgets/tools/undoframework/mainwindow.cpp
index b2f5405b73..e95d50d164 100644
--- a/examples/widgets/tools/undoframework/mainwindow.cpp
+++ b/examples/widgets/tools/undoframework/mainwindow.cpp
@@ -70,8 +70,8 @@ MainWindow::MainWindow()
diagramScene->setBackgroundBrush(pixmapBrush);
diagramScene->setSceneRect(QRect(0, 0, 500, 500));
- connect(diagramScene, SIGNAL(itemMoved(DiagramItem*,QPointF)),
- this, SLOT(itemMoved(DiagramItem*,QPointF)));
+ connect(diagramScene, &DiagramScene::itemMoved,
+ this, &MainWindow::itemMoved);
setWindowTitle("Undo Framework");
QGraphicsView *view = new QGraphicsView(diagramScene);
@@ -95,18 +95,18 @@ void MainWindow::createActions()
{
deleteAction = new QAction(tr("&Delete Item"), this);
deleteAction->setShortcut(tr("Del"));
- connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteItem()));
+ connect(deleteAction, &QAction::triggered, this, &MainWindow::deleteItem);
//! [2] //! [3]
//! [3] //! [4]
addBoxAction = new QAction(tr("Add &Box"), this);
//! [4]
addBoxAction->setShortcut(tr("Ctrl+O"));
- connect(addBoxAction, SIGNAL(triggered()), this, SLOT(addBox()));
+ connect(addBoxAction, &QAction::triggered, this, &MainWindow::addBox);
addTriangleAction = new QAction(tr("Add &Triangle"), this);
addTriangleAction->setShortcut(tr("Ctrl+T"));
- connect(addTriangleAction, SIGNAL(triggered()), this, SLOT(addTriangle()));
+ connect(addTriangleAction, &QAction::triggered, this, &MainWindow::addTriangle);
//! [5]
undoAction = undoStack->createUndoAction(this, tr("&Undo"));
@@ -118,13 +118,13 @@ void MainWindow::createActions()
exitAction = new QAction(tr("E&xit"), this);
exitAction->setShortcuts(QKeySequence::Quit);
- connect(exitAction, SIGNAL(triggered()), this, SLOT(close()));
+ connect(exitAction, &QAction::triggered, this, &QWidget::close);
aboutAction = new QAction(tr("&About"), this);
QList<QKeySequence> aboutShortcuts;
aboutShortcuts << tr("Ctrl+A") << tr("Ctrl+B");
aboutAction->setShortcuts(aboutShortcuts);
- connect(aboutAction, SIGNAL(triggered()), this, SLOT(about()));
+ connect(aboutAction, &QAction::triggered, this, &MainWindow::about);
}
//! [6]
@@ -140,10 +140,10 @@ void MainWindow::createMenus()
editMenu->addAction(redoAction);
editMenu->addSeparator();
editMenu->addAction(deleteAction);
- connect(editMenu, SIGNAL(aboutToShow()),
- this, SLOT(itemMenuAboutToShow()));
- connect(editMenu, SIGNAL(aboutToHide()),
- this, SLOT(itemMenuAboutToHide()));
+ connect(editMenu, &QMenu::aboutToShow,
+ this, &MainWindow::itemMenuAboutToShow);
+ connect(editMenu, &QMenu::aboutToHide,
+ this, &MainWindow::itemMenuAboutToHide);
//! [7]
itemMenu = menuBar()->addMenu(tr("&Item"));