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 <paul.wicking@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
Mitch Curtis 2018-10-24 11:19:22 +02:00
parent 9007862264
commit 1d024222d8
1 changed files with 11 additions and 0 deletions

View File

@ -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}.