Results 1 to 2 of 2

Thread: Drawing with the mouse

  1. #1
    Join Date
    Jul 2015
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Drawing with the mouse

    hai to all i had drawn a line on image using qpainter and i need to move that line on the image surface can any one give code for it thanking you

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Drawing with the mouse

    Why don't you study the Qt tutorials and examples instead of asking us to write your code for you?

    Basic painting examples are here.

    More advanced Graphics / View examples are here.

    For your problem, I think you will need to use a graphics / view approach. If you want to draw a line and then move it, the line needs to be a separate thing from the image it is drawn on. The graphics / view architecture is designed to use a scene, where everything you draw is a different item in the scene.


    And don't double post. You asked this same question yesterday in a different thread. If you don't get an answer, it means no one wants to answer.

Similar Threads

  1. Drawing Rectangle with mouse press and release
    By Jakr1387 in forum Qt Programming
    Replies: 1
    Last Post: 5th November 2014, 09:14
  2. Contain mouse movement within drawing window
    By rdrnws in forum Qt Programming
    Replies: 2
    Last Post: 22nd June 2010, 10:52
  3. Replies: 3
    Last Post: 12th May 2010, 14:11
  4. Suggestions for drawing with mouse on GraphicsScene
    By GimpMaster in forum Qt Programming
    Replies: 7
    Last Post: 2nd April 2010, 19:44
  5. Mouse Drawing in opengl
    By sdastagirmca in forum Qt Programming
    Replies: 1
    Last Post: 15th October 2009, 10:32

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.