Results 1 to 4 of 4

Thread: Howto catch Hoover Events with mouse over a QPainter Polygon/Polyline..?

  1. #1
    Join Date
    May 2009
    Location
    Vienna
    Posts
    91
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Howto catch Hoover Events with mouse over a QPainter Polygon/Polyline..?

    Hi,

    I'm drawing rects with QPainter. I want to create a tooltip or show a widget, if i hoover with the mouse over the painted rect. The class of QPainter does not seem to have any hoover events.

    Any ideas would be welcome.
    thanx Astronomy


    Qt Code:
    1. static const QPointF points[4] = {
    2. QPointF(10.0, 80.0),
    3. QPointF(20.0, 10.0),
    4. QPointF(80.0, 30.0),
    5. QPointF(90.0, 70.0)
    6. };
    7.  
    8.  
    9. p.begin(this);
    10. p.setPen(Qt::black);
    11. p.drawPolygon(points, 4);
    12. p.end();
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Howto catch Hoover Events with mouse over a QPainter Polygon/Polyline..?

    The QWidget or QGraphicsItem that you are drawing on has the event handlers.

  3. #3
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Howto catch Hoover Events with mouse over a QPainter Polygon/Polyline..?


  4. #4
    Join Date
    May 2009
    Location
    Vienna
    Posts
    91
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Howto catch Hoover Events with mouse over a QPainter Polygon/Polyline..?

    ok thanx,
    i'll dig in there.

    greetz A.

Similar Threads

  1. Catch maximize and restore events.
    By QT8seven in forum Qt Programming
    Replies: 4
    Last Post: 25th January 2014, 01:56
  2. Can I use delegate to catch mouse and keyboard events
    By hubbobubbo in forum Qt Programming
    Replies: 0
    Last Post: 29th April 2010, 12:00
  3. Replies: 1
    Last Post: 18th March 2010, 08:42
  4. howto Processing GUI events until a thread exits
    By doggrant in forum Qt Programming
    Replies: 0
    Last Post: 5th October 2009, 15:50
  5. Replies: 2
    Last Post: 4th August 2007, 04:31

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.