Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2389

QDataWidgetMapper doesn't set interger Property value if DB field value is NULL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.5.1.1
    • PySide
    • None
    • Linux/X11

    Description

      Minimal example is in attached file.

      There is a simple window with 2 custom widgets - they are derived from QTextEdit and had a property that is mapped to database field with help of QDataWidgetMapper.
      Two widgets are almost identical but has different type of this property - first one has `str` type and second has `int'.
      Database has only 1 table with only 1 row that contains 2 fields. Both fields has NULL values. First field is attached to `str` widget and second - to `int` widget.

      Everything works fine for custom widget with type `str` - method setValue() is called with empty string. As result string '<EMPTY>' is displayed in a widget and string STR VALUE: '' is printed in the console.

      The same should actually happen for the second widget but it doesn't. Nothing is printed and displayed that indicates that method setValue() of this widget isn't called at all by QDataWidgetMapper.

      Summary: setValue() should be called for both widgets by QDataWidgetMapper (and it happened this way with previous versions of PySide6).

      Attachments

        1. pyside2389.zip
          2 kB
        2. PYSIDE-2389.zip
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            starterkit Ivan Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes