Page 2 of 2 FirstFirst 12
Results 21 to 28 of 28

Thread: Mouse Press/Release Events

  1. #21
    Join Date
    Sep 2013
    Posts
    107
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Mouse Press/Release Events

    Im not able to access the values of Mouse press/release events from Case events to and not able to carry the same values to void MainWindow:aintEvent(QPaintEvent *e).
    To draw the line, I have called update() function at Mouse release case in event filter.Im getting all junk or Hexa values in qDeug...

  2. #22
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Mouse Press/Release Events

    And you want us to guess what is wrong?

  3. #23
    Join Date
    Sep 2013
    Posts
    107
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Mouse Press/Release Events

    Sorry. Im not able to point it out. In case QEvent::GraphicsSceneMouseRelease: Im getting the ScenePos, but when it is called in void MainWindow:aintEvent(QPaintEvent *e) same data/value is not coming. Or im getting the address of it or wat. Im feeling wrong somewhere, but finding it hard to correct it


    Added after 51 minutes:


    Yes I have stored in Case events in int x,y,x1,y1 for respective points. while calling same x,y,x1,y1 im not getting it when draw line or void MainWindow:aintEvent(QPaintEvent *e)
    Last edited by Vivek1982; 12th August 2014 at 12:35.

  4. #24
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Mouse Press/Release Events

    This is pointless.

    Unless you actually show the code where you store and retrieve the values, there is nothing anyone else can do.

    Cheers,
    _

  5. #25
    Join Date
    Sep 2013
    Posts
    107
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Mouse Press/Release Events

    Hi..
    I have attached the code in a zip file. I have to store the co-ordinates but mouse points are not getting stored in this variable for paint on scene.
    Last edited by Vivek1982; 22nd August 2014 at 13:15.

  6. #26
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Mouse Press/Release Events

    If you want to have access to the values from a different method, you should store them in the member variables, not in local variables.

    Cheers,
    _

  7. #27
    Join Date
    Sep 2013
    Posts
    107
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Mouse Press/Release Events

    ok.. plz can i get link supporting on member varaible or how it can be used in my condition to store data and process while painting

  8. #28
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Mouse Press/Release Events

    can i get link supporting on member varaible
    http://www.cplusplus.com/doc/tutorial/classes/

  9. The following user says thank you to stampede for this useful post:

    Vivek1982 (27th August 2014)

Similar Threads

  1. Replies: 3
    Last Post: 8th October 2011, 09:46
  2. Replies: 6
    Last Post: 27th January 2011, 17:06
  3. How catch key press and key release for entire application
    By hubbobubbo in forum Qt Programming
    Replies: 4
    Last Post: 1st June 2010, 20:53
  4. Problem in Mouse Press Events & Vectors
    By dheeraj in forum Qt Programming
    Replies: 2
    Last Post: 5th July 2008, 18:08
  5. Replies: 2
    Last Post: 2nd April 2008, 14:19

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.