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

QLocale: conversion from QString to int fails if the string contains a positive sign and separators

    XMLWordPrintable

Details

    • I8e0e071d6c682d9192a8c6bb2f282510e21b3c48

    Description

      QString dString( "+100,000" );
      int dInt = locale.toInt( dString, &isOk );
      qDebug() << "dInt is " << dInt;

      --> Error: QLocale::toInt(..) returns 0 if the QString contains a positive sign '+' and a separator.

      The attached example application demonstrates the use case.

      Attachments

        Activity

          People

            dzyubenk Denis Dzyubenko (Inactive)
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: