Optimize UITableView and UITreeView by only allocating as many cells as needed to cover the viewport.

This commit is contained in:
Martín Lucas Golini
2024-02-11 13:45:18 -03:00
parent a09377f8e6
commit eccf1f1cba
10 changed files with 172 additions and 102 deletions

View File

@@ -108,6 +108,8 @@ class EE_API Node : public Transformable {
Node* setVisible( const bool& visible );
Node* setChildsVisibility( bool visible, bool emitEventNotification = true );
bool isVisible() const;
bool isHided() const;

View File

@@ -183,7 +183,7 @@ class EE_API UIAbstractTableView : public UIAbstractView {
virtual UITableRow* updateRow( const int& rowIndex, const ModelIndex& index,
const Float& yOffset );
virtual UIWidget* updateCell( const int& rowIndex, const ModelIndex& index,
virtual UIWidget* updateCell( const Vector2<Int64>& posIndex, const ModelIndex& index,
const size_t& indentLevel, const Float& yOffset );
virtual UIWidget* createCell( UIWidget* rowWidget, const ModelIndex& index );

View File

@@ -144,7 +144,7 @@ class EE_API UITreeView : public UIAbstractTableView {
virtual void onColumnSizeChange( const size_t& colIndex, bool fromUserInteraction = false );
virtual UIWidget* updateCell( const int& rowIndex, const ModelIndex& index,
virtual UIWidget* updateCell( const Vector2<Int64>& posIndex, const ModelIndex& index,
const size_t& indentLevel, const Float& yOffset );
virtual UIWidget* createCell( UIWidget* rowWidget, const ModelIndex& index );