Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to write qml signal Variadic arguments
Forum Update on Monday, May 27th 2025

How to write qml signal Variadic arguments

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 935 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.
  • F Offline
    F Offline
    FlacoDanziger
    wrote on 17 May 2016, 12:52 last edited by
    #1

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

    Thanks

    K 1 Reply Last reply 17 May 2016, 16:14
    0
    • F FlacoDanziger
      17 May 2016, 12:52

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

      Thanks

      K Offline
      K Offline
      kshegunov
      Moderators
      wrote on 17 May 2016, 16:14 last edited by kshegunov
      #2

      @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

      F 1 Reply Last reply 17 May 2016, 17:06
      1
      • K kshegunov
        17 May 2016, 16:14

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

        F Offline
        F Offline
        FlacoDanziger
        wrote on 17 May 2016, 17:06 last edited by
        #3

        @kshegunov thanks

        1 Reply Last reply
        0

        2/3

        17 May 2016, 16:14

        • Login

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