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

Item selection bug in scaled QGraphicsView

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Duplicate
    • Affects Version/s: 4.7.1
    • Fix Version/s: 4.8.1
    • Component/s: Widgets: GraphicsView
    • Labels:
      None
    • Environment:
      Bug happens in Windows, Linux and Mac OS X in Qt versions > 4.7.0

      Description

      QGraphicsView fails selecting with mouse click items when view is transformed (scaled). This bug happens in Qt versions higher than 4.7.0.

      Provided example runs perfectly with Qt 4.7.0 and previous ones, but with 4.7.1 and next ones it behaves like selection box was bigger than the one user sees. The example just has a QGraphicsView, creates its scene and then adds a rect item. View is scaled and also has enabled the rubberband hand option (bug it's the same with that option enabled or not). Rubberhand selection box selects items correctly in any Qt version, but as said previously in 4.7.1 and upper mouse click fails.

      If we run the example a simple window appears, with a white QGraphicsView and we can see the rect's upper left corner. Try to click near the top or left side of rect and we can see how selection fails (rect gets selected when it should not). Move rect so we can click near bottom and right cornes of rect: selection works correctly. Selection box is extended to top and left, so to speak. If we scale QGraphicsView with (50, -50), flipping Y coordinate, the selection box is extended bottom and left.

        Attachments

        1. example.zip
          0.9 kB
        2. scale_sample.png
          scale_sample.png
          71 kB
        3. test_QGraphicsView.zip
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            waterdomain Water Domain (Inactive)
            Reporter:
            cyttorak Cyttorak
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes