diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2020-01-25 21:19:47 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2020-01-26 17:52:01 +0100 |
commit | ae9056587a52d51c7b41b41f631c6cab8097a7c7 (patch) | |
tree | 41c59ee724df93a232e78ed880460559545c3ce2 /src/corelib/doc/snippets/code/src_corelib_kernel_qcoreapplication.cpp | |
parent | aec4e05e9e8ad9109d7db15dd0fea477e4574c20 (diff) |
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 <szehowe.koh@gmail.com>
Diffstat (limited to 'src/corelib/doc/snippets/code/src_corelib_kernel_qcoreapplication.cpp')
-rw-r--r-- | src/corelib/doc/snippets/code/src_corelib_kernel_qcoreapplication.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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] |