diff options
Diffstat (limited to 'LibGUI')
-rw-r--r-- | LibGUI/GTableModel.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/LibGUI/GTableModel.h b/LibGUI/GTableModel.h index 3ea5a2f88f..b1c6a5e46f 100644 --- a/LibGUI/GTableModel.h +++ b/LibGUI/GTableModel.h @@ -46,8 +46,6 @@ public: virtual String column_name(int) const { return { }; } virtual ColumnMetadata column_metadata(int) const { return { }; } virtual GVariant data(int row, int column) const = 0; - virtual void set_selected_index(GModelIndex) { } - virtual GModelIndex selected_index() const { return GModelIndex(); } virtual void update() = 0; bool is_valid(GModelIndex index) const @@ -55,6 +53,9 @@ public: return index.row() >= 0 && index.row() < row_count() && index.column() >= 0 && index.column() < column_count(); } + void set_selected_index(const GModelIndex& index) { m_selected_index = index; } + GModelIndex selected_index() const { return m_selected_index; } + void register_view(Badge<GTableView>, GTableView&); void unregister_view(Badge<GTableView>, GTableView&); @@ -66,4 +67,5 @@ protected: private: HashTable<GTableView*> m_views; + GModelIndex m_selected_index; }; |