QComponentEntityEditorOutlinerWindow.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 <EditorDefs.h>
  9. #include "CryEdit.h"
  10. #include "UI/QComponentEntityEditorOutlinerWindow.h"
  11. #include <AzCore/Component/Entity.h>
  12. #include <AzCore/Component/ComponentApplicationBus.h>
  13. #include <AzToolsFramework/UI/Outliner/EntityOutlinerWidget.hxx>
  14. #include <QVBoxLayout>
  15. QEntityOutlinerWindow::QEntityOutlinerWindow(QWidget* parent)
  16. : QMainWindow(parent)
  17. , m_outlinerWidget(nullptr)
  18. {
  19. gEnv->pSystem->GetISystemEventDispatcher()->RegisterListener(this);
  20. Init();
  21. }
  22. QEntityOutlinerWindow::~QEntityOutlinerWindow()
  23. {
  24. gEnv->pSystem->GetISystemEventDispatcher()->RemoveListener(this);
  25. }
  26. void QEntityOutlinerWindow::OnSystemEvent([[maybe_unused]] ESystemEvent event, [[maybe_unused]] UINT_PTR wparam, [[maybe_unused]] UINT_PTR lparam)
  27. {
  28. }
  29. void QEntityOutlinerWindow::Init()
  30. {
  31. QVBoxLayout* layout = new QVBoxLayout();
  32. m_outlinerWidget = new AzToolsFramework::EntityOutlinerWidget(nullptr);
  33. layout->addWidget(m_outlinerWidget);
  34. QWidget* window = new QWidget();
  35. window->setLayout(layout);
  36. setCentralWidget(window);
  37. }