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

Removing item or adding item in QGraphicsScene always updates input method hints when focuseditem has ItemAcceptsInputMethod

    XMLWordPrintable

Details

    • 40e6b1d0b8c1804dfb33032fa70b6604b91f6f90 6873437085a8fe669b12f8f1f2cfee872839d4ec

    Description

      PRECONDITIONS:
      1. set of items (A) in qgraphicsscene
      2. focused to an item (b) that has QGraphicsItem::ItemAcceptsInputMethod

      STEPS LEADING TO PROBLEM:
      1. remove the set of items (A) from scene

      EXPECTED OUTCOME:
      No extensive input method hint updates

      ACTUAL OUTCOME:
      For each item removed, input method hint state is updated, even though the
      state doesn't change and focused item does not change.

      Creates performance problems when input method plugin updates the hints via IPC.

      Testcase shows a bit of performance problem with standard Linux without any input method plugins.
      On my computer non-focus case (benchmark) is 1s and focus case (bug demo) is ~1.5s.

      To run benchmark testcase:
      ./qt-im-scene

      To run testcase demonstrating the problem:
      ./qt-im-scene 1

      Might be fixable with patch similar to:

      diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
      index fd9deb5..b85b4e9 100644
      — a/src/gui/kernel/qwidget.cpp
      +++ b/src/gui/kernel/qwidget.cpp
      @@ -9325,6 +9325,9 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints
      hints)
      {
      #ifndef QT_NO_IM
      Q_D(QWidget);
      + if (d->imHints == hints)
      + return;
      +
      d->imHints = hints;
      // Optimization to update input context only it has already been created.
      if (d->ic || qApp->d_func()->inputContext) {

      For internal bug tracking, please see:
      https://projects.maemo.org/bugzilla/show_bug.cgi?id=265172

      Attachments

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

        Activity

          People

            andrew.den.exter Andrew den Exter
            kimkinnu Kimmo Kinnunen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes