diff options
Diffstat (limited to 'src')
7 files changed, 22 insertions, 27 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qtimer.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qtimer.cpp index 7dfd17a1f1..5edcaae755 100644 --- a/src/corelib/doc/snippets/code/src_corelib_kernel_qtimer.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qtimer.cpp @@ -8,7 +8,7 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QTimer::singleShot(600000, &app, SLOT(quit())); + QTimer::singleShot(600000, &app, QCoreApplication::quit); ... return app.exec(); } diff --git a/src/gui/doc/snippets/code/src_gui_kernel_qkeysequence.cpp b/src/gui/doc/snippets/code/src_gui_kernel_qkeysequence.cpp index 0e4c56d8a4..0f335dd0a0 100644 --- a/src/gui/doc/snippets/code/src_gui_kernel_qkeysequence.cpp +++ b/src/gui/doc/snippets/code/src_gui_kernel_qkeysequence.cpp @@ -32,7 +32,7 @@ void Wrapper::wrapper() { //! [2] QMenu *file = new QMenu(this); file->addAction(tr("&Open..."), QKeySequence(tr("Ctrl+O", "File|Open")), - this, SLOT(open())); + this, &MainWindow::open); //! [2] } // Wrapper::wrapper diff --git a/src/gui/doc/snippets/textdocument-listitems/mainwindow.cpp b/src/gui/doc/snippets/textdocument-listitems/mainwindow.cpp index 2bf6e4a018..324f1937d9 100644 --- a/src/gui/doc/snippets/textdocument-listitems/mainwindow.cpp +++ b/src/gui/doc/snippets/textdocument-listitems/mainwindow.cpp @@ -13,17 +13,17 @@ MainWindow::MainWindow() QMenu *fileMenu = new QMenu(tr("&File")); fileMenu->addAction(tr("E&xit"), QKeySequence(tr("Ctrl+Q", "File|Exit")), - this, SLOT(close())); + this, &QWidget::close); QMenu *actionsMenu = new QMenu(tr("&Actions")); actionsMenu->addAction(tr("&Highlight List Items"), - this, SLOT(highlightListItems())); - actionsMenu->addAction(tr("&Show Current List"), this, SLOT(showList())); + this, &MainWindow::highlightListItems); + actionsMenu->addAction(tr("&Show Current List"), this, &MainWindow::showList); QMenu *insertMenu = new QMenu(tr("&Insert")); insertMenu->addAction(tr("&List"), QKeySequence(tr("Ctrl+L", "Insert|List")), - this, SLOT(insertList())); + this, &MainWindow::insertList); menuBar()->addMenu(fileMenu); menuBar()->addMenu(insertMenu); diff --git a/src/gui/doc/snippets/textdocument-selections/mainwindow.cpp b/src/gui/doc/snippets/textdocument-selections/mainwindow.cpp index eefa0aa841..6e1d051d4b 100644 --- a/src/gui/doc/snippets/textdocument-selections/mainwindow.cpp +++ b/src/gui/doc/snippets/textdocument-selections/mainwindow.cpp @@ -9,30 +9,30 @@ MainWindow::MainWindow() QMenu *fileMenu = new QMenu(tr("&File")); fileMenu->addAction(tr("&Open..."), QKeySequence(tr("Ctrl+O", "File|Open")), - this, SLOT(openFile())); + this, &MainWindow::openFile); - QAction *quitAction = fileMenu->addAction(tr("E&xit"), this, SLOT(close())); + QAction *quitAction = fileMenu->addAction(tr("E&xit"), this, &MainWindow::close); quitAction->setShortcut(tr("Ctrl+Q")); QMenu *editMenu = new QMenu(tr("&Edit")); - cutAction = editMenu->addAction(tr("Cu&t"), this, SLOT(cutSelection())); + cutAction = editMenu->addAction(tr("Cu&t"), this, &MainWindow::cutSelection); cutAction->setShortcut(tr("Ctrl+X")); cutAction->setEnabled(false); - copyAction = editMenu->addAction(tr("&Copy"), this, SLOT(copySelection())); + copyAction = editMenu->addAction(tr("&Copy"), this, &MainWindow::copySelection); copyAction->setShortcut(tr("Ctrl+C")); copyAction->setEnabled(false); - pasteAction = editMenu->addAction(tr("&Paste"), this, SLOT(pasteSelection())); + pasteAction = editMenu->addAction(tr("&Paste"), this, &MainWindow::pasteSelection); pasteAction->setShortcut(tr("Ctrl+V")); pasteAction->setEnabled(false); QMenu *selectMenu = new QMenu(tr("&Select")); - selectMenu->addAction(tr("&Word"), this, SLOT(selectWord())); - selectMenu->addAction(tr("&Line"), this, SLOT(selectLine())); - selectMenu->addAction(tr("&Block"), this, SLOT(selectBlock())); - selectMenu->addAction(tr("&Frame"), this, SLOT(selectFrame())); + selectMenu->addAction(tr("&Word"), this, &MainWindow::selectWord); + selectMenu->addAction(tr("&Line"), this, &MainWindow::selectLine); + selectMenu->addAction(tr("&Block"), this, &MainWindow::selectBlock); + selectMenu->addAction(tr("&Frame"), this, &MainWindow::selectFrame); menuBar()->addMenu(fileMenu); menuBar()->addMenu(editMenu); diff --git a/src/network/doc/snippets/code/src_network_kernel_qdnslookup.cpp b/src/network/doc/snippets/code/src_network_kernel_qdnslookup.cpp index fdcc8b0ce4..ce976001bb 100644 --- a/src/network/doc/snippets/code/src_network_kernel_qdnslookup.cpp +++ b/src/network/doc/snippets/code/src_network_kernel_qdnslookup.cpp @@ -6,8 +6,7 @@ void MyObject::lookupServers() { // Create a DNS lookup. dns = new QDnsLookup(this); - connect(dns, SIGNAL(finished()), - this, SLOT(handleServers())); + connect(dns, &QDnsLookup::finished, this, &MyObject::handleServers); // Find the XMPP servers for gmail.com dns->setType(QDnsLookup::SRV); diff --git a/src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp b/src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp index b845e5bcc7..7c39827b94 100644 --- a/src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp +++ b/src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp @@ -3,12 +3,10 @@ //! [0] // To find the IP address of qt-project.org -QHostInfo::lookupHost("qt-project.org", - this, SLOT(printResults(QHostInfo))); +QHostInfo::lookupHost("qt-project.org", this, &MyWidget::printResults); // To find the host name for 4.2.2.1 -QHostInfo::lookupHost("4.2.2.1", - this, SLOT(printResults(QHostInfo))); +QHostInfo::lookupHost("4.2.2.1", this, &MyWidget::printResults); //! [0] @@ -18,8 +16,7 @@ QHostInfo info = QHostInfo::fromName("qt-project.org"); //! [2] -QHostInfo::lookupHost("www.kde.org", - this, SLOT(lookedUp(QHostInfo))); +QHostInfo::lookupHost("www.kde.org", this, &MyWidget::lookedUp); //! [2] @@ -39,8 +36,7 @@ void MyWidget::lookedUp(const QHostInfo &host) //! [4] -QHostInfo::lookupHost("4.2.2.1", - this, SLOT(lookedUp(QHostInfo))); +QHostInfo::lookupHost("4.2.2.1", this, &MyWidget::lookedUp); //! [4] diff --git a/src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp b/src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp index 6ad795fcb9..89d82d66f8 100644 --- a/src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp +++ b/src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp @@ -5,7 +5,7 @@ using namespace Qt::StringLiterals; //! [0] QSslSocket *socket = new QSslSocket(this); -connect(socket, SIGNAL(encrypted()), this, SLOT(ready())); +connect(socket, &QSslSocket::encrypted, this, &Receiver::ready); socket->connectToHostEncrypted("imap.example.com", 993); //! [0] @@ -42,7 +42,7 @@ while (socket.waitForReadyRead()) //! [3] QSslSocket socket; -connect(&socket, SIGNAL(encrypted()), receiver, SLOT(socketEncrypted())); +connect(&socket, &QSslSocket::encrypted, receiver, &Receiver::socketEncrypted); socket.connectToHostEncrypted("imap", 993); socket->write("1 CAPABILITY\r\n"); |