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

QDataWidgetMapper problems with Mysql Decimal fields (traced to QVariant::toString()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Incomplete
    • Affects Version/s: 5.5.1, 5.6.1, 5.7.1, 5.8.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Linux Mint 17.3 64bit on Macbook with Intel Core 2 Duo 2.0Ghz, 6GB. Ram
      Mysql Server 5.5.49

      Description

      Using QSqlTableModel with QDataWidgetMapper to connect to Mysql database have the following problems:

      On QLineEdit control to Decimal field:
      Problem 1:
      If you enter 3.30 it turns into 3.2999999999999
      If you enter 3.40 it turns into 3.3999999999999
      If you enter 3.80 it turns into 3.7999999999999
      If you enter 3.90 it turns into 3.8999999999999

      Problem 2:
      If the a decimal Field is NULL the linked widget does NOT get updated or painted so it keeps showing same info from previous record.

      On QDateEdit control to Date field:
      Problem 3:
      If the field value is NULL the Widget does NOT get updated or painted so it keeps showing same info from previous record.

      Note: Not updating controls when field is NULL is bad (control should be empty when NULL) but changing values is worse.

        Attachments

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

          Activity

            People

            Assignee:
            andysh Andy Shaw
            Reporter:
            alonsomm2016 Luis Alonso Murillo
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes