Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    How to write qml signal Variadic arguments

    General and Desktop
    2
    3
    682
    Loading More Posts
    • 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.
    • FlacoDanziger
      FlacoDanziger last edited by

      I want to write a qml signal that takes n QString arguments ( foo(QString, ...) which the slot will be on the CPP side.

      Thanks

      kshegunov 1 Reply Last reply Reply Quote 0
      • kshegunov
        kshegunov Moderators @FlacoDanziger last edited by kshegunov

        @FlacoDanziger
        As far as my knowledge of Qt goes, which is pretty decent, you can't ... and you shouldn't. If you want to send a number of QStrings use QStringList. A signal-slot connection is a bit more than a regular function call and variadic arguments can't be packed (when you have queued connections for example). Not to mention it's a type safety nightmare ...

        Read and abide by the Qt Code of Conduct

        FlacoDanziger 1 Reply Last reply Reply Quote 1
        • FlacoDanziger
          FlacoDanziger @kshegunov last edited by

          @kshegunov thanks

          1 Reply Last reply Reply Quote 0
          • First post
            Last post