From 92ead794fa11af76968dcde64aaa1fb7e0ed84b8 Mon Sep 17 00:00:00 2001 From: Dayo Lawal Date: Tue, 13 Jul 2021 15:47:59 -0500 Subject: [PATCH] Removal of AzQtAppWindow Signed-off-by: Dayo Lawal --- .../Window/AzQtApplicationWindow.cpp | 29 ---------- .../Window/AzQtApplicationWindow.h | 56 ------------------- .../AzToolsFramework/Logger/TraceLogger.cpp | 10 +--- .../AzToolsFramework/Logger/TraceLogger.h | 10 +--- .../Source/Window/MaterialEditorWindow.cpp | 8 ++- .../Code/Source/Window/MaterialEditorWindow.h | 13 +++-- .../Window/ShaderManagementConsoleWindow.cpp | 8 ++- .../Window/ShaderManagementConsoleWindow.h | 13 +++-- 8 files changed, 34 insertions(+), 113 deletions(-) delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Application/Window/AzQtApplicationWindow.cpp delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Application/Window/AzQtApplicationWindow.h diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Application/Window/AzQtApplicationWindow.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Application/Window/AzQtApplicationWindow.cpp deleted file mode 100644 index e8d16dfc58..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/Application/Window/AzQtApplicationWindow.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include -#include - - -namespace AzQtComponents -{ - AzQtApplicationWindow::AzQtApplicationWindow(QWidget* parent /* = 0 */) - : AzQtComponents::DockMainWindow(parent) - { - m_advancedDockManager = new AzQtComponents::FancyDocking(this); - - m_menuBar = new QMenuBar(this); - m_menuBar->setObjectName("MenuBar"); - setMenuBar(m_menuBar); - } -} - diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Application/Window/AzQtApplicationWindow.h b/Code/Framework/AzQtComponents/AzQtComponents/Application/Window/AzQtApplicationWindow.h deleted file mode 100644 index 4a9a67d4df..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/Application/Window/AzQtApplicationWindow.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - * its licensors. - * - * For complete copyright and license terms please see the LICENSE at the root of this - * distribution (the "License"). All use of this software is governed by the License, - * or, if provided, by the license below or the license accompanying this file. Do not - * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include - -AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT -#include -#include -#include -#include - -#include -#include -#include -#include -AZ_POP_DISABLE_WARNING -#endif - -namespace AzQtComponents -{ - /** - * //! Base class for O3DE Tools Applications Windows. Its responsibility is limited to initializing and connecting - * its panels, managing selection of assets, and performing high-level actions like saving. It contains... - */ - class AZ_QT_COMPONENTS_API AzQtApplicationWindow - : public AzQtComponents::DockMainWindow - { - Q_OBJECT - public: - AzQtApplicationWindow(QWidget* parent); - - protected: - virtual void SetupMenu() {}; - virtual void SetupTabs() {}; - - virtual void OpenTabContextMenu() {}; - - AzQtComponents::FancyDocking* m_advancedDockManager = nullptr; - QMenuBar* m_menuBar = nullptr; - }; -} // namespace ShaderManagementConsole diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Logger/TraceLogger.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Logger/TraceLogger.cpp index 3b40455483..e306f0d21d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Logger/TraceLogger.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Logger/TraceLogger.cpp @@ -1,12 +1,8 @@ /* - * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - * its licensors. + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of + * this distribution. * - * For complete copyright and license terms please see the LICENSE at the root of this - * distribution (the "License"). All use of this software is governed by the License, - * or, if provided, by the license below or the license accompanying this file. Do not - * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * SPDX-License-Identifier: Apache-2.0 OR MIT * */ diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Logger/TraceLogger.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Logger/TraceLogger.h index cd605e83ab..e9314137d1 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Logger/TraceLogger.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Logger/TraceLogger.h @@ -1,12 +1,8 @@ /* - * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - * its licensors. + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of + * this distribution. * - * For complete copyright and license terms please see the LICENSE at the root of this - * distribution (the "License"). All use of this software is governed by the License, - * or, if provided, by the license below or the license accompanying this file. Do not - * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * SPDX-License-Identifier: Apache-2.0 OR MIT * */ diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp index 2c4e19a037..34962806cc 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp @@ -55,7 +55,7 @@ AZ_POP_DISABLE_WARNING namespace MaterialEditor { MaterialEditorWindow::MaterialEditorWindow(QWidget* parent /* = 0 */) - : AzQtComponents::AzQtApplicationWindow(parent) + : AzQtComponents::DockMainWindow(parent) { resize(1280, 1024); @@ -82,6 +82,8 @@ namespace MaterialEditor setWindowTitle(QApplication::applicationName()); } + m_advancedDockManager = new AzQtComponents::FancyDocking(this); + setObjectName("MaterialEditorWindow"); setDockNestingEnabled(true); setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea); @@ -89,6 +91,10 @@ namespace MaterialEditor setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea); setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); + m_menuBar = new QMenuBar(this); + m_menuBar->setObjectName("MenuBar"); + setMenuBar(m_menuBar); + m_toolBar = new MaterialEditorToolBar(this); m_toolBar->setObjectName("ToolBar"); addToolBar(m_toolBar); diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h index e7efcfc528..8c288abca9 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h @@ -12,11 +12,10 @@ #include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT -//#include +#include #include #include #include -#include #include #include @@ -44,7 +43,7 @@ namespace MaterialEditor * 3) MaterialPropertyInspector - The user edits the properties of the selected Material. */ class MaterialEditorWindow - : public AzQtComponents::AzQtApplicationWindow + : public AzQtComponents::DockMainWindow , private MaterialEditorWindowRequestBus::Handler , private MaterialDocumentNotificationBus::Handler { @@ -75,8 +74,8 @@ namespace MaterialEditor void OnDocumentUndoStateChanged(const AZ::Uuid& documentId) override; void OnDocumentSaved(const AZ::Uuid& documentId) override; - void SetupMenu() override; - void SetupTabs() override; + void SetupMenu(); + void SetupTabs(); void AddTabForDocumentId(const AZ::Uuid& documentId); void RemoveTabForDocumentId(const AZ::Uuid& documentId); @@ -84,12 +83,14 @@ namespace MaterialEditor AZ::Uuid GetDocumentIdFromTab(const int tabIndex) const; QString GetDocumentPath(const AZ::Uuid& documentId) const; - void OpenTabContextMenu() override; + void OpenTabContextMenu(); void SelectPreviousTab(); void SelectNextTab(); void closeEvent(QCloseEvent* closeEvent) override; + AzQtComponents::FancyDocking* m_advancedDockManager = nullptr; + QMenuBar* m_menuBar = nullptr; QWidget* m_centralWidget = nullptr; AzQtComponents::TabWidget* m_tabWidget = nullptr; MaterialViewportWidget* m_materialViewport = nullptr; diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp index 6c2ae0c322..fea10dfb7a 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp @@ -37,8 +37,10 @@ AZ_POP_DISABLE_WARNING namespace ShaderManagementConsole { ShaderManagementConsoleWindow::ShaderManagementConsoleWindow(QWidget* parent /* = 0 */) - : AzQtComponents::AzQtApplicationWindow(parent) + : AzQtComponents::DockMainWindow(parent) { + m_advancedDockManager = new AzQtComponents::FancyDocking(this); + setWindowTitle("Shader Management Console"); setObjectName("ShaderManagementConsoleWindow"); setDockNestingEnabled(true); @@ -47,6 +49,10 @@ namespace ShaderManagementConsole setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea); setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); + m_menuBar = new QMenuBar(this); + m_menuBar->setObjectName("MenuBar"); + setMenuBar(m_menuBar); + m_toolBar = new ShaderManagementConsoleToolBar(this); m_toolBar->setObjectName("ToolBar"); addToolBar(m_toolBar); diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.h index cd9bcce482..f35000ce26 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.h @@ -15,11 +15,10 @@ #include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT -//#include +#include #include #include #include -#include #include #include @@ -42,7 +41,7 @@ namespace ShaderManagementConsole * its panels, managing selection of assets, and performing high-level actions like saving. It contains... */ class ShaderManagementConsoleWindow - : public AzQtComponents::AzQtApplicationWindow + : public AzQtComponents::DockMainWindow , private ShaderManagementConsoleDocumentNotificationBus::Handler { Q_OBJECT @@ -60,15 +59,15 @@ namespace ShaderManagementConsole void OnDocumentUndoStateChanged(const AZ::Uuid& documentId) override; void OnDocumentSaved(const AZ::Uuid& documentId) override; - void SetupMenu() override; - void SetupTabs() override; + void SetupMenu(); + void SetupTabs(); void AddTabForDocumentId(const AZ::Uuid& documentId); void RemoveTabForDocumentId(const AZ::Uuid& documentId); void UpdateTabForDocumentId(const AZ::Uuid& documentId); AZ::Uuid GetDocumentIdFromTab(const int tabIndex) const; - void OpenTabContextMenu() override; + void OpenTabContextMenu(); void SelectPreviousTab(); void SelectNextTab(); @@ -80,6 +79,8 @@ namespace ShaderManagementConsole void CreateDocumentContent(const AZ::Uuid& documentId, QStandardItemModel* model); + AzQtComponents::FancyDocking* m_advancedDockManager = nullptr; + QMenuBar* m_menuBar = nullptr; QWidget* m_centralWidget = nullptr; AzQtComponents::TabWidget* m_tabWidget = nullptr; ShaderManagementConsoleBrowserWidget* m_assetBrowser = nullptr;