diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-03 19:55:51 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-05 16:54:53 +0000 |
commit | 3514aedbf36b96f6e03f88c9c7814b6ba50aac8f (patch) | |
tree | 12b217941ade632b464a365acf3dc6be7ce8509d /src/widgets/doc/snippets/dockwidgets | |
parent | b76a923a8e81f5fabe6e48ed467e5326275fae4e (diff) |
QtWidgets documentation: cleanup
Cleanup the QtWidgets documentation:
- use new signal/slot syntax
- use range-based for loop instead foreach
Change-Id: I621b1ddac108d3df676209241d93d9b4f04a25fe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/widgets/doc/snippets/dockwidgets')
-rw-r--r-- | src/widgets/doc/snippets/dockwidgets/mainwindow.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/doc/snippets/dockwidgets/mainwindow.cpp b/src/widgets/doc/snippets/dockwidgets/mainwindow.cpp index f6959cc12b..53f91589bf 100644 --- a/src/widgets/doc/snippets/dockwidgets/mainwindow.cpp +++ b/src/widgets/doc/snippets/dockwidgets/mainwindow.cpp @@ -48,7 +48,7 @@ ** ****************************************************************************/ -#include <QtGui> +#include <QtWidgets> #include "mainwindow.h" @@ -63,8 +63,8 @@ MainWindow::MainWindow(QWidget *parent) textBrowser = new QTextBrowser(this); - connect(headingList, SIGNAL(itemClicked(QListWidgetItem*)), - this, SLOT(updateText(QListWidgetItem*))); + connect(headingList, &QListWidget::itemClicked, + this, &MainWindow::updateText); updateText(headingList->item(0)); headingList->setCurrentRow(0); @@ -119,7 +119,7 @@ void MainWindow::setupMenus() QAction *exitAct = new QAction(tr("E&xit"), this); exitAct->setShortcut(tr("Ctrl+Q")); exitAct->setStatusTip(tr("Exit the application")); - connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows())); + connect(exitAct, &QAction::triggered, qApp, &QApplication::closeAllWindows); QMenu *fileMenu = menuBar()->addMenu(tr("&File")); fileMenu->addAction(exitAct); |