mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
LibGUI: Move GUI::Model::Role to GUI::ModelRole
This is preparation for using ModelRole in the ModelIndex API.
This commit is contained in:
parent
f6d7204689
commit
a1e381a0f8
66 changed files with 201 additions and 167 deletions
|
@ -65,11 +65,11 @@ public:
|
|||
virtual ~ListViewModel() override { }
|
||||
virtual int row_count(const GUI::ModelIndex&) const override { return m_model_items.size(); }
|
||||
virtual int column_count(const GUI::ModelIndex&) const override { return 1; }
|
||||
virtual GUI::Variant data(const GUI::ModelIndex& index, Role role = Role::Display) const override
|
||||
virtual GUI::Variant data(const GUI::ModelIndex& index, GUI::ModelRole role) const override
|
||||
{
|
||||
ASSERT(index.is_valid());
|
||||
ASSERT(index.column() == 0);
|
||||
if (role == Role::Display)
|
||||
if (role == GUI::ModelRole::Display)
|
||||
return m_model_items.at(index.row());
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue