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

QTreeWidget: items are getting unselected.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.0
    • 4.3.3
    • Widgets: Itemviews
    • None
    • 8f6b8c5a9750d49e6b93804d37aa64140460bfa6

    Description

      In an application written with Qt and using QTreeWidget for displaying data we encountered a problem with items unexpectedly getting unselected. The problem can be reproduced with the sample application you can find attached.

      One important point seems to be that we use lazy fetching of children (i.e. inserting children only when the parent is opened) because once the children are inserted, the problem does not occur anymore. In the real-world application lazy fetching of children is necessary because of performance reasons.

      To reproduce the problem, please do the following:

      • Compile the program and start it
      • Open "Root" node
      • Open "Child3" node and select "Alpha" & "Beta"
      • Open "Child2" node and select "Alpha" & "Delta"
      • Open "Child1" -> "Beta" and "Delta" become unselected

      On our systems the problem is always reproduceable with this combination. But not all combinations of selected items reproduce the problem. E.g. the problem does not occur if "Alpha" & "Beta" are selected in both of "Child2" and "Child3".

      Further tests have shown that an "itemSelectionChanged" signal is not emitted when the node is opened but selectedItems().size() is 2 which is correct.

      System information:

      • SuSE Linux Enterprise Desktop 10
      • gcc 4.1.2

      Tested on Qt 4.3.3 and Qt 4.4.1

      Attachments

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

        Activity

          People

            vfm Thierry Bastian (closed Nokia identity) (Inactive)
            dakovaci Daniel Kovacic
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes