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

unnecessary font change events

    XMLWordPrintable

Details

    • 011d3aa2bdf49127169f0726b78e13e8e9bcd73e

    Description

      1. create a graphics widget tree
      2. show it -> polish is called

      current result:
      for every polished widget in the hierarchy, the font changed event is sent.

      expected result:
      font change event is called only when the font is really changed.

      in the QGraphicsWidget the polish event calls.
      case QEvent::Polish:
      polishEvent();
      d->polished = true;
      d->updateFont(d->font);
      break;

      this update font is propagated all the children with:
      case QEvent::FontChange:
      update();
      updateGeometry();
      break;

      even though the font is not even changed. The updateGeometry() will cause the sizeHint cache clearing, which is expensive operation.

      See the attached simple application. The font is stored every time the font change event is received. At the end, the current font is compared to the ones that was "changed" on the fly. The result: they all are the same.

      Tested with Qt4.6tp1.

      Attachments

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

        Activity

          People

            menard Alexis Menard (closed Nokia identity) (Inactive)
            ekoppen Eckhart Köppen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes