diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-04-01 15:09:48 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-04-01 15:09:48 (GMT) |
commit | b92516d571eb608e0bb273f0871eeeaf20671b9d (patch) | |
tree | 5a711dd58ff0e9abe4523e893340676fe17bdc62 /doc/src/snippets | |
parent | 815eb0e1d05318dfdd3cadb7f45c7e8e80ff4790 (diff) | |
parent | ef46fa38e50b807c6122dc37d84d2944069ef3ea (diff) | |
download | Qt-b92516d571eb608e0bb273f0871eeeaf20671b9d.zip Qt-b92516d571eb608e0bb273f0871eeeaf20671b9d.tar.gz Qt-b92516d571eb608e0bb273f0871eeeaf20671b9d.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts:
src/gui/inputmethod/qximinputcontext_x11.cpp
Diffstat (limited to 'doc/src/snippets')
-rw-r--r-- | doc/src/snippets/code/src_corelib_global_qglobal.cpp | 8 | ||||
-rw-r--r-- | doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp | 2 | ||||
-rw-r--r-- | doc/src/snippets/code/src_gui_util_qdesktopservices.cpp | 5 |
3 files changed, 13 insertions, 2 deletions
diff --git a/doc/src/snippets/code/src_corelib_global_qglobal.cpp b/doc/src/snippets/code/src_corelib_global_qglobal.cpp index 72663e9..287181a 100644 --- a/doc/src/snippets/code/src_corelib_global_qglobal.cpp +++ b/doc/src/snippets/code/src_corelib_global_qglobal.cpp @@ -456,3 +456,11 @@ class MyClass : public QObject //! [45] 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 +//! [46] + diff --git a/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp b/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp index 355a237..783852b 100644 --- a/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp +++ b/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp @@ -33,7 +33,7 @@ MyStruct s2 = var.value<MyStruct>(); //! [3] int id = QMetaType::type("MyClass"); -if (id != -1) { +if (id == 0) { void *myClassPtr = QMetaType::construct(id); ... QMetaType::destroy(id, myClassPtr); diff --git a/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp b/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp index a9c630b..5001984 100644 --- a/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp +++ b/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp @@ -11,7 +11,10 @@ public slots: QDesktopServices::setUrlHandler("help", helpInstance, "showHelp"); //! [0] - //! [1] mailto:user@foo.com?subject=Test&body=Just a test //! [1] + +//! [2] +QDesktopServices::openUrl(QUrl("file:///C:/Documents and Settings/All Users/Desktop", QUrl::TolerantMode)); +//! [2] |