Fixing Header Data in AssetBrowserTableModel
This commit is contained in:
+1
-10
@@ -46,16 +46,7 @@ namespace AzToolsFramework
|
||||
{
|
||||
if (role == Qt::DisplayRole && orientation == Qt::Horizontal)
|
||||
{
|
||||
auto columnRole = aznumeric_cast<AssetBrowserEntry::Column>(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);
|
||||
}
|
||||
|
||||
@@ -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<AssetBrowserFilterModel> m_filterModel;
|
||||
QMap<int, QModelIndex> m_indexMap;
|
||||
|
||||
Reference in New Issue
Block a user