QtForPythonModule.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <AzCore/Memory/SystemAllocator.h>
  9. #include <AzCore/Module/Module.h>
  10. #include <AzCore/Debug/Trace.h>
  11. #include <QtForPythonSystemComponent.h>
  12. #include "InitializeEmbeddedPyside2.h"
  13. namespace QtForPython
  14. {
  15. class QtForPythonModule
  16. : public AZ::Module
  17. , private InitializeEmbeddedPyside2
  18. {
  19. public:
  20. AZ_RTTI(QtForPythonModule, "{81545CD5-79FA-47CE-96F2-1A9C5D59B4B9}", AZ::Module);
  21. AZ_CLASS_ALLOCATOR(QtForPythonModule, AZ::SystemAllocator);
  22. QtForPythonModule()
  23. : AZ::Module()
  24. , InitializeEmbeddedPyside2()
  25. {
  26. m_descriptors.insert(m_descriptors.end(), {
  27. QtForPythonSystemComponent::CreateDescriptor(),
  28. });
  29. }
  30. ~QtForPythonModule() override = default;
  31. /**
  32. * Add required SystemComponents to the SystemEntity.
  33. */
  34. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  35. {
  36. return AZ::ComponentTypeList
  37. {
  38. azrtti_typeid<QtForPythonSystemComponent>(),
  39. };
  40. }
  41. };
  42. }
  43. #if defined(O3DE_GEM_NAME)
  44. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME, _Editor), QtForPython::QtForPythonModule)
  45. #else
  46. AZ_DECLARE_MODULE_CLASS(Gem_QtForPython_Editor, QtForPython::QtForPythonModule)
  47. #endif