LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-02-2008, 03:17 PM   #1
greenmuzz
Member
 
Registered: Oct 2003
Posts: 34

Rep: Reputation: 15
Qt widget suitable for displaying an image and getting mouse click position


Hello,

I'm making a small app with Qt (3.1 iirc). So far I've been content to display an image using the QLabel widget, however, I've just remembered that I need to be able to click on the image, and return the location on the image where the mouse click occurred. I haven't seen an appropriate widget for this in the docs - can anyone suggest the best approach? Can I make a widget that inherits from a QLabel that has this functionality In which case, how would the functionality be added?
 
Old 10-03-2008, 05:08 AM   #2
greenmuzz
Member
 
Registered: Oct 2003
Posts: 34

Original Poster
Rep: Reputation: 15
Ah, sorry. So it really is as simple as inheriting from a QLabel and reimplementing the mousePressedEvent or mouseReleaseEvent.
 
  


Reply

Tags
interactive, qt3


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
background image position RudraB General 1 05-13-2008 10:47 PM
simple example to show an image in Qt 4 without using Widget newbloggy Programming 2 05-12-2006 05:49 AM
Ruby+libglade - howto get an image in a Glade widget? rasat Programming 4 04-12-2006 12:49 AM
mouse: single-click becomes double-click kinzlaw Linux - Hardware 2 08-24-2005 07:55 PM
bsetbg: no suitable image applications slowly Linux - Software 4 04-25-2004 01:47 AM


All times are GMT -5. The time now is 04:23 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration