diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserTableModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserTableModel.cpp index 60f15970b1..d22486d481 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserTableModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserTableModel.cpp @@ -46,16 +46,7 @@ namespace AzToolsFramework { if (role == Qt::DisplayRole && orientation == Qt::Horizontal) { - auto columnRole = aznumeric_cast(role); - switch (columnRole) - { - case AssetBrowserEntry::Column::Name: - return tr("Name"); - case AssetBrowserEntry::Column::Path: - return tr("Path"); - default: - return QString::number(section); - } + return tr(AssetBrowserEntry::m_columnNames[section]); } return QSortFilterProxyModel::headerData(section, orientation, role); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserTableModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserTableModel.h index 6b64ceaf92..e438bf6271 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserTableModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserTableModel.h @@ -38,8 +38,10 @@ namespace AzToolsFramework QModelIndex mapToSource(const QModelIndex& proxyIndex) const override; QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override; QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + public Q_SLOTS: void UpdateTableModelMaps(); + protected: int rowCount(const QModelIndex& parent = QModelIndex()) const override; QVariant headerData(int section, Qt::Orientation orientation, int role /* = Qt::DisplayRole */) const override; @@ -48,6 +50,7 @@ namespace AzToolsFramework private: AssetBrowserEntry* GetAssetEntry(QModelIndex index) const; int BuildTableModelMap(const QAbstractItemModel* model, const QModelIndex& parent = QModelIndex(), int row = 0); + private: QPointer m_filterModel; QMap m_indexMap; diff --git a/Code/Sandbox/Editor/AzAssetBrowser/AzAssetBrowserWindow.ui b/Code/Sandbox/Editor/AzAssetBrowser/AzAssetBrowserWindow.ui index d9e42ef906..37eb1521f3 100644 --- a/Code/Sandbox/Editor/AzAssetBrowser/AzAssetBrowserWindow.ui +++ b/Code/Sandbox/Editor/AzAssetBrowser/AzAssetBrowserWindow.ui @@ -1,211 +1,223 @@ - AzAssetBrowserWindowClass - - - - 0 - 0 - 691 - 554 - - - - Asset Browser - - - - 0 - - - - - - 1 - 1 - - - - true - - - - - 0 - 0 - 671 - 534 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - 0 - 0 - - - - - - - - Switch View - - - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - false - - - - - 0 - 0 - - - - vertical-align: top - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed - - - QAbstractItemView::DropOnly - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - QAbstractItemView::ScrollPerPixel - - - false - - - true - - - - - - - - 1 - 0 - - - - QAbstractItemView::DragOnly - - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - - + AzAssetBrowserWindowClass + + + + 0 + 0 + 691 + 554 + + + + Asset Browser + + + + 0 + + + + + + 1 + 1 + + + + true + + + + + 0 + 0 + 671 + 534 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + 0 + 0 + + + + + + + + Switch View + + + + + + + + + 0 + 0 + + + + Qt::Horizontal + + + false + + + + + 0 + 0 + + + + vertical-align: top + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed + + + false + + + QAbstractItemView::DragOnly + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + QAbstractItemView::ScrollPerPixel + + + false + + + true + + + false + + + true + + + false + + + + + + + + 1 + 0 + + + + QAbstractItemView::DragOnly + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + - - - AzToolsFramework::AssetBrowser::SearchWidget - QWidget -
AzToolsFramework/AssetBrowser/Search/SearchWidget.h
- 1 -
- - AzToolsFramework::AssetBrowser::AssetBrowserTreeView - QTreeView -
AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.h
-
- - AzToolsFramework::AssetBrowser::PreviewerFrame - QFrame -
AzToolsFramework/AssetBrowser/Previewer/PreviewerFrame.h
- 1 -
- - AzToolsFramework::AssetBrowser::AssetBrowserTableView - QTableView -
AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.h
-
-
- - +
+
+
+ + + AzToolsFramework::AssetBrowser::SearchWidget + QWidget +
AzToolsFramework/AssetBrowser/Search/SearchWidget.h
+ 1 +
+ + AzToolsFramework::AssetBrowser::AssetBrowserTreeView + QTreeView +
AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.h
+
+ + AzToolsFramework::AssetBrowser::PreviewerFrame + QFrame +
AzToolsFramework/AssetBrowser/Previewer/PreviewerFrame.h
+ 1 +
+ + AzToolsFramework::AssetBrowser::AssetBrowserTableView + QTableView +
AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.h
+
+
+ +