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

Item Delegate should also be applies for selected text

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.6.2
    • None
    • Gentoo Linux (stable), kernel 2.6.34, qt 4.6.2

    Description

      I fed a QComboBox instance with an instance of QSqlTableModel (setModel (...)) and select the column to be displayed (setModelColumn ()).
      To get the items displayed in a way i also set the item delegate to a custom one (setItemDelegate ()).

      The items in the drop-down list are displayed correctly, but the one displayed as selected not.

      Digging a little bit in the qt-code (of version 4.6.2) i come to file qcombobox.cpp at line 1239ff which says:

      ------------------------ cut ---------------------
      QString QComboBoxPrivate::itemText(const QModelIndex &index) const
      {
      return index.isValid() ? model->data(index, itemRole()).toString() : QString();
      }
      ------------------------ cut ---------------------

      I think it should call the method displayText(...) item delegate (if one is set) after obtaining the value to display. Something like:

      return index.isValid() ? view->itemDelegate ()>displayText (model>data(index, itemRole())) : QString();

      Attachments

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

        Activity

          People

            dedietri Gabriel de Dietrich (drgvond)
            petric Petric Frank
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes