Quantcast
Channel: Installation and Deployment
Viewing all articles
Browse latest Browse all 22112

Passing QML variant to C++ method

$
0
0
Hi, I’m trying to make a game where I have to able to create and move game pieces around a board. The way my code is setup now is I have a C++ object that acts as the game engine and C++ objects that act as the game pieces. I create a QML element dynamically containing a variant property which stores a pointer to the C++ game piece object. What would like to do now, is to be able to call a C++ method via QML, with the variant property as an argument. However, I get the error “Error: Unknown method parameter type: HivePiece*” (HivePiece* being the pointer that I store). Is there a way to do this? Or should I should use a different code structure? Thanks in advance, t3685

Viewing all articles
Browse latest Browse all 22112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>