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

QVariant QDeclarativeStringConverters::variantFromString(const QString &s) creates warnings when trying to convert s into a QColor

    XMLWordPrintable

Details

    Description

      QVariant QDeclarativeStringConverters::variantFromString(const QString &s) creates warnings when trying to convert s into a QColor

      See for example: QTCREATORBUG-5497

       
      QVariant QDeclarativeStringConverters::variantFromString(const QString &s)
      {
          if (s.isEmpty())
              return QVariant(s);
          bool ok = false;
          QRectF r = rectFFromString(s, &ok);
          if (ok) return QVariant(r);
          QColor c = colorFromString(s, &ok);           <--- this will trigger a warning if the string does not start with # and is not a color name
          if (ok) return QVariant(c);
          QPointF p = pointFFromString(s, &ok);
          if (ok) return QVariant(p);
          QSizeF sz = sizeFFromString(s, &ok);
          if (ok) return QVariant(sz);
          QVector3D v = vector3DFromString(s, &ok);
          if (ok) return qVariantFromValue(v);
      
          return QVariant(s);
      }
      

      Attachments

        Issue Links

          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)
              thohartm Thomas Hartmann
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes