summaryrefslogtreecommitdiffstats
path: root/examples/widgets/richtext
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/richtext')
-rw-r--r--examples/widgets/richtext/calendar/mainwindow.cpp10
-rw-r--r--examples/widgets/richtext/orderform/mainwindow.cpp2
-rw-r--r--examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp13
3 files changed, 15 insertions, 10 deletions
diff --git a/examples/widgets/richtext/calendar/mainwindow.cpp b/examples/widgets/richtext/calendar/mainwindow.cpp
index 38dc0e2849..3ddb1cf7ad 100644
--- a/examples/widgets/richtext/calendar/mainwindow.cpp
+++ b/examples/widgets/richtext/calendar/mainwindow.cpp
@@ -86,10 +86,12 @@ MainWindow::MainWindow()
//! [2]
//! [3]
- connect(monthCombo, SIGNAL(activated(int)), this, SLOT(setMonth(int)));
- connect(yearEdit, SIGNAL(dateChanged(QDate)), this, SLOT(setYear(QDate)));
- connect(fontSizeSpinBox, SIGNAL(valueChanged(int)),
- this, SLOT(setFontSize(int)));
+ connect(monthCombo, QOverload<int>::of(&QComboBox::activated),
+ this, &MainWindow::setMonth);
+ connect(yearEdit, &QDateTimeEdit::dateChanged,
+ this, &MainWindow::setYear);
+ connect(fontSizeSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ this, &MainWindow::setFontSize);
//! [3]
fontSizeSpinBox->setValue(10);
diff --git a/examples/widgets/richtext/orderform/mainwindow.cpp b/examples/widgets/richtext/orderform/mainwindow.cpp
index b207ee4dbc..291c37edf6 100644
--- a/examples/widgets/richtext/orderform/mainwindow.cpp
+++ b/examples/widgets/richtext/orderform/mainwindow.cpp
@@ -66,7 +66,7 @@ MainWindow::MainWindow()
QMenu *fileMenu = new QMenu(tr("&File"), this);
QAction *newAction = fileMenu->addAction(tr("&New..."));
newAction->setShortcuts(QKeySequence::New);
- printAction = fileMenu->addAction(tr("&Print..."), this, SLOT(printFile()));
+ printAction = fileMenu->addAction(tr("&Print..."), this, &MainWindow::printFile);
printAction->setShortcuts(QKeySequence::Print);
printAction->setEnabled(false);
QAction *quitAction = fileMenu->addAction(tr("E&xit"));
diff --git a/examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp b/examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp
index dd58f1f45b..2dba0ba73e 100644
--- a/examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp
+++ b/examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp
@@ -117,9 +117,12 @@ void MainWindow::setupFileMenu()
QMenu *fileMenu = new QMenu(tr("&File"), this);
menuBar()->addMenu(fileMenu);
- fileMenu->addAction(tr("&New"), this, SLOT(newFile()), QKeySequence::New);
- fileMenu->addAction(tr("&Open..."), this, SLOT(openFile()), QKeySequence::Open);
- fileMenu->addAction(tr("E&xit"), qApp, SLOT(quit()), QKeySequence::Quit);
+ fileMenu->addAction(tr("&New"), this,
+ &MainWindow::newFile, QKeySequence::New);
+ fileMenu->addAction(tr("&Open..."),
+ this, [this](){ openFile(); }, QKeySequence::Open);
+ fileMenu->addAction(tr("E&xit"), qApp,
+ &QApplication::quit, QKeySequence::Quit);
}
void MainWindow::setupHelpMenu()
@@ -127,6 +130,6 @@ void MainWindow::setupHelpMenu()
QMenu *helpMenu = new QMenu(tr("&Help"), this);
menuBar()->addMenu(helpMenu);
- helpMenu->addAction(tr("&About"), this, SLOT(about()));
- helpMenu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt()));
+ helpMenu->addAction(tr("&About"), this, &MainWindow::about);
+ helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
}