mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
1682f0b760
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
37 lines
680 B
C++
37 lines
680 B
C++
/*
|
|
* 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);
|
|
}
|
|
|
|
}
|