croll to top on view when the filter updates
This commit is contained in:
+1
@@ -145,6 +145,7 @@ namespace AzToolsFramework
|
||||
}
|
||||
BuildTableModelMap(sourceModel());
|
||||
emit layoutChanged();
|
||||
|
||||
}
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+9
@@ -58,6 +58,8 @@ namespace AzToolsFramework
|
||||
AZ_Assert(m_tableModel, "Expecting AssetBrowserTableModel");
|
||||
m_sourceFilterModel = qobject_cast<AssetBrowserFilterModel*>(m_tableModel->sourceModel());
|
||||
QTableView::setModel(model);
|
||||
connect(m_tableModel, &AssetBrowserTableModel::layoutChanged, this, &AssetBrowserTableView::layoutChangedSlot);
|
||||
|
||||
horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeMode::Stretch);
|
||||
horizontalHeader()->setSectionResizeMode(1,QHeaderView::ResizeMode::Stretch);
|
||||
}
|
||||
@@ -103,6 +105,13 @@ namespace AzToolsFramework
|
||||
}
|
||||
QTableView::rowsAboutToBeRemoved(parent, start, end);
|
||||
}
|
||||
void AssetBrowserTableView::layoutChangedSlot(const QList<QPersistentModelIndex>& parents, QAbstractItemModel::LayoutChangeHint hint)
|
||||
{
|
||||
AZ_UNUSED(parents);
|
||||
AZ_UNUSED(hint);
|
||||
|
||||
scrollToTop();
|
||||
}
|
||||
void AssetBrowserTableView::SelectProduct(AZ::Data::AssetId assetID)
|
||||
{
|
||||
AZ_UNUSED(assetID);
|
||||
|
||||
+1
@@ -57,6 +57,7 @@ namespace AzToolsFramework
|
||||
protected Q_SLOTS:
|
||||
void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected) override;
|
||||
void rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end) override;
|
||||
void layoutChangedSlot(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint);
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
|
||||
Reference in New Issue
Block a user