From 1d024222d8d57ffa03050a177409be6a8ebb73e1 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 24 Oct 2018 11:19:22 +0200 Subject: [PATCH] QUICK_TEST_MAIN_WITH_SETUP: improve documentation - Explain how the moc include works. - Add missing Q_OBJECT macro to example. Change-Id: I2bacdc45721bb6022f030ff4bc89c95132e35e60 Reviewed-by: Paul Wicking Reviewed-by: Andy Shaw --- src/qmltest/doc/src/qtquicktest-index.qdoc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/qmltest/doc/src/qtquicktest-index.qdoc b/src/qmltest/doc/src/qtquicktest-index.qdoc index 0a89066d47..15ea33d06a 100644 --- a/src/qmltest/doc/src/qtquicktest-index.qdoc +++ b/src/qmltest/doc/src/qtquicktest-index.qdoc @@ -181,6 +181,8 @@ class Setup : public QObject { + Q_OBJECT + public: Setup() {} @@ -196,6 +198,15 @@ #include "tst_mytest.moc" \endcode + The \c .moc include is based on the file name of the \c .cpp file. + For example, in the example above, the \c .cpp file is named + \c tst_mytest.cpp. If the file was named \c MyTest.cpp, the include would + be: + + \code + #include "MyTest.moc" + \endcode + \section1 Licenses Qt Quick Tests is available under commercial licenses from \l{The Qt Company}.