Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. qgraphicsview
    Log in to post

    • SOLVED Animated GIF in QGraphicsScene/QGraphicsView
      General and Desktop • qgraphicsview qgraphicsscene animations gif qmovie • • artwaw  

      8
      0
      Votes
      8
      Posts
      41
      Views

      @Chris-Kawa Noted thank you. Now it compiles without errors. I think I need to read a bit about newer c++...
    • UNSOLVED How to set flow layout directly in QGraphicsView? Problem understanding QGraphicsView Flow Layout example
      General and Desktop • qgraphicsview flowlayout • • IHatePython  

      10
      0
      Votes
      10
      Posts
      62
      Views

      Ohhh i thought so about implementing my own flow layout. Tried to avoid this, because this will be difficult to do, but if there is no other way... Anyway, thank you. You helped me to understand a little graphics view framework and saved a lot of time. Best regards!
    • UNSOLVED Qt6 opengl/gpu assisted QGraphicsView drawing workflow
      General and Desktop • opengl qgraphicsview vulkan • • Dariusz  

      4
      0
      Votes
      4
      Posts
      35
      Views

      Are you thinking of the new RHI abstraction layer ?
    • UNSOLVED How can my Mouse Press Event differentiate between different items?
      General and Desktop • c++ qgraphicsview qgraphicsitem qmouseevent rectangles • • MegAmaNeo1  

      8
      0
      Votes
      8
      Posts
      40
      Views

      @MegAmaNeo1 In @jsulm's outline code you need a signal named pressed in CustomItem for connect(&item, CustomItem::pressed ..., and you also need an array/QVector of bool named pressed for pressed[i]. You'll presumably need to rename one of them. And where he writes void QGraphicsItem::mousePressEvent he means your void CustomItem::mousePressEvent override.
    • UNSOLVED Future of QGraphicsView and QGraphicsScene
      General and Desktop • qgraphicsview qgraphicsscene • • bewi  

      8
      0
      Votes
      8
      Posts
      79
      Views

      @Asperamanca said in Future of QGraphicsView and QGraphicsScene: @jeremy_k said in Future of QGraphicsView and QGraphicsScene: @Asperamanca I think my point was missed. There's no need to choose Quick|Graphics View|Widgets for the entire application. Use each where they make sense and use the underlying Qt core functionality to communicate. Yes, I missed your point. But maybe you missed mine: There is currently no better technology (in Qt) for some use cases than GraphicsView. Of course I can mix and match, depending on what I need. No, I didn't. We're in agreement there. It's easy to look at the graphics silos and forget that they can cooperate.
    • SOLVED QStackedWidget and adding new QGraphicsView to its pages
      General and Desktop • qgraphicsview qgraphicsscene qstackedwidget • • newToQt26  

      7
      0
      Votes
      7
      Posts
      126
      Views

      @newToQt26 Hi Good to hear. :) If the user can add or delete layers, it's pretty important you make sure curScene/curView always points to something valid as else you get a nasty crash.
    • UNSOLVED Help adding callouts to chart lines
      General and Desktop • qgraphicsview qchart qchartview mouseevents • • mmikeinsantarosa  

      1
      0
      Votes
      1
      Posts
      98
      Views

      No one has replied

    • SOLVED How to animate a QGraphicsItem without using QGraphicsItemAnimation?
      General and Desktop • qgraphicsview qgraphicsitem animation animations • • incam  

      2
      0
      Votes
      2
      Posts
      50
      Views

      @incam https://doc.qt.io/qt-5/qpropertyanimation.html
    • UNSOLVED Disabling mouse event in QGraphicsView?
      General and Desktop • qgraphicsview mouseevent disable • • lansing  

      2
      0
      Votes
      2
      Posts
      31
      Views

      @lansing https://doc.qt.io/qt-5/qwidget.html#enabled-prop https://doc.qt.io/qt-5/qgraphicsview.html#focusInEvent
    • UNSOLVED centering under mouse on QGraphicsItem when zooming
      General and Desktop • qgraphicsview qgraphicsitem center zooming • • lansing  

      1
      0
      Votes
      1
      Posts
      34
      Views

      No one has replied

    • UNSOLVED Drawing 70k objects in QGraphicsView - lag lag lag
      General and Desktop • qgraphicsview • • Dariusz  

      12
      0
      Votes
      12
      Posts
      146
      Views

      @Dariusz Ok so you could get the 40K sample to lag also ?
    • UNSOLVED Propagate mouse event from Widget over QGraphicsView to QGraphicsView
      General and Desktop • qgraphicsview event handling • • mchinand  

      4
      0
      Votes
      4
      Posts
      130
      Views

      Probably not the cleanest solution, but a workaround would be to use an eventFilter. The QGraphicsView could call widgetName->installEventFilter(this) Then in the QGraphicsView, you override the method "eventFilter". That should receive the event originally destined to your widget. Be careful, handling event coordinates can be a bit messy.
    • UNSOLVED QGraphicsItem ignores mouse release event when ItemIsMovable is false.
      General and Desktop • qgraphicsview qgraphicsscene qgraphicsitem mouseevent flag • • Forfunckle  

      5
      0
      Votes
      5
      Posts
      76
      Views

      @mrjj Yes, it worked. Thank you!
    • SOLVED Jitter artefacts when reimplementing drawForeground
      General and Desktop • qgraphicsview painter maptoscene • • Another Qt Beginner  

      4
      1
      Votes
      4
      Posts
      78
      Views

      @Another-Qt-Beginner Hi Did you try setting https://doc.qt.io/qt-5/qgraphicsview.html#ViewportUpdateMode-enum to FullViewportUpdate to see if that reduces the issues.
    • UNSOLVED connect actions to custom Qgraphicsview
      General and Desktop • qgraphicsview qstackedwidgets • • hobbyProgrammer  

      2
      0
      Votes
      2
      Posts
      52
      Views

      Hi, What exactly is not working ?
    • UNSOLVED QGraphicsView, QGraphicsPath - find closest path ?
      General and Desktop • qgraphicsview qgraphicspath • • Dariusz  

      8
      0
      Votes
      8
      Posts
      111
      Views

      Also another problem with path.contains that I find is that the contains would use this as check area > https://doc.qt.io/archives/qt-4.8/images/graphicsview-pathitem.png Which means that the shape can be bigger/inaccurate comparing to the selection location... I think I will need to do some math and create another method for path click intersection. Ok I sorta managed to "fix" it... I ended up creating a forward and then reverse path during selection process. So that the path is a closed - precise - shape. This way I can get proper click detection, I still cant compute which path is closer, but at least selection works properly now.
    • UNSOLVED Positioning drawtext inside a rectangle
      General and Desktop • qgraphicsview scrollbar • • lansing  

      4
      0
      Votes
      4
      Posts
      177
      Views

      @lansing I'm not sure what you are trying to achieve. Normally, I would calculate the correct bounding rect (and ideally cache the result as long as nothing changes, so calls to boundingRect() stay fast)
    • UNSOLVED QGraphicsView - custom curve dissapearing when too close
      General and Desktop • qgraphicsview qgraphicsscene qgraphicsitem • • Dariusz  

      3
      0
      Votes
      3
      Posts
      120
      Views

      It appears that QGraphicsScene checks if position of item is visible in view and then draws/dont draws it... returning qgraphicsScene->sceneRect() as boundingRect on my curve "solved" the issues but its a problem for selectable items... hmmm
    • UNSOLVED QGraphicsView - move item by non linear value...
      General and Desktop • qgraphicsview move • • Dariusz  

      3
      0
      Votes
      3
      Posts
      51
      Views

      @SGaist Its about precision moves, if user wants to move by tiny bit, scaling mouse movement by x value would allow that to happen. Else he would have to type 0.0001 0.0002 0.0003 etc etc. I think I could handle it using itemChange() and record initial mouse click press/release and calculate delta using that.. Yep that seem to do the trick... I can now move my items by tiny amount and doing "Long precise drags" deltaX = (newPos.x() - self.mMousePressPosition.x()) / 2 newPos.setX(newPos.x() - deltaX) deltaY = (newPos.y() - self.mMousePressPosition.y()) / 2 newPos.setY(newPos.y() - deltaY) Small edit, function above works for "simple" items, but as soon as I get to child items with parent it appear to break... sigh. Needs some more math there
    • UNSOLVED Custom QGraphicsView items are not movable
      General and Desktop • qgraphicsview qgraphicsitem qgraphicsellips • • hobbyProgrammer  

      2
      0
      Votes
      2
      Posts
      116
      Views

      Hi I think you just broke GraphicsView normal handling. Try also calling base class mousePressEvent as it might use for the actual item selection void GraphicsView::mousePressEvent(QMouseEvent *event) { if(event->buttons().testFlag(Qt::LeftButton)) { int x,y; x = event->pos().x(); y = event->pos().y(); qDebug() << x << ", " << y; QPointF point = mapToScene(x, y); QGraphicsEllipseItem *ellipse; ellipse = scene->addEllipse(point.x(),point.y(),5,5,QPen(Qt::red), QBrush(Qt::red)); ellipse->setFlag(QGraphicsEllipseItem::ItemIsMovable); } // call base class QGraphicsView::mousePressEvent(event); }
    • UNSOLVED Unable to get touch events on QGraphicsView using single touch in Qt5.12.4
      General and Desktop • qgraphicsview qt5.12.x touch issue • • Himanshu Rohilla  

      1
      0
      Votes
      1
      Posts
      161
      Views

      No one has replied

    • UNSOLVED QGraphicsScene - selection signals/new/old/changed?
      General and Desktop • qgraphicsview qgraphicsscene • • Dariusz  

      3
      0
      Votes
      3
      Posts
      161
      Views

      @sgaist Hmmmmmmmmm I wrote a little routine to use mouse press/release to see what has changed to determine my selection but it does not work as well as I wish. But I missed that focusItemChanged mhmhmhmh thanks! Will go over it again :- )
    • UNSOLVED QGraphicsView - background grid - shifts/moves when pan/zooom...
      General and Desktop • qgraphicsview qgraphicsscene • • Dariusz  

      2
      0
      Votes
      2
      Posts
      467
      Views

      I've updated the question with gif/some updates... Still fighting with it o.o I think by using int vertOffset = horizontalScrollBar()->sliderPosition(); I can somehow calculate the "jump" value offset and offset position of line by that. Not sure how yet tho...
    • UNSOLVED QGraphicsView - dragMove items - signal/slot ?
      General and Desktop • qgraphicsview qgraphicsitem • • Dariusz  

      2
      0
      Votes
      2
      Posts
      127
      Views

      Hi, Without more details form you side, it looks like that's the function you are looking for.
    • SOLVED Scale items position relative to the scene/view resizing
      General and Desktop • qt5 qgraphicsview qgraphicsscene qgraphicsitem • • alizadeh91  

      3
      0
      Votes
      3
      Posts
      507
      Views

      Call fitInView on the GraphicsView with the Image whenever the size of the GraphicsView changes. The rest should work automatically.
    • UNSOLVED Display Halcon Image in QGraphicsView
      General and Desktop • qgraphicsview image display halcon • • Skamath  

      3
      0
      Votes
      3
      Posts
      376
      Views

      @Skamath The Halcon example using Qt is very simple but it uses the Halcon Graphics Window to show images, regions and XLDs. If you think that it is complicated I recommend you to use the Halcon Graphics Window instead of trying to build your own Graphics Window based on QGraphicsView.
    • SOLVED QGraphicsItem select only border
      General and Desktop • qgraphicsview qgraphicsscene qgraphicsitem • • Gianluca86 0  

      4
      0
      Votes
      4
      Posts
      475
      Views

      Thanks @SGaist and @raven-worx , I try both methods to see which one to use better in my program.
    • SOLVED QWidget::paintEngine: Should no longer be called
      General and Desktop • qgraphicsview qpainter painteevent • • Staslend  

      10
      0
      Votes
      10
      Posts
      2431
      Views

      @Staslend if your issue is solved, please don't forget to mark your post as such! Thanks.
    • UNSOLVED QGraphicsView + QGraphicsProxy & QOpenGLWidget as item - drawing issue.
      General and Desktop • qgraphicsview qopenglwidget qgraphicsproxyw • • Dariusz  

      2
      0
      Votes
      2
      Posts
      317
      Views

      Hi, You should add: Which version of Qt you were using before Which version of Qt you are using now Graphics card + driver Platform you are running on
    • UNSOLVED How to make QLegend scrollable?
      General and Desktop • qgraphicsview qtchart qlegend • • Filippov  

      1
      1
      Votes
      1
      Posts
      176
      Views

      No one has replied

    • UNSOLVED Restrict resize of a Widget.
      General and Desktop • qgraphicsview qgraphicsscene qt 5.7 qresizeevent resize event • • sayan275  

      6
      0
      Votes
      6
      Posts
      891
      Views

      The idea is that you have your container widget getting resized and in its resize event, you change the size of the inner widgets with the ratio you want.
    • SOLVED QGraphicsView/Scene paints over other widgets
      General and Desktop • qgraphicsview qgraphicsscene qpainter qpainterpath • • Niagarer  

      11
      0
      Votes
      11
      Posts
      1826
      Views

      @Niagarer Good found. :)
    • SOLVED Custom QQuickItem vs. Widgets QGraphicsView for music notation
      General and Desktop • qml qgraphicsview widgets qquickitem scene graph • • mbise1993  

      3
      0
      Votes
      3
      Posts
      581
      Views

      Thanks for the input! I think I'm going to go with QGraphicsView for the notation and use QQuickWidgets throughout the other pieces of the UI that don't need access to the entire model. I'm hoping that won't be too complicated and will give me the best of both worlds. But I do wonder: is there a specific piece of Qt Quick that's supposed to a "replacement" for QGraphicsView? It seems like the scene graph is a bit too low level, but it's also the only way to gain a lot of control and keep things mostly on the C++ side. It would be nice if the built-in QML elements are exposed via a C++ API at some point.
    • SOLVED Creating a pedigree chart
      General and Desktop • qgraphicsview qgraphicsscene qgraphicsitem • • ByronCoughlin  

      7
      0
      Votes
      7
      Posts
      773
      Views

      @mrjj There are other obstacles that I need to overcome. But this way seems to be the solution that i am implementing. Thanks
    • UNSOLVED QGraphicsView, QGraphicsProxyWidget & QOpenGLWidget - item/proxy wont auto repaint.
      General and Desktop • qgraphicsview qopenglwidget qgraphicsproxyw • • Dariusz  

      1
      0
      Votes
      1
      Posts
      226
      Views

      No one has replied

    • UNSOLVED Zoom In/Out QTableView with a frozen first column
      General and Desktop • c++ qtableview qgraphicsview zoomlevel • • MarKS  

      5
      0
      Votes
      5
      Posts
      997
      Views

      Do you mean custom graphicsView or tableView? If custom graphics view wouldn't it be too hard to reimplement everything? Any links or example would help.
    • UNSOLVED How can I use QPainter to paint on QGraphicsView?
      General and Desktop • qgraphicsview qgraphicsscene qpainter draw objects • • elmLiu  

      9
      0
      Votes
      9
      Posts
      8398
      Views

      In your MyView::paintEvent write QPainter painter(viewport()); instead of QPainter painter(this);.