Click here to Skip to main content
15,436,765 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating a simple Image Editing tool to draw a shape on image using Qt. I can load Image to QGraphicsView. I tried sub classing QGraphicsScene and override mouse press event. But don't know how to draw a line on the image where the mouse pressed.

How to draw a line or any text on a Bitmap image using Qt
Amarnath S 18-Jul-12 23:52pm     CRLF
A quick search for "qt rubber band line" yields these results: See also: In the above, they have drawn a rectangle, you need to modify this to draw a line. Also make sure that you're painting the bitmap before drawing the line, so this gives the appearance that the line is drawn on the image. A similar method for drawing text. To achieve a flicker-free performance, you need to do double-buffering:
Arun Kumar K S 18-Jul-12 23:55pm    
Surewly I will check your suggestion.., But I need to save the new image
Amarnath S 19-Jul-12 0:15am     CRLF
Look at this example:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900