From: Thiago Macieira Date: Wed, 1 Aug 2012 14:19:36 +0000 (+0200) Subject: Compile in C++11 mode: the Q_DECLARE_METATYPE must be visible X-Git-Tag: upstream/5.2.95+rc1~214 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e7f0f673a205ce33f31e7ef25afb47a0d6edc93;p=platform%2Fupstream%2Fqtmultimedia.git Compile in C++11 mode: the Q_DECLARE_METATYPE must be visible The error was: tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp:113:62: required from here qmetatype.h:637:5: error: static assertion failed: Type is not registered, please use Q_DECLARE_METATYPE macro to make it know to Qt's meta-object system Change-Id: Id4e29803de646cbad0d401b1fe0e0b38e458d12f Reviewed-by: Michael Goddard Reviewed-by: Marc Mutz Reviewed-by: Jonas Rabbe --- diff --git a/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp b/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp index e3de6ff..f201756 100644 --- a/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp +++ b/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp @@ -105,13 +105,7 @@ class tst_QDeclarativeVideoOutput : public QObject { Q_OBJECT public: - tst_QDeclarativeVideoOutput() - : m_mappingComponent(0) - , m_mappingOutput(0) - , m_mappingSurface(0) - { - qRegisterMetaType(); - } + tst_QDeclarativeVideoOutput(); ~tst_QDeclarativeVideoOutput() { @@ -181,6 +175,14 @@ void tst_QDeclarativeVideoOutput::initTestCase() Q_DECLARE_METATYPE(QDeclarativeVideoOutput::FillMode) +tst_QDeclarativeVideoOutput::tst_QDeclarativeVideoOutput() + : m_mappingComponent(0) + , m_mappingOutput(0) + , m_mappingSurface(0) +{ + qRegisterMetaType(); +} + void tst_QDeclarativeVideoOutput::fillMode() { QQmlComponent component(&m_engine); diff --git a/tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp b/tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp index 1b7b3cd..a033834 100644 --- a/tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp +++ b/tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp @@ -80,6 +80,8 @@ private slots: void readPerByte(); }; +Q_DECLARE_METATYPE(tst_QWaveDecoder::Corruption) + void tst_QWaveDecoder::init() { } @@ -308,8 +310,6 @@ void tst_QWaveDecoder::readPerByte() stream.close(); } -Q_DECLARE_METATYPE(tst_QWaveDecoder::Corruption) - QTEST_MAIN(tst_QWaveDecoder) #include "tst_qwavedecoder.moc"