Fixed Selection in AssetBrowserTreeView

This commit is contained in:
igarri
2021-05-24 13:19:35 +01:00
parent 5434754def
commit 6a0cf97456
4 changed files with 9 additions and 7 deletions
@@ -23,8 +23,9 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option")
#include <QCollator>
AZ_POP_DISABLE_WARNING
AZ_CVAR_EXTERNED(bool, ed_useNewAssetBrowserTableView);
AZ_CVAR(
bool, ed_useNewAssetBrowserTableView, false, nullptr, AZ::ConsoleFunctorFlags::Null,
"Use the new AssetBrowser TableView for searching assets.");
namespace AzToolsFramework
{
namespace AssetBrowser
@@ -99,8 +99,10 @@ namespace AzToolsFramework
AZStd::vector<AssetBrowserEntry*> AssetBrowserTreeView::GetSelectedAssets() const
{
const QModelIndexList& selectedIndexes = selectionModel()->selectedRows();
QModelIndexList sourceIndexes;
for (const auto& index : selectedIndexes())
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)
@@ -33,9 +33,8 @@ AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
#include <AzAssetBrowser/ui_AzAssetBrowserWindow.h>
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
AZ_CVAR(
bool, ed_useNewAssetBrowserTableView, false, nullptr, AZ::ConsoleFunctorFlags::Null,
"Use the new AssetBrowser TableView for searching assets.");
AZ_CVAR_EXTERNED(bool, ed_useNewAssetBrowserTableView);
class ListenerForShowAssetEditorEvent
: public QObject
@@ -34,7 +34,7 @@ namespace ScriptCanvasEditor
{
setDynamicSortFilter(true);
m_showColumn.insert(AssetBrowserModel::m_column);
m_showColumn.insert(aznumeric_cast<int>(AssetBrowserEntry::Column::DisplayName));
UnitTestWidgetNotificationBus::Handler::BusConnect();