Thanks! Adding #include "main.moc" indeed worked! I also tried to put Setup.h/cpp in a separate class (and no #include of the moc) but I couldn't get that one working. Note also that the example on https://doc.qt.io/qt-5.11/qtquicktest-index.html#executing-c-before-qml-tests is missing a Q_OBJECT!
Kind Regards, Marc Op wo 24 okt. 2018 om 11:10 schreef Mitch Curtis <mitch.cur...@qt.io>: > > -----Original Message----- > > From: Interest <interest-bounces+mitch.curtis=qt...@qt-project.org> On > > Behalf Of Marc Van Daele > > Sent: Wednesday, 24 October 2018 10:58 AM > > To: interest@qt-project.org > > Subject: [Interest] Failing to use QUICK_TEST_MAIN_WITH_SETUP > > > > I'm trying to get an answer to > https://forum.qt.io/topic/95715/qtest-failing- > > to-use-quick_test_main_with_setup > > (I hope it is not considered impolite to re-post it here ) > > > > > > Basically I'm looking for a minimal but complete stand-alone example > using > > the new QUICK_TEST_MAIN_WITH_SETUP macro. > > I'm using Qt 5.11.2 > > > > Thanks in advance, > > > > Marc > > Hi Marc. > > The #include "tst_mytest.moc" is probably what's missing, as without that > the QMetaObject::invokeMethod() call will fail. You should change the > include to match the cpp file that the Setup type is in. For example, if > your .cpp file is Setup.cpp: > > #include "Setup.moc" > > Sorry that the documentation is lacking here - it really should explain > what to name that include. I'll submit a patch for it. >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest