#pragma once #include #include #include "./base.hpp" class SimpleBaseExample : public BaseExample { public: SimpleBaseExample() : BaseExample() { m_container = new SimpleExamplesContainer(); } ~SimpleBaseExample() {} protected: SimpleExamplesContainer *m_container = nullptr; }; class SimpleExample : public SimpleBaseExample { public: SimpleExample() : SimpleBaseExample() {} ~SimpleExample() {} QString jsName() override { return "showSimpleExample"; } std::function run() override { return [this](QScriptContext *context, QScriptEngine *engine) -> QScriptValue { m_container->showBasicGreetingView(); return engine->undefinedValue(); }; } }; class ToolbarExample : public SimpleBaseExample { public: ToolbarExample() : SimpleBaseExample() {} ~ToolbarExample() {} std::function run() override { return [this](QScriptContext *context, QScriptEngine *engine) -> QScriptValue { m_container->showCounterView(); return engine->undefinedValue(); }; } QString jsName() override { return "showToolbarExample"; } };