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

QGraphicsScene: Incorrect work of method QGraphicsScenePrivate::itemsAtPosition

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 4.7.4
    • Widgets: GraphicsView
    • None
    • Windows/Linux x86, x86-x64

    Description

      Method QGraphicsScenePrivate::itemsAtPosition always check on intersect items and rectangle QRectF(scenePos, QPointF(1, 1))

      qgraphicsscene.cpp, lines 1084-1086:

      const QRectF pointRect(scenePos, QSizeF(1, 1));
      if (!view->isTransformed())
              return q->items(pointRect, Qt::IntersectsItemShape, Qt::DescendingOrder);
      

      This leads to the fact that when you select a region expands at a left and up on 1 unit in scene coordinates. (The choice of element by mouse causes the expansion of the active area in left and up directions by one from the element borders shape.)

      For example:
      Rect item position in scene coordinates: QRectF(5 5 10 10)
      Cursor position in scene coordinates: QPointF(4.5, 4,5)

      This element will be selected at mouse left bottom click. This leads to problems with interactive manipulation of small graphics items. In attachment simple example.

      Attachments

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

        Activity

          People

            bibr Andreas Aardal Hanssen
            esp Evgeny
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes