Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Can I pass a QVariant<QImage> through a signal from Qml to C++?
Forum Updated to NodeBB v4.3 + New Features

Can I pass a QVariant<QImage> through a signal from Qml to C++?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 454 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andreas Schacherbauer
    wrote on last edited by
    #1

    Hi,
    I'm using the Qml Item function grabToImage() 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!

    jsulmJ 1 Reply Last reply
    0
    • A Andreas Schacherbauer

      Hi,
      I'm using the Qml Item function grabToImage() 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!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved