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

CLONE -QDialog as a delegate woes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Done
    • Affects Version/s: 4.5.3
    • Fix Version/s: 5.9.0 Beta 2
    • Component/s: Widgets: Itemviews
    • Labels:
      None
    • Environment:
      All
    • Commits:
      8b1d9d308b1f31e1b9c817e0d91e14baa3b76d6b

      Description

      Using QDialog as a delegate is problematic because QDialog::done(int) calls hide() before setResult(), therefore the result cannot be inspected by the Delegate's setModelData() method.

      QDialog::done(int) should invoke setResult() before calling hide().

      A possible usecase:
      A table view showing properties of a polygon, e.g. with the columns "Name", "Position", "Color" etc. The "Position" column shows something like "5 point polygon around position (3,4)". Editing this cell would open a more elaborate QDialog that shows all five polygon vertex coordinates (as such an edit dialog would surely not fit into the cell rectangle).

      My workaround is to manually call QDialog::setResult() before calling QDialog::accept() or QDialog::reject() in my class derived from QDialog. But I see no reason why QDialog should not call setResult() before hide().

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              sgaist Samuel Gaist
              Reporter:
              jan15022 Jan Siebeneich
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes