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

Mouse click events for a QTreeView inside of QComboBox not handled correctly

    XMLWordPrintable

Details

    Description

      This small application demonstrates the problem.
      The user should be able to expand a treeview item without the combo box closing. This does not occur

       
      int main(int argc, char **argv)
      {
          QApplication app(argc,argv);
      
          QStandardItemModel *model = new QStandardItemModel();
          QModelIndex parentItem;
          for (int i = 0; i < 4; ++i)
          {
              parentItem = model->index(0, 0, parentItem);
              model->insertRows(0, 1, parentItem);
              model->insertColumns(0, 1, parentItem);
              QModelIndex index = model->index(0, 0, parentItem);
              model->setData(index, QString("%1) Some random text to use as data ...").arg(i) );
          }
      
          QTreeView* view = new QTreeView();
          view->setSelectionMode(QAbstractItemView::SingleSelection);
          view->setModel(model);
          QComboBox combo;
          combo.setModel(model);
          combo.setView(view);
          combo.show();
          app.exec();
      }
      

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            ndastur Neville Dastur
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes