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

QDataWidgetMapper doesn't get value from custom widget

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.7.4, 4.8.1, 5.0.2
    • Widgets: Itemviews
    • None

      I tested it on Qt 5.0.2, 4.7.4 and 4.8.1 so this issue probably applies to Qt 5 and and previous versions of Qt 4.

      Custom widget inherits from QWidget. Has:
      Q_PROPERTY(QDate date READ date WRITE setDate NOTIFY dateChanged USER true )
      All methods are defined properly.
      I use QSqlTableModel.My widget has QCheckBox and QDateEdit. I use delegate to format date for SQLite. I have two situations:

      1. Without mapper->setSubmitPolicy (default is QDataWidgetMapper::AutoSubmit).
      setModelData from delegate is invoked for Qt widgets(QDateEdit too) but not when I set value in my widget.

      2. With mapper->setSubmitPolicy( QDataWidgetMapper::ManualSubmit ).
      submit() is called when dialog is accepted. In this case setModelData operates on Qt widgets and take value from my widget too.

      So issue is that QDataWidgetMapper doesn't get value from custom widget when has a submit policy AutoSubmit

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

            hostel Lukasz
            hostel Lukasz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes