From ca3ac2e1c7548f2e66561fb0afe93494416ebf9c Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 27 Oct 2018 21:41:16 +0200 Subject: Documentation: update Q_DISABLE_COPY documentation Q_DISABLE_COPY annotates the functions as deleted but this was not mentioned in the documentation. As a drive-by adjust some indentations. Change-Id: I808fe3f1ce9f949d2ba41436661569ab0f2a9f73 Reviewed-by: Sze Howe Koh Reviewed-by: Paul Wicking --- .../doc/snippets/code/src_corelib_global_qglobal.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp index c73e782b76..7fdff974c1 100644 --- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp @@ -595,8 +595,7 @@ namespace QT_NAMESPACE { //! [43] class MyClass : public QObject { - - private: +private: Q_DISABLE_COPY(MyClass) }; @@ -605,22 +604,21 @@ class MyClass : public QObject //! [44] class MyClass : public QObject { - - private: - MyClass(const MyClass &); - MyClass &operator=(const MyClass &); +private: + MyClass(const MyClass &) = delete; + MyClass &operator=(const MyClass &) = delete; }; //! [44] //! [45] - QWidget w = QWidget(); +QWidget w = QWidget(); //! [45] //! [46] - // Instead of comparing with 0.0 - qFuzzyCompare(0.0,1.0e-200); // This will return false - // Compare adding 1 to both values will fix the problem - qFuzzyCompare(1 + 0.0, 1 + 1.0e-200); // This will return true +// Instead of comparing with 0.0 +qFuzzyCompare(0.0, 1.0e-200); // This will return false +// Compare adding 1 to both values will fix the problem +qFuzzyCompare(1 + 0.0, 1 + 1.0e-200); // This will return true //! [46] //! [47] -- cgit v1.2.3