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

QComboBox showPopup doesn't select all columns of an item

    XMLWordPrintable

Details

    • All
    • b3b28faf2627aad3a0c47fb4c7c711e0d19984aa (qt/qtbase/dev) 3f2b5fdf48e32ee01bcc1154adef5b3c530fb9bc (qt/qtbase/6.0) c3d8270f2f0bf379ecb4aa868c4feefb3ca181ed (qt/tqtc-qtbase/tqtc/lts-5.15)

    Description

      Hi,

      I have a custom QComboBox which popup uses a multi-column view. When I click on the comboBox to open the popup, only the first column of a row gets selected. If I move my mouse around, all columns are getting properly selected.

      While digging in the source code to understand what was happening (with the hope to find a flag to set on the comboBox), I noticed that qcombobox.cpp, line 2666, in the showPopup() function, the select call goes as follow:

      view()>selectionModel()>setCurrentIndex(d->currentIndex, QItemSelectionModel::ClearAndSelect);

      QItemSelectionModel::ClearAndSelect only selects the first column of the row.

      It should be: QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows to select all columns of the row.

      Seems fairly benign to do this change, but maybe this should be an additional flag on the qcombobox.

      Thanks,

      Eric

       

      Attachments

        For Gerrit Dashboard: QTBUG-86776
        # Subject Branch Project Status CR V

        Activity

          People

            chehrlic Christian Ehrlicher
            esmolikowski Eric Smolikowski
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes