Results 1 to 2 of 2

Thread: Zoom on QGraphicsItem question (smooth not pixalted)

  1. #1
    Join Date
    Oct 2008
    Posts
    19
    Thanks
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Zoom on QGraphicsItem question (smooth not pixalted)

    Background: I'm creating a paint program. I am using qgraphicsitems for the Tool to draw on the canvas with the mousePress/Move/Release events. The canvas itself is a QGraphicsItem which holds a QImage (with it's paint method calling a painter->drawImage) . When you release the mouse the the QGraphicsItem is painted on to the canvas's QImage.

    My question is, when I use the QGraphicsView to zoom in and i draw with the Tool, how can I paint on the screen so that it looks 1:1? In the attached image, the curve on the left is while I am drawing with my mouse and the curve on the right is after it has been painted on to my QImage (I am currently zoomed in and the pen width was 3.0).

    My code for painting just tracks the mousemovements and adds the points to a painterpath. When the scene is invalidated in the the boundingRect of my Tool's space it draws the painter path.

    I hope that was clear. Any ideas?
    Thanks,
    Darryl

    paint.png

  2. #2
    Join Date
    Oct 2008
    Posts
    19
    Thanks
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Zoom on QGraphicsItem question (smooth not pixalted)

    Turns out that QGraphicsItem::ItemCoordinate cache is what I wanted.

Similar Threads

  1. QGraphicsItem disappear when zoom is too large.
    By Zikoel in forum Qt Programming
    Replies: 6
    Last Post: 30th July 2011, 12:14
  2. About QGraphicsItem question
    By jiaorenjie in forum Qt Programming
    Replies: 1
    Last Post: 16th March 2011, 08:38
  3. QGraphicsItem point selectable "Problem in Zoom"
    By avis_phoenix in forum Qt Programming
    Replies: 0
    Last Post: 21st July 2009, 17:20
  4. Simple QGraphicsItem question
    By godmodder in forum Qt Programming
    Replies: 2
    Last Post: 13th November 2008, 17:34
  5. Question regarding how to paint after zoom.
    By JonathanForQT4 in forum Qt Programming
    Replies: 2
    Last Post: 26th January 2007, 15:34

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.