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

CLONE -QTreeView expansion/collapsing inside a QComboBox stops working under certain circumstances

    XMLWordPrintable

Details

    Description

      We have a control built on top of a QComboBox containing a QTreeView.

      If the user tries to either select an item in the QTreeView or open a subtree and while doing so, moves the mouse while still holding down the mouse button (as if, say, to highlight/mark more than one line in the tree view), any subsequent attempt to expand or collapse a subtree will fail - the whole tree view will remain in exactly the state it was before this action, no matter what the user does.

      I've attached a simple program that I used to reproduce this behaviour. In order to reproduce it, I used the following steps:

      • Select a directory in the directory tree and expand it
      • Inside the expanded directory tree, position the mouse over one directory entry
      • Now hold down the (left) mouse button and drag the mouse a few entries down (a single entry should be sufficient)
      • A this point, collapsing and expanding other parts of the directory tree stops working
      #include <QtGui>
      
      int main(int argc, char **argv)
      {
          QApplication app(argc,argv);
          QDirModel* model = new QDirModel();
          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

            Unassigned Unassigned
            corwin.joy@styleadvisor.com Corwin Joy
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes