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

QML Connection doesn't handle whitspaces in signal signatures properly

    XMLWordPrintable

Details

    • c5f7b5d382b14ff73fc40044c395148d15844c2f

    Description

      If you define a Connetion in QML Like:

      Connection {
          signal: "some_signal(param_1, param2)"
          ...
      }
      

      it will not get connected because of the whitespace behind the comma.

      It should be easy to fix. The problem resists in src/declarative/util/qmlconnection.cpp. In the current git version, the following code lines (line 172 - 177) are relevant:

      172:    if (lparen >= 0 && d->signal.length() > lparen+2) {
      173:        QStringList l = d->signal.mid(lparen+1,d->signal.length()-lparen-2).split(QLatin1Char(','));
      174:        foreach (const QString &s, l) {
      175:            sigparams.append(s.toUtf8());
      176:        }
      177:    }
      

      In Line 173 the parameters are splitet along the comma but all whitespaces are preserved.
      Changing Line 175 to: sigparams.append(s.trimmed().toUtf8()); will do the trick.

      Attachments

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

        Activity

          People

            brasser Michael Brasser (closed Nokia identity) (Inactive)
            georg Georg Sievers
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes