1

I have a slot in my application backend which requires a QImage or QPixmap.

Now I want to call it from my QML frontend by providing a png from the resource file:

sessionManager.createUser("user", "qrc:///src/sessionManager/qml/Assets/user.png")

But if I set a breakpoint in createUser I can see that the passed image is null.

How is the correct way to do this?

avb
  • 1,701
  • 5
  • 22
  • 37

1 Answers1

0

I don't know of a way to do this from QML. The correct way to do it would be change your C++ API/create a new one to accept a path to the image and load it there instead.

Mitch
  • 23,716
  • 9
  • 83
  • 122