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

[Regression] A Qt application hangs when a screen reader tries to access a QTreeView item

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • 5.13.2
    • 5.12.4
    • QPA: Windows
    • None
    • Reproducible on Win10 and Win8.1. Used to work with Qt 5.11.0
    • Windows
    • 1c55a6caf1fc2b8a73a9a756bcf6894c5d4e4398

    Description

      When using the screen reader application YouDaoDict, a Qt application hangs as soon as the reader app tries to read text from a QTreeView item.

      Sample code is this:

      #include <QtWidgets/QApplication>
      #include <QtWidgets/QTreeView>
      #include <QtWidgets/QMainWindow>
      #include <QtGui/QStandardItemModel>
      
      int main (int argc, char** argv) 
      {
          QApplication app(argc, argv);
          QMainWindow mainWindow;
          QTreeView* m_treeView = new QTreeView(&mainWindow);
      
          // Create model and assign it to treeView
          QStandardItemModel* m_model = new QStandardItemModel(&mainWindow);
          QStandardItem* rootItem = m_model->invisibleRootItem();
          rootItem->appendRow(new QStandardItem("freeze"));
          m_treeView->setModel(m_model);
      
          mainWindow.setCentralWidget(m_treeView);
          mainWindow.show();
          return app.exec();
      }
      

      Steps to reproduce:

      1. install YouDaoDict (see steps below)
      2. Run the sample app
      3. Hover the title and hold Ctrl -> a translation shows up after a moment
      4. Hover the "freeze" item and hold Ctrl -> no translation shows up, but one CPU core becomes completely busy, the application doesn't respond anymore, need to kill the app via TaskManager

      The call stack during the freeze looks like this:

      ...
      > qwindows.dll!QWindowsUiaMainProvider::ElementProviderFromPoint(double x, double y, IRawElementProviderFragment * * pRetVal) Line 655 C++  
      UIAutomationCore.dll!ProviderCallouts::ElementProviderFromPoint(struct IRawElementProviderFragmentRoot *,double,double,struct IRawElementProviderFragment * *) Unknown  
      UIAutomationCore.dll!AccessibleProxy::GetFocusOrHitTest() Unknown  
      UIAutomationCore.dll!AccessibleProxy::accHitTest() Unknown  
      oleacc.dll!AccWrap_LocationEtcFix::accHitTest(long,long,struct tagVARIANT *) Unknown  
      oleacc.dll!AccessibleObjectFromPoint() Unknown
      ...
      

      There is an endless loop originating from oleacc.dll!AccessibleObjectFromPoint() which keeps adding references to the QWindowsUiaMainProvider and apparently never finds what it is looking for. The application freezes and doesn't wake up again.

      This is a regression since it used to work with Qt 5.11.0. With that version, the application didn't hang (though YouDaoDict didn't display any tooltip).

      Steps to install YouDaoDict:

      1. Go to http://cidian.youdao.com/ and download the software.
      2. Run installer, start the application after installation.

      3. Make sure the two checkboxes on the left side are checked. (Should be the default state)
      4. Click the drop down menu on the top and enter configuration dialog.
      5. Ensure the 'pick-translation' uses "Ctrl+Mouse" shortcut.

      Attachments

        Issue Links

          Activity

            People

              anrocha André De La Rocha (Inactive)
              haik Haik Lorenz
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: