mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:48:10 +00:00
LibGUI: Add formatter for ModelIndex.
This commit is contained in:
parent
a7533eb29c
commit
93d04b9f8d
2 changed files with 21 additions and 0 deletions
|
@ -47,3 +47,17 @@ const LogStream& operator<<(const LogStream& stream, const ModelIndex& value)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
namespace AK {
|
||||
|
||||
void Formatter<GUI::ModelIndex>::format(TypeErasedFormatParams& params, FormatBuilder& builder, const GUI::ModelIndex& value)
|
||||
{
|
||||
Formatter<StringView> formatter { *this };
|
||||
|
||||
if (value.internal_data())
|
||||
formatter.format(params, builder, String::formatted("ModelIndex({},{},{:p})", value.row(), value.column(), value.internal_data()));
|
||||
else
|
||||
formatter.format(params, builder, String::formatted("ModelIndex({},{})", value.row(), value.column()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue