Results 1 to 2 of 2

Thread: Eraser like MS Paint in Qt

  1. #1
    Join Date
    Oct 2012
    Posts
    1
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Eraser like MS Paint in Qt

    I have trouble in programming a module like eraser in MS Paint. I have just learned and find it difficult in getting mouse position and make the cursor become a square or circle when user click the Button Eraser.

    Can I open an image in a widget and erase it? or I need to use something else to do this? Thanks a lot!

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Eraser like MS Paint in Qt

    Can I open an image in a widget and erase it? or I need to use something else to do this?
    This will need understanding of mouse (events in general) and painting systems in Qt.

    As a matter of fact it is possible with QWidgets, it will lot more simpler to do with QGraphicsView & QGraphicsScene (Graphics View Framework)
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. Help on QGraphicsItem::paint please
    By lni in forum Qt Programming
    Replies: 1
    Last Post: 18th July 2011, 08:11
  2. Immediate paint
    By zgulser in forum Qt Programming
    Replies: 11
    Last Post: 15th March 2010, 07:34
  3. paint events
    By freekill in forum Newbie
    Replies: 3
    Last Post: 18th February 2010, 06:29
  4. paint
    By xyzt in forum Qt Programming
    Replies: 3
    Last Post: 22nd March 2008, 18:22
  5. QtCanvasPolygon does not paint
    By YuriyRusinov in forum Qt Programming
    Replies: 3
    Last Post: 10th August 2007, 17:56

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.