summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/snippets/code/doc_src_examples_application.qdoc45
-rw-r--r--doc/src/snippets/code/doc_src_examples_editabletreemodel.cpp48
-rw-r--r--doc/src/snippets/code/doc_src_examples_icons.cpp44
-rw-r--r--doc/src/snippets/code/doc_src_examples_icons.qdoc48
-rw-r--r--doc/src/snippets/code/doc_src_examples_imageviewer.cpp54
-rw-r--r--doc/src/snippets/code/doc_src_examples_imageviewer.qdoc48
-rw-r--r--doc/src/snippets/code/doc_src_examples_simpletreemodel.qdoc52
-rw-r--r--examples/widgets/doc/application.qdoc6
-rw-r--r--examples/widgets/doc/editabletreemodel.qdoc8
-rw-r--r--examples/widgets/doc/icons.qdoc13
-rw-r--r--examples/widgets/doc/imageviewer.qdoc21
-rw-r--r--examples/widgets/doc/simpletreemodel.qdoc12
12 files changed, 47 insertions, 352 deletions
diff --git a/doc/src/snippets/code/doc_src_examples_application.qdoc b/doc/src/snippets/code/doc_src_examples_application.qdoc
deleted file mode 100644
index 920a096ad2..0000000000
--- a/doc/src/snippets/code/doc_src_examples_application.qdoc
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-application -style=windows
-application -style=motif
-application -style=cde
-//! [0]
diff --git a/doc/src/snippets/code/doc_src_examples_editabletreemodel.cpp b/doc/src/snippets/code/doc_src_examples_editabletreemodel.cpp
deleted file mode 100644
index 9a92be2d35..0000000000
--- a/doc/src/snippets/code/doc_src_examples_editabletreemodel.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-QVariant a = model->index(0, 0, QModelIndex()).data();
-//! [0]
-
-
-//! [1]
-QVariant b = model->index(1, 0, QModelIndex()).data();
-//! [1]
diff --git a/doc/src/snippets/code/doc_src_examples_icons.cpp b/doc/src/snippets/code/doc_src_examples_icons.cpp
deleted file mode 100644
index 4532e124b3..0000000000
--- a/doc/src/snippets/code/doc_src_examples_icons.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-if (!condition)
- qFatal("ASSERT: "condition" in file ...");
-//! [0]
diff --git a/doc/src/snippets/code/doc_src_examples_icons.qdoc b/doc/src/snippets/code/doc_src_examples_icons.qdoc
deleted file mode 100644
index added6cefd..0000000000
--- a/doc/src/snippets/code/doc_src_examples_icons.qdoc
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [1]
-qmake "CONFIG += debug" icons.pro
-//! [1]
-
-
-//! [2]
-qmake "CONFIG += release" icons.pro
-//! [2]
diff --git a/doc/src/snippets/code/doc_src_examples_imageviewer.cpp b/doc/src/snippets/code/doc_src_examples_imageviewer.cpp
deleted file mode 100644
index 6ff3673e30..0000000000
--- a/doc/src/snippets/code/doc_src_examples_imageviewer.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-imageLabel->resize(imageLabel->pixmap()->size());
-//! [0]
-
-
-//! [1]
-if (!imageLabel->pixmap())
- qFatal("ASSERT: "imageLabel->pixmap()" in file ...");
-//! [1]
-
-
-//! [4]
-scrollBar->setValue(int(factor * scrollBar->value()));
-//! [4]
diff --git a/doc/src/snippets/code/doc_src_examples_imageviewer.qdoc b/doc/src/snippets/code/doc_src_examples_imageviewer.qdoc
deleted file mode 100644
index aae7055613..0000000000
--- a/doc/src/snippets/code/doc_src_examples_imageviewer.qdoc
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [2]
-qmake "CONFIG += debug" foo.pro
-//! [2]
-
-
-//! [3]
-qmake "CONFIG += release" foo.pro
-//! [3]
diff --git a/doc/src/snippets/code/doc_src_examples_simpletreemodel.qdoc b/doc/src/snippets/code/doc_src_examples_simpletreemodel.qdoc
deleted file mode 100644
index 4f8865b703..0000000000
--- a/doc/src/snippets/code/doc_src_examples_simpletreemodel.qdoc
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-Getting Started How to familiarize yourself with Qt Designer
- Launching Designer Running the Qt Designer application
- The User Interface How to interact with Qt Designer
-//! [0]
-
-
-//! [1]
-Connection Editing Mode Connecting widgets together with signals and slots
- Connecting Objects Making connections in Qt Designer
- Editing Connections Changing existing connections
-//! [1]
diff --git a/examples/widgets/doc/application.qdoc b/examples/widgets/doc/application.qdoc
index d99581fefd..4c537e293e 100644
--- a/examples/widgets/doc/application.qdoc
+++ b/examples/widgets/doc/application.qdoc
@@ -236,7 +236,11 @@
side of the menu bar. Try running the application with various
styles and see the results:
- \snippet doc/src/snippets/code/doc_src_examples_application.qdoc 0
+ \code
+ application -style=windows
+ application -style=motif
+ application -style=cde
+ \endcode
Let's now review the toolbars:
diff --git a/examples/widgets/doc/editabletreemodel.qdoc b/examples/widgets/doc/editabletreemodel.qdoc
index 423b9cee94..24745b77b8 100644
--- a/examples/widgets/doc/editabletreemodel.qdoc
+++ b/examples/widgets/doc/editabletreemodel.qdoc
@@ -132,14 +132,18 @@
In the case shown in the diagram, the piece of information represented
by \b{a} can be obtained using the standard model/view API:
- \snippet doc/src/snippets/code/doc_src_examples_editabletreemodel.cpp 0
+ \code
+ QVariant a = model->index(0, 0, QModelIndex()).data();
+ \endcode
Since each items holds pieces of data for each column in a given row,
there can be many model indexes that map to the same \c TreeItem object.
For example, the information represented by \b{b} can be obtained
using the following code:
- \snippet doc/src/snippets/code/doc_src_examples_editabletreemodel.cpp 1
+ \code
+ QVariant b = model->index(1, 0, QModelIndex()).data();
+ \endcode
The same underlying \c TreeItem would be accessed to obtain information
for the other model indexes in the same row as \b{b}.
diff --git a/examples/widgets/doc/icons.qdoc b/examples/widgets/doc/icons.qdoc
index 2ccf8cac43..b6625db005 100644
--- a/examples/widgets/doc/icons.qdoc
+++ b/examples/widgets/doc/icons.qdoc
@@ -278,17 +278,24 @@
If the application is built in debug mode, the \c Q_ASSERT()
macro will expand to
- \snippet doc/src/snippets/code/doc_src_examples_icons.cpp 0
+ \code
+ if (!condition)
+ qFatal("ASSERT: "condition" in file ...");
+ \endcode
In release mode, the macro simply disappear. The mode can be set
in the application's \c .pro file. One way to do so is to add an
option to \c qmake when building the application:
- \snippet doc/src/snippets/code/doc_src_examples_icons.qdoc 1
+ \code
+ qmake "CONFIG += debug" icons.pro
+ \endcode
or
- \snippet doc/src/snippets/code/doc_src_examples_icons.qdoc 2
+ \code
+ qmake "CONFIG += release" icons.pro
+ \endcode
Another approach is to add this line directly to the \c .pro
file.
diff --git a/examples/widgets/doc/imageviewer.qdoc b/examples/widgets/doc/imageviewer.qdoc
index 8f8e238046..3556d52f7e 100644
--- a/examples/widgets/doc/imageviewer.qdoc
+++ b/examples/widgets/doc/imageviewer.qdoc
@@ -149,7 +149,9 @@
\{QWidget::adjustSize()}{adjustSize()} to achieve this, which is
essentially the same as
- \snippet doc/src/snippets/code/doc_src_examples_imageviewer.cpp 0
+ \code
+ imageLabel->resize(imageLabel->pixmap()->size());
+ \endcode
In the \c print() slot, we first make sure that an image has been
loaded into the application:
@@ -160,17 +162,24 @@
If the application is built in debug mode, the \c Q_ASSERT() macro
will expand to
- \snippet doc/src/snippets/code/doc_src_examples_imageviewer.cpp 1
+ \code
+ if (!imageLabel->pixmap())
+ qFatal("ASSERT: "imageLabel->pixmap()" in file ...");
+ \endcode
In release mode, the macro simply disappear. The mode can be set
in the application's \c .pro file. One way to do so is to add an
option to \uicontrol qmake when building the application:
- \snippet doc/src/snippets/code/doc_src_examples_imageviewer.qdoc 2
+ \code
+ qmake "CONFIG += debug" foo.pro
+ \endcode
or
- \snippet doc/src/snippets/code/doc_src_examples_imageviewer.qdoc 3
+ \code
+ qmake "CONFIG += release" foo.pro
+ \endcode
Another approach is to add this line directly to the \c .pro
file.
@@ -318,7 +327,9 @@
Whenever we zoom in or out, we need to adjust the scroll bars in
consequence. It would have been tempting to simply call
- \snippet doc/src/snippets/code/doc_src_examples_imageviewer.cpp 4
+ \code
+ scrollBar->setValue(int(factor * scrollBar->value()));
+ \endcode
but this would make the top-left corner the focal point, not the
center. Therefore we need to take into account the scroll bar
diff --git a/examples/widgets/doc/simpletreemodel.qdoc b/examples/widgets/doc/simpletreemodel.qdoc
index a2b6010441..c054352cb8 100644
--- a/examples/widgets/doc/simpletreemodel.qdoc
+++ b/examples/widgets/doc/simpletreemodel.qdoc
@@ -313,9 +313,17 @@
We begin with a text file in the following format:
- \snippet doc/src/snippets/code/doc_src_examples_simpletreemodel.qdoc 0
+ \code
+ Getting Started How to familiarize yourself with Qt Designer
+ Launching Designer Running the Qt Designer application
+ The User Interface How to interact with Qt Designer
+ \endcode
\dots
- \snippet doc/src/snippets/code/doc_src_examples_simpletreemodel.qdoc 1
+ \code
+ Connection Editing Mode Connecting widgets together with signals and slots
+ Connecting Objects Making connections in Qt Designer
+ Editing Connections Changing existing connections
+ \endcode
We process the text file with the following two rules: