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

Implement a generic container-joining algorithm

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.9.1
    • None
    • 3
    • 01fc6aeaf (dev)
    • Foundation Sprint 65, Foundation Sprint 66, Foundation Sprint 67, Foundation Sprint 68, Foundation Sprint 69, Foundation Sprint 110, Foundation Sprint 111, Foundation Sprint 112, Foundation Sprint 113, Foundation Sprint 114, Foundation Sprint 115, Foundation Sprint 116, Foundation Sprint 117, Foundation Sprint 118, Foundation Sprint 119, Foundation Sprint 120, Foundation Sprint 121, Foundation Sprint 122, Foundation Sprint 123, Foundation Sprint 124, Foundation Sprint 125

      Hello,

      I would love to use QStringList::join method with QList<int>.
      Something like this :

      QString Utils::ListIntJoin(const QList<int> &iList, const QString &iSep)
      {
          QString aRes;
          bool isFirst = true;
          for(int aNum : iList) {
              if (!isFirst) {
                  aRes += iSep;
              }
              aRes += QString::number(aNum);
              isFirst = false;
          }
          return aRes;
      }
      

      Of course it could also work with long, and other types.
      Thx

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

            rybouabi Rym Bouabid
            n.moreaud Nicolas Moreaud
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes