Setup Table model and Table view

This commit is contained in:
igarri
2021-04-22 13:19:39 +01:00
parent c66e2f4bcf
commit 0ebe6c6079
14 changed files with 492 additions and 186 deletions
@@ -46,6 +46,7 @@ namespace AzToolsFramework
const char* AssetBrowserEntry::m_columnNames[] =
{
"Name",
"Path",
"Source ID",
"Fingerprint",
"Guid",
@@ -128,6 +129,8 @@ namespace AzToolsFramework
return QString::fromUtf8(m_name.c_str());
case Column::DisplayName:
return m_displayName;
case Column::Path:
return m_displayPath;
default:
return QVariant();
}
@@ -283,4 +286,4 @@ namespace AzToolsFramework
} // namespace AssetBrowser
} // namespace AzToolsFramework
#include "AssetBrowser/Entries/moc_AssetBrowserEntry.cpp"
#include "AssetBrowser/Entries/moc_AssetBrowserEntry.cpp"
@@ -68,6 +68,7 @@ namespace AzToolsFramework
enum class Column
{
Name,
Path,
SourceID,
Fingerprint,
Guid,
@@ -135,6 +136,7 @@ namespace AzToolsFramework
protected:
AZStd::string m_name;
QString m_displayName;
QString m_displayPath;
AZStd::string m_relativePath;
AZStd::string m_fullPath;
AZStd::vector<AssetBrowserEntry*> m_children;
@@ -43,6 +43,7 @@ namespace AzToolsFramework
void FolderAssetBrowserEntry::UpdateChildPaths(AssetBrowserEntry* child) const
{
child->m_relativePath = m_relativePath + AZ_CORRECT_DATABASE_SEPARATOR + child->m_name;
child->m_displayPath = QString::fromUtf8(child->m_relativePath.c_str());
child->m_fullPath = m_fullPath + AZ_CORRECT_DATABASE_SEPARATOR + child->m_name;
AssetBrowserEntry::UpdateChildPaths(child);
}
@@ -292,6 +292,9 @@ namespace AzToolsFramework
product->m_assetType = productWithUuidDatabaseEntry.second.m_assetType;
product->m_assetType.ToString(product->m_assetTypeString);
AZ::Data::AssetCatalogRequestBus::BroadcastResult(product->m_relativePath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, assetId);
QString displayPath = QString::fromUtf8(product->m_relativePath.c_str());
displayPath.remove(QString("/" + QString::fromUtf8(product->m_name.c_str())));
product->m_displayPath = displayPath;
EntryCache::GetInstance()->m_productAssetIdMap[assetId] = product;
if (needsAdd)