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

Add a virtual QAbstractItemDelegate::destroyEditor function

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P3: Somewhat important
    • 5.0.0
    • None
    • Widgets: Itemviews
    • None

    Description

      Sometimes it is useful to reuse the same editor widget rather than to create it and initialize it again and again for each editing operation (ie. huge combobox takes long to create, and multiple cells in a table would select from the same dataset, but with different selected index). This can right now not be easily implemented (the combobox case can be realized with an independent model, but no general solution), and since the delegate creates the widget it should also have a chance to use it's own deletion method (the default implementation would use deleteLater).

      Solution for now: make a QWidget subclass that the actual editing widget is parented into and out of in the constructor/destructor. Return that QWidget from createEditor.

      Attachments

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

        Activity

          People

            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            vhilshei Volker Hilsheimer
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes