mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:48:14 +00:00
LibGUI: Fix GModel::is_valid() behavior for tree-like models
This commit is contained in:
parent
303fa75d36
commit
caa08938e5
1 changed files with 2 additions and 1 deletions
|
@ -60,7 +60,8 @@ public:
|
|||
|
||||
bool is_valid(const GModelIndex& index) const
|
||||
{
|
||||
return index.row() >= 0 && index.row() < row_count() && index.column() >= 0 && index.column() < column_count();
|
||||
auto parent_index = this->parent_index(index);
|
||||
return index.row() >= 0 && index.row() < row_count(parent_index) && index.column() >= 0 && index.column() < column_count(parent_index);
|
||||
}
|
||||
|
||||
virtual int key_column() const { return -1; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue