Results 1 to 3 of 3

Thread: Capturing mouse click on QwtScaleWidget

  1. #1
    Join Date
    Sep 2011
    Posts
    5
    Thanks
    1
    Qt products
    Qt3
    Platforms
    MacOS X

    Default Capturing mouse click on QwtScaleWidget

    Hi all,

    I'd like to detect a mouse double click on the yLeft scale of my plot. I've searched up and down and haven't found anyone else who has done the same, so I thought I'd come here and ask. I'm familiar with implementing a custom QwtScaleDraw class and have done so, but it's not a widget so it has no mouse click events. I see there is a QwtScaleWidget class, and I have implemented a subclass of that and installed a mouseDoubleClickEvent handler, but I can't seem to figure how to replace the existing QwtScaleWidget attached to the plot. Any idea how I can handle a double click on a scale widget? Am I over thinking this?

    Thanks!

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Capturing mouse click on QwtScaleWidget

    See QObject::installEventFilter(). F.e ScalePicker in the event_filter example uses it.

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    mmangold (15th January 2015)

  4. #3
    Join Date
    Sep 2011
    Posts
    5
    Thanks
    1
    Qt products
    Qt3
    Platforms
    MacOS X

    Default Re: Capturing mouse click on QwtScaleWidget

    Ah, perfect! Thank you Uwe.

Similar Threads

  1. Replies: 2
    Last Post: 16th July 2012, 12:40
  2. Double Click Capturing
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2011, 14:12
  3. Capturing mouse cursor?
    By thru in forum Qt Programming
    Replies: 0
    Last Post: 2nd June 2010, 08:30
  4. Replies: 1
    Last Post: 3rd May 2010, 09:25
  5. Mouse Capturing
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 24th August 2006, 19:37

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.