Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-79291

Document how parameter types for new function syntax in Connections objects should be declared

    XMLWordPrintable

Details

    Description

      For signals with multiple parameters, it seems that you can simply declare the parameters you're interested in (assuming their names match those declared in the signal) and it will work. This should be documented now that they aren't implicitly declared for the user, so that users don't think they need to declare every parameter as in C++.

      For example, in qtvirtualkeyboard, there is this signal:

      void virtualKeyClicked(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers, bool isAutoRepeat);
      

      Doing the following in QML seems to work fine:

          Connections {
              target: InputContext.inputEngine
              function onVirtualKeyClicked(key, isAutoRepeat) {
                  // use parameters ...
              }
          }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes