Closed arkanoid87 closed 2 years ago
Thank you for the report i'll look at it this weekend. @arkanoid87 Can you please provide me all the versions for DOtherSide, NimQml and Nim.
Thanks!
DOtherSide: 0.8.0 (2fd6baf current master)
NimQml: 0.9.0
Nim: 1.6.0 (727c6378d2464090564dbcd9bc8b9ac648467e38)
I debugged the problem yestarday evening and i got it working applying a big patch on the DOtherSide library. In pratice the use of QAbstractItemModel istantiated from qml (thus registered with qmlRegisterType or qmlRegisterSingletonType) is broken. I hope to cleanup the patch in these days. Until then use the setContextProperty
I've released a new DOtherSide version v0.8.1. @arkanoid87 this bug should be with that version. If you test again with your executable be sure to implement the data
method otherwise you trigger your assert
it works! Grazie!
Hi! Thanks for this wonderful lib. I'm working with it and I find it nice to use.
I'm exploring how to link model with UI, but I'm stuck when I'm trying to create a TableView that uses Nim model with RegisterSingletonType. I'm experiencing crash on indexCallback when trying to print value via role name but I can't find where the problem is.
If I use setRootContextProperty instead of qmlRegisterSingletonType as in abstractitemmodel example it works, but I'm trying to avoiding this approach as I've read that it is going to be deprecated.
My dev environment is ubuntu 20.04 with Qt 5.12 from apt repository.
I've wrapped up a minimal test case: tablemodel.zip please mind
tablemodel.nimble
file as I use LD_LIBRARY_PATH to point to DOtherSide build pathI'll paste nim and qml code here to make it easier to understand the context:
main.nim
model.nim
Main.qml
Debug output (after replicating crash by double clicking on TableView's cell
Screen before crash
Thanks