test_qml_editorwidgets.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /***************************************************************************
  2. test_qml_editorwidgets.cpp
  3. --------------------------
  4. begin : Jul 2021
  5. copyright : (C) 2021 by Mathieu Pellerin
  6. email : mathieu@opengis.ch
  7. ***************************************************************************/
  8. /***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************/
  16. #include "qfield_qml_init.h"
  17. #include <QtQuickTest>
  18. #include <QQmlEngine>
  19. #include <QQmlContext>
  20. #define REGISTER_SINGLETON( uri, _class, name ) qmlRegisterSingletonType<_class>( uri, 1, 0, name, []( QQmlEngine *engine, QJSEngine *scriptEngine ) -> QObject * { Q_UNUSED(engine); Q_UNUSED(scriptEngine); return new _class(); } )
  21. class Setup : public QObject
  22. {
  23. Q_OBJECT
  24. public:
  25. Setup() {}
  26. public slots:
  27. void qmlEngineAvailable( QQmlEngine *engine )
  28. {
  29. qmlInit( engine );
  30. }
  31. };
  32. QUICK_TEST_MAIN_WITH_SETUP( test_qml_editorwidgets, Setup )
  33. #include "test_qml_editorwidgets.moc"