Can I pass a QVariant<QImage> through a signal from Qml to C++?
-
Hi,
I'm using the Qml Item functiongrabToImage()
and want to emit a custom signal in the callback, passing the image of the grab result. If I log the image object in Qml, it says it's of type QVariant<QImage>, but when I create a QSignalSpy in C++ and try to attach it to the signal in Qml, I get the error message that the signal spy could not connect.
So the question is, can a QVariant<QImage> be passed through a signal from Qml to C++?Thanks!
-
Hi,
I'm using the Qml Item functiongrabToImage()
and want to emit a custom signal in the callback, passing the image of the grab result. If I log the image object in Qml, it says it's of type QVariant<QImage>, but when I create a QSignalSpy in C++ and try to attach it to the signal in Qml, I get the error message that the signal spy could not connect.
So the question is, can a QVariant<QImage> be passed through a signal from Qml to C++?Thanks!
@Andreas-Schacherbauer said in Can I pass a QVariant<QImage> through a signal from Qml to C++?:
but when I create a QSignalSpy in C++ and try to attach it to the signal
Can you show how you did it and what the error was exactly?