소스 검색

LibGUI: Add Model::unsafe_create_index()

This will be used by Ladybird to translate between LibGUI and Qt models.
Andreas Kling 2 년 전
부모
커밋
d89dc6e24c
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      Userland/Libraries/LibGUI/Model.h

+ 7 - 0
Userland/Libraries/LibGUI/Model.h

@@ -98,6 +98,13 @@ public:
 
     WeakPtr<PersistentHandle> register_persistent_index(Badge<PersistentModelIndex>, 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();