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 <szehowe.koh@gmail.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>bb10
parent
8ad9bdf957
commit
ca3ac2e1c7
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Reference in New Issue