blob: ac7108bd417a54a7cb16e12bc99c59f0e2d08e05 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/*
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/String.h>
#include <LibGUI/Model.h>
#include <LibGUI/Variant.h>
namespace GUI {
Variant ModelIndex::data(ModelRole role) const
{
if (!is_valid())
return {};
VERIFY(model());
return model()->data(*this, role);
}
ModelIndex ModelIndex::sibling(int row, int column) const
{
if (!is_valid())
return {};
VERIFY(model());
return model()->index(row, column, parent());
}
ModelIndex ModelIndex::sibling_at_column(int column) const
{
if (!is_valid())
return {};
return sibling(row(), column);
}
}
|