summaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-04-05 01:53:34 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-04-05 01:53:34 (GMT)
commitc3e903409b96fede96cb4a7b95ba308663c88879 (patch)
tree58d70c5c1a5af72aa5220b1132786e065cb56154 /doc/src
parent3840002c93cadb22a67b1f06475d5c1708f507df (diff)
parent3290e4c1956bc6df63af669523391565c67e8c42 (diff)
downloadQt-c3e903409b96fede96cb4a7b95ba308663c88879.zip
Qt-c3e903409b96fede96cb4a7b95ba308663c88879.tar.gz
Qt-c3e903409b96fede96cb4a7b95ba308663c88879.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Add branch prediction macros Add methods for traversing and combining QProcessEnvironment. Handle the HTTP 418 reply properly in QNAM absorb translations.pri into translations.pro let generated flag control SQL generation Add version attributes as per ODF specification
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/snippets/code/src_corelib_global_qglobal.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/src/snippets/code/src_corelib_global_qglobal.cpp b/doc/src/snippets/code/src_corelib_global_qglobal.cpp
index 0b54cef..c79a714 100644
--- a/doc/src/snippets/code/src_corelib_global_qglobal.cpp
+++ b/doc/src/snippets/code/src_corelib_global_qglobal.cpp
@@ -531,3 +531,27 @@ class MyClass : public QObject
//! [47]
CApaApplication *myApplicationFactory();
//! [47]
+
+//! [qlikely]
+ // the condition inside the "if" will be successful most of the times
+ for (int i = 1; i <= 365; i++) {
+ if (Q_LIKELY(isWorkingDay(i))) {
+ ...
+ }
+ ...
+ }
+//! [qlikely]
+
+//! [qunlikely]
+bool readConfiguration(const QFile &file)
+{
+ // We expect to be asked to read an existing file
+ if (Q_UNLIKELY(!file.exists())) {
+ qWarning() << "File not found";
+ return false;
+ }
+
+ ...
+ return true;
+}
+//! [qunlikely]