From d89dc6e24cd1d9219cbda50f32a9f1e321e8fb1c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 25 Sep 2022 12:15:40 +0200 Subject: [PATCH] LibGUI: Add Model::unsafe_create_index() This will be used by Ladybird to translate between LibGUI and Qt models. --- Userland/Libraries/LibGUI/Model.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Userland/Libraries/LibGUI/Model.h b/Userland/Libraries/LibGUI/Model.h index a710ff2c15..e215132d29 100644 --- a/Userland/Libraries/LibGUI/Model.h +++ b/Userland/Libraries/LibGUI/Model.h @@ -98,6 +98,13 @@ public: WeakPtr register_persistent_index(Badge, ModelIndex const&); + // NOTE: This is a public version of create_index() which is normally protected, + // but this can be used when creating a model translator like in Ladybird. + ModelIndex unsafe_create_index(int row, int column, void const* data = nullptr) const + { + return create_index(row, column, data); + } + protected: Model();