Results 1 to 3 of 3

Thread: click on QImage and get QPoint

  1. #1
    Join Date
    Apr 2011
    Posts
    195
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    49
    Thanked 4 Times in 4 Posts

    Default click on QImage and get QPoint

    Hi,
    how can I get the QPoint of a mouseclick on a QImage? I tried to subclass QImage and implement a QMouseEvent, but this is impossible...
    What can I do? If I use the subjacent widget, the QPoint doesn't match with the QImage, because I use Qt::KeepAspectRatio.

    thank u

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: click on QImage and get QPoint

    QImage only holds the image informations. You can't reimp a mouse event there! First: How/where do you display the image. In that class you need to get the point. If the image is scaled, then you have to calculate the point yourself! But that shouldn't be a problem.

  3. #3
    Join Date
    Apr 2011
    Posts
    195
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    49
    Thanked 4 Times in 4 Posts

    Default Re: click on QImage and get QPoint

    Thank u for your reply!
    I use a QWidget.

Similar Threads

  1. Getting widget from Qpoint
    By codeman in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2010, 15:39
  2. ChildAt(Qpoint) - related
    By jsmith in forum Qt Programming
    Replies: 3
    Last Post: 22nd September 2009, 08:45
  3. QtScript QPoint
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 27th May 2009, 09:33
  4. QPoint Limitation
    By archanasubodh in forum Qt Programming
    Replies: 1
    Last Post: 5th August 2008, 10:22
  5. Confusion with QPoint
    By therealjag in forum Qt Programming
    Replies: 9
    Last Post: 14th February 2006, 17: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
  •  
Qt is a trademark of The Qt Company.