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

QGraphicsItem jumps when reaching the edge of the view

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 6.5.0 Beta1
    • 5.4.0
    • Widgets: GraphicsView
    • None
    • Virtual system :
      - Windows Embedded Standard 32 bits
      - VMWare virtual machine
      - Intel Core i7, 3.40GHz

    • f0cd18706f (qt/qtbase/dev) f0cd18706f (qt/tqtc-qtbase/dev)

    Description

      Are instanciated : a QGraphicsView sets with a QGraphicsScene, a QGraphicsItem inserted in the scene.

      When the item is moved with the mouse and reaching one edge of the view, it 'jumps' several tens of pixel far from its position (it is also visible with the vertical/horizontal scrollbar(s) : their size 'jumps' too at the same time the item 'jumps'). Then when it is moved again, it returns at its correct position. This issue only occurs the first time the view is instantiated and only the first time the item reaches an edge.

      Example of code :

      Main.cpp
      #include <QApplication>
      #include <QGraphicsView>
      #include <QGraphicsEllipseItem>
      
      int main(int argc, char* argv[])
      {
          QApplication app(argc, argv);
      
          QGraphicsView l_view;
          l_view.setFixedSize(800,800);
          l_view.show();
      
          QGraphicsScene l_scene;
          l_view.setScene(&l_scene);
      
          QGraphicsEllipseItem l_item(QRectF(20, 20, 20, 20));
          l_item.setFlags(QGraphicsItem::ItemIsMovable);
          l_scene.addItem(&l_item);
      
          return app.exec();
      }
      

      Attachments

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

        Activity

          People

            taras_kachmaryk Taras Kachmaryk
            lionel.charaix lionel charaix
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes