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

QAbstractItemView focusInEvent bug leads to incorrect WA_InputMethodEnabled, which leads to assertion

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • 4.8.x
    • 4.6.1
    • None
    • RHEL 5.5

    Description

      The bug is pretty obvious when you know it's there. The following line in QAbstractItemView::focusInEvent incorrectly tests for the presence of a flag.

          if (currentIndex().flags() != Qt::ItemIsEditable)
              setAttribute(Qt::WA_InputMethodEnabled, false);

      It SHOULD read

          if ((currentIndex().flags() & Qt::ItemIsEditable) != Qt::ItemIsEditable)
              setAttribute(Qt::WA_InputMethodEnabled, false);

      This bug causes the WA_InputMethodEnable attribute to be incorrectly set, which triggers an assertion in QInputContext::setFocusWidget.

      void QInputContext::setFocusWidget(QWidget *widget)
      {
          Q_ASSERT(!widget || widget->testAttribute(Qt::WA_InputMethodEnabled));

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            mrequenes Max Requenes
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes