Stack variable and passing it to qmlRegisterSingletonInstance method would work fine as well. It's rather for educational purposes for newcomers to make them remember two things: 1. Parent-child approach which was discussed in previous episodes -> playerController got a parent 2. That you have to pass the instance, original object. (Well, you can't copy QObject derived objects anyway)
Thank you so much! You video is inspiring! Please, do more :-). We like them.
Thanks for the comment. We will surely think about it!
Is there any particular reason to create PlayerController on a heap?
Stack variable and passing it to qmlRegisterSingletonInstance method would work fine as well. It's rather for educational purposes for newcomers to make them remember two things:
1. Parent-child approach which was discussed in previous episodes -> playerController got a parent
2. That you have to pass the instance, original object. (Well, you can't copy QObject derived objects anyway)
I think your brain had a fart when you described those cars.
I think the joke flew way over your head