Fixing Thumbnails preview from TableView

This commit is contained in:
igarri
2021-06-09 11:02:09 +01:00
parent 4f2acd1340
commit 66bbcb08e5
4 changed files with 12 additions and 46 deletions
@@ -95,7 +95,9 @@ namespace AzToolsFramework
for (int i = 0; i < rows; ++i)
{
QModelIndex index = model->index(i, 0, parent);
if (!model->hasChildren(index))
AssetBrowserEntry* entry = GetAssetEntry(m_filterModel->mapToSource(index));
//We only wanna see the source assets.
if (entry->GetEntryType() == AssetBrowserEntry::AssetEntryType::Source)
{
beginInsertRows(parent, row, row);
m_indexMap[row] = index;
@@ -100,16 +100,11 @@ namespace AzToolsFramework
AZStd::vector<AssetBrowserEntry*> AssetBrowserTreeView::GetSelectedAssets() const
{
const QModelIndexList& selectedIndexes = selectionModel()->selectedRows();
QModelIndexList sourceIndexes;
for (const auto& index : selectedIndexes)
{
//If we check for more than one column then the model will try to select the same entry several times.
if (index.column() == 0)
{
sourceIndexes.push_back(m_assetBrowserSortFilterProxyModel->mapToSource(index));
}
sourceIndexes.push_back(m_assetBrowserSortFilterProxyModel->mapToSource(index));
}
AZStd::vector<AssetBrowserEntry*> entries;