Results 1 to 5 of 5

Thread: How to get mouse events from qgraphicswidget

  1. #1
    Join Date
    Oct 2010
    Posts
    16
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default How to get mouse events from qgraphicswidget

    Hi,
    I have placed some qgraphicswidgets on a scene. i want to write call back function while widgets were dragged. some one please tell me how can i do that.( how to get signals from widgets)

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to get mouse events from qgraphicswidget

    Wait...
    Can you lease explain in more detail what it is you want to do?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Oct 2010
    Posts
    16
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: How to get mouse events from qgraphicswidget

    Here is the description:

    I have a qgraphicsscene. on top of it i have placed a qgraphicswidget(its is icon image). If i drag this icon i need to do some custom operation. Now how can i catch the mouse events when i clicked or dragged my icon.How can i register and call the callbacks for these events. can you PLEASE explain me with some sample code if possible?

  4. #4
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to get mouse events from qgraphicswidget

    Get the Qt's source code, unpack it and go to examples/draganddrop directory. I think that will be enough at this point. Good luck.
    I'm a rebel in the S.D.G.

  5. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to get mouse events from qgraphicswidget

    See QGrpahicsWidget doc.
    Look for the various event handlers.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Mouse events
    By Maluko_Da_Tola in forum Newbie
    Replies: 3
    Last Post: 25th August 2010, 06:55
  2. Mouse Events
    By daviddoria in forum Qt Programming
    Replies: 6
    Last Post: 13th May 2008, 11:55
  3. mouse events
    By xyzt in forum Newbie
    Replies: 3
    Last Post: 23rd March 2008, 11:14
  4. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 06:13
  5. QPushButton mouse events
    By Twey in forum Newbie
    Replies: 5
    Last Post: 15th January 2006, 16:41

Tags for this Thread

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.