diff --git a/Code/Editor/ResizeResolutionDialog.cpp b/Code/Editor/ResizeResolutionDialog.cpp deleted file mode 100644 index f2a03fb1b2..0000000000 --- a/Code/Editor/ResizeResolutionDialog.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "ResizeResolutionDialog.h" - -AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING -#include -AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - -class ResizeResolutionModel - : public QAbstractListModel -{ -public: - ResizeResolutionModel(QObject* parent = nullptr); - - int rowCount(const QModelIndex& parent = {}) const override; - int columnCount(const QModelIndex& parent = {}) const override; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; - - int SizeRow(uint32 dwSize) const; - -private: - static const int kNumSizes = 6; -}; - -ResizeResolutionModel::ResizeResolutionModel(QObject* parent) - : QAbstractListModel(parent) -{ -} - -int ResizeResolutionModel::rowCount(const QModelIndex& parent) const -{ - return parent.isValid() ? 0 : kNumSizes; -} - -int ResizeResolutionModel::columnCount(const QModelIndex& parent) const -{ - return parent.isValid() ? 0 : 1; -} - -QVariant ResizeResolutionModel::data(const QModelIndex& index, int role) const -{ - if (!index.isValid() || index.column() > 0 || index.row() >= kNumSizes) - { - return {}; - } - - const int size = 64 * (1 << index.row()); - - switch (role) - { - case Qt::DisplayRole: - return QStringLiteral("%1x%2").arg(size).arg(size); - - case Qt::UserRole: - return size; - } - - return {}; -} - -int ResizeResolutionModel::SizeRow(uint32 dwSize) const -{ - // not a power of 2? - if (dwSize & (dwSize - 1)) - { - return 0; - } - - int row = 0; - - for (auto i = dwSize / 64; i > 1; i >>= 1) - { - ++row; - } - - return row; -} - -///////////////////////////////////////////////////////////////////////////// -// CResizeResolutionDialog dialog - - -CResizeResolutionDialog::CResizeResolutionDialog(QWidget* pParent /*=nullptr*/) - : QDialog(pParent) - , m_model(new ResizeResolutionModel(this)) - , ui(new Ui::CResizeResolutionDialog) -{ - ui->setupUi(this); - - ui->m_resolution->setModel(m_model); - - connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); - connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); -} - -CResizeResolutionDialog::~CResizeResolutionDialog() -{ -} - -///////////////////////////////////////////////////////////////////////////// -void CResizeResolutionDialog::SetSize(uint32 dwSize) -{ - ui->m_resolution->setCurrentIndex(m_model->SizeRow(dwSize)); -} - -///////////////////////////////////////////////////////////////////////////// -uint32 CResizeResolutionDialog::GetSize() -{ - return ui->m_resolution->itemData(ui->m_resolution->currentIndex()).toInt(); -} diff --git a/Code/Editor/ResizeResolutionDialog.h b/Code/Editor/ResizeResolutionDialog.h deleted file mode 100644 index 123075688f..0000000000 --- a/Code/Editor/ResizeResolutionDialog.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_RESIZERESOLUTIONDIALOG_H -#define CRYINCLUDE_EDITOR_RESIZERESOLUTIONDIALOG_H - -#pragma once -// ResizeResolutionDialog.h : header file -// - -#if !defined(Q_MOC_RUN) -#include -#endif - -namespace Ui { - class CResizeResolutionDialog; -} - -class ResizeResolutionModel; - -///////////////////////////////////////////////////////////////////////////// -// CResizeResolutionDialog dialog - -class CResizeResolutionDialog - : public QDialog -{ - // Construction -public: - CResizeResolutionDialog(QWidget* pParent = nullptr); // standard constructor - ~CResizeResolutionDialog(); - - void SetSize(uint32 dwSize); - uint32 GetSize(); - -private: - ResizeResolutionModel* m_model; - QScopedPointer ui; -}; - -#endif // CRYINCLUDE_EDITOR_RESIZERESOLUTIONDIALOG_H diff --git a/Code/Editor/ResizeResolutionDialog.ui b/Code/Editor/ResizeResolutionDialog.ui deleted file mode 100644 index c958e6acaf..0000000000 --- a/Code/Editor/ResizeResolutionDialog.ui +++ /dev/null @@ -1,58 +0,0 @@ - - - CResizeResolutionDialog - - - - 0 - 0 - 250 - 96 - - - - - - - - - - 0 - 0 - - - - Select resolution: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 698fa65e9c..36a45905bd 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -392,9 +392,6 @@ set(FILES QuickAccessBar.cpp QuickAccessBar.h QuickAccessBar.ui - ResizeResolutionDialog.cpp - ResizeResolutionDialog.h - ResizeResolutionDialog.ui SelectLightAnimationDialog.cpp SelectLightAnimationDialog.h SelectSequenceDialog.cpp