mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibGUI: Make SortingProxyModel forward is_editable() and set_data()
This will allow us to edit models through a SortingProxyModel. :^)
This commit is contained in:
parent
b99eaad693
commit
7f8e18b86a
Notes:
sideshowbarker
2024-07-19 02:15:33 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/7f8e18b86af
2 changed files with 12 additions and 0 deletions
|
@ -285,4 +285,14 @@ bool SortingProxyModel::is_column_sortable(int column_index) const
|
|||
return source().is_column_sortable(column_index);
|
||||
}
|
||||
|
||||
bool SortingProxyModel::is_editable(const ModelIndex& proxy_index) const
|
||||
{
|
||||
return source().is_editable(map_to_source(proxy_index));
|
||||
}
|
||||
|
||||
void SortingProxyModel::set_data(const ModelIndex& proxy_index, const Variant& data)
|
||||
{
|
||||
source().set_data(map_to_source(proxy_index), data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,6 +45,8 @@ public:
|
|||
virtual StringView drag_data_type() const override;
|
||||
virtual ModelIndex parent_index(const ModelIndex&) const override;
|
||||
virtual ModelIndex index(int row, int column, const ModelIndex& parent) const override;
|
||||
virtual bool is_editable(const ModelIndex&) const override;
|
||||
virtual void set_data(const ModelIndex&, const Variant&) override;
|
||||
|
||||
virtual bool is_column_sortable(int column_index) const override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue