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

Make QQmlComponent::errorString() public

    XMLWordPrintable

Details

    Description

      The comment says it is "only meant as a way to the errors in script". I dunno what that means, but this function is useful, especially if you're trying to create a string for the error message without using streaming operators (and not everyone will know about QDebug::toString() for that purpose, and it also unfortunately prints everything on one line):

      /*!
          \internal
          errorString is only meant as a way to get the errors in script
      */
      QString QQmlComponent::errorString() const
      {
          Q_D(const QQmlComponent);
          QString ret;
          if(!isError())
              return ret;
          for (const QQmlError &e : d->state.errors) {
              ret += e.url().toString() + QLatin1Char(':') +
                     QString::number(e.line()) + QLatin1Char(' ') +
                     e.description() + QLatin1Char('\n');
          }
          return ret;
      }
      

      I actually thought it already was public.

      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:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes