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

Constructor for QString should be explicit

XMLWordPrintable

    • All

      To avoid implicit but unexpected type conversions the constructors of QString should be flagged with explicit.

      Correct:

       

      pressure = 999;
      pressureString = QString("%1 hPa").arg(pressure);
      

       

      Wrong:

       

      pressure = 999;
      pressureString = QString(pressure) + QString(" hPa");
      

       

       

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

            thiago Thiago Macieira
            th.thielemann Thomas Thielemann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes