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. Error matching function parameters
Forum Updated to NodeBB v4.3 + New Features

Error matching function parameters

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 3 Posters 951 Views 1 Watching
  • 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.
  • O Offline
    O Offline
    Ovidiu Vasilca
    wrote on last edited by
    #1

    Hi,

    I work on an Qt project created in an old Qt version(4...).
    I have a class where is defined signal like this:

    Q_INVOKABLE void clientsDataComplete(QString serverData, QString testVar, QString test1);

    Somewhere in code is emited this signal so:

    emit clientsDataComplete("serverResponse", "asdasd", "test1111");

    In Qml, where signal is handled, i do this:

    onClientsDataComplete: {
    console.log("trouble data1: " + serverData);
    console.log("trouble data2: " + testVar);
    console.log("trouble data3: " + test1);
    }

    And i get this logs:

    qml: trouble data1: undefined
    qml: trouble data2: serverResponse
    qml: trouble data3: asdasd

    So, i don't know if it's a bug or wrong coding.
    Thanks for any help!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      One thing that is out of place is the Q_INVOKABLE macro, Signals declaration are enough by themselves.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #3

        This can happen only if the clientsDataComplete is defined with two parameters somewhere and serverData variable is not recognised. Can show you complete class declaration ?

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        0
        • O Offline
          O Offline
          Ovidiu Vasilca
          wrote on last edited by
          #4

          Apparently, it seem to be a bug.
          https://stackoverflow.com/questions/50817795/qml-c-signal-parameters-undefined-in-qml

          1 Reply Last reply
          0
          • O Offline
            O Offline
            Ovidiu Vasilca
            wrote on last edited by
            #5

            [SOLVED]

            An update from Qt 5.11.0 to Qt 5.11.1 solved that issue.

            1 Reply Last reply
            1

            • Login

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