ListView not displaying KotoArtistModel items #32
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
todo
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: ModernDesktopInitiative/koto#32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The problem is with the Cartographer singleton, which is created twice (resulting in 2 models too), once in cpp and once when used in qml as model for the ListView.
This happens because:
A default constructor is
Cartographer(QObject* parent = nullptr)
.Since you were using a default constructor, the create function was ignored and the default constructor was used when trying to access the singleton in qml, therefore the instance() function was not called and a new object is created. Changing the constructor to
Cartographer(QObject* parent)
is enough to force the use of the create function.Thank you! Pushed new commit to branch that indeed fixes it 🎉