Rust side Models? #472
Unanswered
Rocketpoodle
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hey, With the new 0.5 release this has been made easier :-) Have a look at our custom base class example which uses QAbstractListModel https://github.com/KDAB/cxx-qt/blob/e46b894ffb451be81957b248c4ca90d873da12c4/examples/qml_features/rust/src/custom_base_class.rs or the documentation page in the book https://kdab.github.io/cxx-qt/book/concepts/inheritance.html You should be able to derive from the model (eg QAbstractListModel or QStringListModel), then inherit the required methods / signals and use them in Rust. Let us know if you have any issues ! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Are there any examples of creating model classes in rust? It would be nice to be able to create Qt models in rust as well, having access to commonly used classes like QStringListModel, and ultimately being able to extend QAbstractItemModel and QAbstractListModel would be ideal.
It seems feasible to do this with CXX, but being able to use some of the qobject attributes to declare signals and properties (since they are QObject subclasses) would be nice.
If there is already a way that this is done with CXX_qt, could someone point me towards an example or documentation?
Beta Was this translation helpful? Give feedback.
All reactions