mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
LibGUI: Expand GModelIndex a bit, adding internal data and model pointers.
This will be useful for implementing more complicated models.
This commit is contained in:
parent
12ec55ee74
commit
d02238af48
10 changed files with 94 additions and 34 deletions
|
@ -76,12 +76,16 @@ public:
|
|||
Function<void(GModel&)> on_model_update;
|
||||
Function<void(const GModelIndex&)> on_selection_changed;
|
||||
|
||||
virtual GModelIndex index(int row, int column) const { return create_index(row, column); }
|
||||
|
||||
protected:
|
||||
GModel();
|
||||
|
||||
void for_each_view(Function<void(GAbstractView&)>);
|
||||
void did_update();
|
||||
|
||||
GModelIndex create_index(int row, int column, void* data = nullptr) const;
|
||||
|
||||
private:
|
||||
HashTable<GAbstractView*> m_views;
|
||||
GModelIndex m_selected_index;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue