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

Constructor for QString should be explicit

    XMLWordPrintable

Details

    • All

    Description

      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");
      

       

       

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes