Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-27506

[BISECTED] Broken Keyboard navigation of Compiler errors in Issues list

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • Qt Creator 11.0.0-beta1
    • Qt Creator 7.0.1
    • C/C++/Obj-C++ Support
    • None
    • Xubuntu 20.04.4 LTS
      X11
      xfce
    • Linux/X11
    • 61c09bcef (master)

    Description

      Navigating the Issue list in compiler errors with the Up/Down keys is completely broken in Qt Creator.

      1. It highlights the wrong line
      2. It jumps between errors (e.g. pressing Down 3 times goes to error A, C, B instead of A, B, C)

      It is really, really broken. It makes developing C++ with QtCreator a nightmare, almost unsuable.

      The following code can repro the errors:

      
      #include <stddef.h>
      #include <stdint.h>
      
      void foo( int a );
      void foo( int a, int b );
      void foo( float c );
      
      int main()
      {
          unsigned int a = -1.0f;
          foo( "hello" );
          foo( "hello" );
          
          unsigned int b = -1.0f;
          foo( "hello" );
          unsigned int c = -1.0f;
          foo( "hello" );
          return 0;
      }
      

      See attached movie. I'm just pressing 7x Down 7x Up. It does whatever it wants.

      Update

      Looking at the changes, it is possible the bug is caused by a race condition.

      1. I'm using Ninja Generator (not GNU Make)
      2. I have a Ryzen 5900X, so I have 24 threads
      3. I use Clang++-12

      Small update:

      1. QtCreator 7.0 is also affected
      2. QtCreator 6.0.2 is NOT affected

      Small update 3:

      I tracked the bug to src/plugins/projectexplorer/taskwindow.cpp:

      const bool selected = view->selectionModel()->isSelected(index);
      const bool current = view->selectionModel()->currentIndex() == index;
      

      When changed to:

      //const bool selected = view->selectionModel()->isSelected(index);
      const bool current = view->selectionModel()->currentIndex() == index;
      const bool selected = current;
      

      Everything backs to a working state.

      Something I noticed is that according to the bug tickets QTCREATORBUG-25547 & QTCREATORBUG-26720 this new feature is supposed to allow multiple selections (i.e. via Shift + Click or Shift + Arrow). However on Linux, it doesn't seem such feature is working at all. I can only select one issue at a time.

      BISECTED!

      5207374d5d230d6307fa3a839212c24ae627c635 is the first bad commit
      commit 5207374d5d230d6307fa3a839212c24ae627c635
      Author: Christian Kandeler <christian.kandeler@qt.io>
      Date:   Mon Dec 13 12:06:11 2021 +0100
      
          ProjectExplorer: Allow multi-selection in issues pane
          
          Users should be able to copy or remove several issues at once.
          
          Fixes: QTCREATORBUG-25547
          Fixes: QTCREATORBUG-26720
          Change-Id: I1ac75a3445c37200b6a01dd8c5d79d2b69c54a3c
          Reviewed-by: Christian Stenger <christian.stenger@qt.io>
      
       src/plugins/projectexplorer/copytaskhandler.cpp   | 38 ++++++------
       src/plugins/projectexplorer/copytaskhandler.h     |  5 +-
       src/plugins/projectexplorer/itaskhandler.h        | 14 +++--
       src/plugins/projectexplorer/removetaskhandler.cpp |  5 +-
       src/plugins/projectexplorer/removetaskhandler.h   |  5 +-
       src/plugins/projectexplorer/taskmodel.cpp         | 14 +++++
       src/plugins/projectexplorer/taskmodel.h           |  2 +
       src/plugins/projectexplorer/taskwindow.cpp        | 75 ++++++++++++++---------
       src/plugins/projectexplorer/taskwindow.h          |  1 -
       9 files changed, 99 insertions(+), 60 deletions(-)
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTCREATORBUG-27506
          # Subject Branch Project Status CR V

          Activity

            People

              kandeler Christian Kandeler
              dark_sylinc Matias N. Goldberg
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes