summaryrefslogtreecommitdiffstats
path: root/src/gui/doc
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/doc')
-rw-r--r--src/gui/doc/snippets/code/doc_src_qtgui.pro4
-rw-r--r--src/gui/doc/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp4
-rw-r--r--src/gui/doc/snippets/overview/using-qt-gui.cmake2
-rw-r--r--src/gui/doc/snippets/textdocumentendsnippet.cpp2
-rw-r--r--src/gui/doc/src/qtgui.qdoc23
5 files changed, 11 insertions, 24 deletions
diff --git a/src/gui/doc/snippets/code/doc_src_qtgui.pro b/src/gui/doc/snippets/code/doc_src_qtgui.pro
index e705555336..a5eb5b576c 100644
--- a/src/gui/doc/snippets/code/doc_src_qtgui.pro
+++ b/src/gui/doc/snippets/code/doc_src_qtgui.pro
@@ -1,7 +1,3 @@
-#! [0]
-#include <QtGui>
-#! [0]
-
#! [1]
QT -= gui
#! [1]
diff --git a/src/gui/doc/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp b/src/gui/doc/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp
index 4266da0a11..a7e22e549d 100644
--- a/src/gui/doc/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp
+++ b/src/gui/doc/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp
@@ -50,8 +50,8 @@
//! [0]
QStandardItemModel model(4, 4);
-for (int row = 0; row < 4; ++row) {
- for (int column = 0; column < 4; ++column) {
+for (int row = 0; row < model.rowCount(); ++row) {
+ for (int column = 0; column < model.columnCount(); ++column) {
QStandardItem *item = new QStandardItem(QString("row %0, column %1").arg(row).arg(column));
model.setItem(row, column, item);
}
diff --git a/src/gui/doc/snippets/overview/using-qt-gui.cmake b/src/gui/doc/snippets/overview/using-qt-gui.cmake
new file mode 100644
index 0000000000..aecfa458a0
--- /dev/null
+++ b/src/gui/doc/snippets/overview/using-qt-gui.cmake
@@ -0,0 +1,2 @@
+find_package(Qt5 COMPONENTS Gui REQUIRED)
+target_link_libraries(mytarget Qt5::Gui)
diff --git a/src/gui/doc/snippets/textdocumentendsnippet.cpp b/src/gui/doc/snippets/textdocumentendsnippet.cpp
index c8de501838..cb7abd5ca7 100644
--- a/src/gui/doc/snippets/textdocumentendsnippet.cpp
+++ b/src/gui/doc/snippets/textdocumentendsnippet.cpp
@@ -59,7 +59,7 @@ int main(int argv, char **args)
//! [0]
for (QTextBlock it = doc->begin(); it != doc->end(); it = it.next())
- cout << it.text().toStdString() << endl;
+ cout << it.text().toStdString() << Qt::endl;
//! [0]
return 0;
diff --git a/src/gui/doc/src/qtgui.qdoc b/src/gui/doc/src/qtgui.qdoc
index 53fd55bd39..c4e7d32de1 100644
--- a/src/gui/doc/src/qtgui.qdoc
+++ b/src/gui/doc/src/qtgui.qdoc
@@ -40,18 +40,6 @@
These classes are used internally by Qt's user interface technologies
and can also be used directly, for instance to write applications using
low-level OpenGL ES graphics APIs.
-
- To include the definitions of the module's classes, use the
- following directive:
-
- \snippet code/doc_src_qtgui.pro 0
-
- \if !defined(qtforpython)
- If you use \l qmake to build your projects, \l{Qt GUI} is included by
- default. To disable Qt GUI, add the following line to your \c .pro file:
-
- \snippet code/doc_src_qtgui.pro 1
- \endif
*/
/*!
@@ -69,14 +57,15 @@
higher level API's, like Qt Quick, that are much more suitable
than the enablers found in the Qt GUI module.
- \section1 Getting Started
+ \if !defined(qtforpython)
- To include the definitions of the module's classes, use the
- following directive:
+ \include module-use.qdocinc using qt module
+ \quotefile overview/using-qt-gui.cmake
- \snippet code/doc_src_qtgui.pro 0
+ See also the \l[QtDoc]{Building with CMake} overview.
+
+ \section2 Building with qmake
- \if !defined(qtforpython)
If you use \l qmake to build your projects, Qt GUI is included by
default. To disable Qt GUI, add the following line to your \c .pro file: