Comments (5)
QVariant::voidPointer return the address of the QVariant created in C++ not the pointer of the QObject inside the QVariant.
from dqml.
Currently QVariant don't have a getter for obtaining the QObject* pointer inside it. The reason is that is very simple to make error with a garbage collected language like D. The QObject contained the QVariant could be owned from C++ for example or from Qml.
from dqml.
Please explain your use case in order to find a better approach or workaround/solution
from dqml.
Ah, I get it. That's a bit misleading, though.
But it's indeed dangerous in garbage collected languages most of the time.
In my case however the QObject is a custom QObject I made with D and passed to the QML using a QtSignal() and the Connection { } component in qml. That means that the object is actually owned by the D code already.
For my use case this object contains info about the data that is shown in the qml user interface. When the item is selected, some operations on the data of the object should be done for which a reference to the object is required.
Do you have any idea how to achieve that, other than storing the objects in a map with some identifier? Because that's the only solution I can think of right now and that's ugly, because the data objects are not ordered and I would have to compute a random identifier to pass to the qml then.
from dqml.
from dqml.
Related Issues (13)
- Improve the qobject connect syntax
- Add appvejor to CI
- Using `connect`
- [Question] How do i make an array accessible to QML via @QtSlot ? HOT 2
- Linker error compiling helloworld HOT 4
- Add dub support for examples HOT 1
- Compile error with Qt6 in Fedora HOT 2
- Travis CI support
- coveralls.io support
- QVariant: Arrays or list HOT 11
- [enhancement] System tray icon support? HOT 5
- [enhancement] Receive events in D HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dqml.