How to implement mouse dragging an object function with QGraphicsView class | PyQt5 Tutorial

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 19

  • @arslansiddique32
    @arslansiddique32 2 года назад +1

    Was struggling quite a lot for dragging QGraphicsTextItem. This is exactly what I need and it worked. Thanks.

  • @morths-design
    @morths-design 11 месяцев назад

    Thank you for this tutorial. It will save me a lot of time 🙂

  • @411tomas411
    @411tomas411 4 года назад +4

    This is exactlty what I've been struggling to do! Thank you very much for sharing, greetings from Chile!

    • @jiejenn
      @jiejenn  4 года назад

      Glad my video helped.

    • @vamsikartik3389
      @vamsikartik3389 3 года назад

      @@jiejenn I have been browsing for almost an hour and found this. Thanks for sharing.
      Instead of updating position by using that algorithm in mouseMoveEvent.
      Just do:
      self.setFlag(self.ItemIsMovable, True) in def __init__()
      and add
      return super().mouseMoveEvent(event) at the bottom of mouseMoveEvent function. It works.
      Thanks

  • @danielmartinmateos8597
    @danielmartinmateos8597 3 года назад

    I was looking for a solution like that for my dissertation application
    Thanks a lot!!

  • @hugocroizer1385
    @hugocroizer1385 3 года назад +1

    Thank you very much for this clear video ! I just didn't understand where the app came from in the point class method so I replaced it with self.parent where parent is a Qwidget holding the QGraphicsScene. Thank you again !

  • @rules654
    @rules654 4 года назад

    Exactly what i was looking for ....thanks from India

  • @Postermaestro
    @Postermaestro Год назад

    minimal working example, great!

  • @Cephalopopo
    @Cephalopopo 3 года назад

    thank you this is very helpful!

  • @hamidthephysicist6376
    @hamidthephysicist6376 4 года назад

    Thank you very much very interesting tricks . But If I want to "create multiple items" and you can select and move more than one item at a time ? I can't do it with this method ?

  • @fire17102
    @fire17102 3 года назад

    This is fantastic
    How can i do this in 3d though?

  • @vickycodex4975
    @vickycodex4975 2 года назад

    Nice video!, I am making a program which should do the same but with an image, is it possible?

  • @P_and_M
    @P_and_M 2 года назад

    Thanks for the tutorial, I have a question, how can I draw a set of points given in tuples for exaple, like points belonging to a function like y=x^2?

    • @P_and_M
      @P_and_M 2 года назад

      how can I move more than one object?

  • @fransflorenza9708
    @fransflorenza9708 2 года назад

    i have some question. first, does the coordinate is the coordinate of the cursor and not the center coordinate of the object?. second, what if the object is triangle and we need to get heading of the object by the value of 0 - 360 degree?

  • @hyunew
    @hyunew 3 года назад

    how can i get mouse position on image that i load by pyqt5?

  • @zackbarnett7047
    @zackbarnett7047 4 года назад

    do I need to download code for the from PyQt5.QtWidgets to work but my computer just says it doesn't exist?

    • @jiejenn
      @jiejenn  4 года назад

      Have you installed PyQt5 Python package first?