Lua: Let MultiTextCusor::cursors return a table

There is a problem with sorting QList<QTextCursor> due to the
implicit sharing in QTextCursor. For now just convert the list
to a table which works with table.sort as well.

Change-Id: Ia9bb8c7b89b5cd19f7f111eeaa6fc3ea381774ea
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-09-16 09:48:49 +02:00
parent 50b90dabef
commit 63f2477542

View File

@@ -164,7 +164,7 @@ void setupTextEditorModule()
"mainCursor",
&MultiTextCursor::mainCursor,
"cursors",
&MultiTextCursor::cursors);
[](MultiTextCursor *self) { return sol::as_table(self->cursors()); });
result.new_usertype<QTextCursor>(
"TextCursor",