From ae9056587a52d51c7b41b41f631c6cab8097a7c7 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 25 Jan 2020 21:19:47 +0100 Subject: Doc/QtCore: use new signal/slot signature in snippets Use the new signal/slot syntax in the snippets where possible. Also change some 0 to nullptr. Change-Id: Ie3da2721d3cec33704f73f4d39c06a767717b095 Reviewed-by: Sze Howe Koh --- .../doc/snippets/code/src_corelib_kernel_qcoreapplication.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/corelib/doc/snippets/code/src_corelib_kernel_qcoreapplication.cpp') diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qcoreapplication.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qcoreapplication.cpp index aae2456bf1..36b47e6f6e 100644 --- a/src/corelib/doc/snippets/code/src_corelib_kernel_qcoreapplication.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qcoreapplication.cpp @@ -56,7 +56,7 @@ QApplication::sendEvent(mainWindow, &event); //! [1] QPushButton *quitButton = new QPushButton("Quit"); -connect(quitButton, SIGNAL(clicked()), &app, SLOT(quit()), Qt::QueuedConnection); +connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection); //! [1] @@ -79,12 +79,12 @@ Q_COREAPP_STARTUP_FUNCTION(preRoutineMyDebugTool) //! [4] -static int *global_ptr = 0; +static int *global_ptr = nullptr; static void cleanup_ptr() { delete [] global_ptr; - global_ptr = 0; + global_ptr = nullptr; } void init_ptr() @@ -125,9 +125,9 @@ private: //! [6] static inline QString tr(const char *sourceText, - const char *comment = 0); + const char *comment = nullptr); static inline QString trUtf8(const char *sourceText, - const char *comment = 0); + const char *comment = nullptr); //! [6] -- cgit v1.2.3