summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/src_corelib_global_qglobal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/code/src_corelib_global_qglobal.cpp')
-rw-r--r--doc/src/snippets/code/src_corelib_global_qglobal.cpp23
1 files changed, 23 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 21bea7aef8..16f6783a52 100644
--- a/doc/src/snippets/code/src_corelib_global_qglobal.cpp
+++ b/doc/src/snippets/code/src_corelib_global_qglobal.cpp
@@ -560,3 +560,26 @@ bool readConfiguration(const QFile &file)
return true;
}
//! [qunlikely]
+
+//! [qunreachable-enum]
+ enum Shapes {
+ Rectangle,
+ Triangle,
+ Circle,
+ NumShapes
+ };
+//! [qunreachable-enum]
+
+//! [qunreachable-switch]
+ switch (shape) {
+ case Rectangle:
+ return rectangle();
+ case Triangle:
+ return triangle();
+ case Circle:
+ return circle();
+ case NumShapes:
+ Q_UNREACHABLE();
+ break;
+ }
+//! [qunreachable-switch]