Results 1 to 3 of 3

Thread: RubberHandDrag doesn't work !

  1. #1
    Join Date
    Jul 2016
    Posts
    13
    Qt products
    Platforms
    Windows

    Exclamation RubberHandDrag doesn't work !

    Hello , i'm using PYQT 4

    i designed a litte application ( QMainWindow ) in QtDesigner and used pyuic to get the python code for the interface.

    in my main script : because i wanted the mouse related Events to work Only in the QGraphicsView zone , i reimplemented the fonctions like this :

    self.graphicsView.mousePressEvent = self.myPressEvent / self.mouseReleaseEvent = self.myReleaseEvent ... etc

    normally i have set the QgraphicsView's DragMode to : ' RubberHandMode' but it doesn't work because of the way i reimplemented the event functions !!
    i don't even see what's the relation between both of them ? !

    whenever i delete the lines of reimplementation (mentioned above) , it works again normally ( i've found this after hours looking for the problem .. )

    Also , if i write normal methods in my main class : def mousePressEvent(self,event ) .. the event works on all the QMainWindow and don't want this and the rubberHandMode works normally .

    am i doing things in a wrong way ? !

    Thanks for reading ,

  2. #2
    Join Date
    Jul 2016
    Posts
    13
    Qt products
    Platforms
    Windows

    Default Re: RubberHandDrag doesn't work !

    SrollHandDrag also doesn't work , whenever i remplement a Mouse related Event as mentioned in the first post

  3. #3
    Join Date
    Jul 2016
    Posts
    13
    Qt products
    Platforms
    Windows

    Default Re: RubberHandDrag doesn't work !

    Problem resolved : i needed to give the control back ( for each Event ) to the QGraphicsView in myPressEvent method after setting the DragMode inside it , by writing
    QGraphicsView.mousePressEvent(self.graphicsView,ev ent)

    that was my mistake !

Similar Threads

  1. Qt.openUrlExternally doesn't work
    By vinayaka in forum Newbie
    Replies: 1
    Last Post: 16th November 2011, 22:59
  2. Screenshot example doesn't work on Mac OSX
    By Damiano in forum Qt Programming
    Replies: 0
    Last Post: 19th January 2011, 11:17
  3. QNetworkAccessManager doesn't work
    By Floppy in forum Newbie
    Replies: 7
    Last Post: 14th November 2009, 16:32
  4. setMouseTracking() doesn't work.
    By luffy27 in forum Qt Programming
    Replies: 13
    Last Post: 27th April 2007, 18:16
  5. Connection doesn't work
    By ^NyAw^ in forum Qt Programming
    Replies: 2
    Last Post: 20th March 2007, 12:09

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.