Results 1 to 20 of 21

Thread: QGraphicsView scale question.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsView scale question.

    Hello again

    Well i'm sorry, but i'm not sure i understand how to do what you recomend
    When i call centerOn(), i have to give some coordinates to the method. Do i have to give the coordinates of the center of my scalled Item as you say: let's take as example my item is scalled down to 0.5 two times, do i have to take my QGraphicsPixmapItem width / height, divide it by 4 (Get item's size in view local coords system after scale), divide the result by 2 (For the center), and then give to centerOn the result added to the position of my item in the scene?

    I tried several methods, for you i have made some screenshots of what i get.
    On the pictures, you can clearly see that after the item is resized, it is "stuck" to top left corned, and is still draggable (But not to the center).

    Anyway thanks, maybe if i try various stuff i'll find why i'm wrong
    Pierre.
    Attached Images Attached Images

Similar Threads

  1. Replies: 1
    Last Post: 15th March 2007, 20:45
  2. Using QGraphicsView with model/view programming
    By JLP in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2007, 11:04
  3. Question regarding how to paint after zoom.
    By JonathanForQT4 in forum Qt Programming
    Replies: 2
    Last Post: 26th January 2007, 15:34
  4. Efficient Scaling and Rotating of QGraphicsView
    By forrestfsu in forum Qt Programming
    Replies: 10
    Last Post: 12th December 2006, 16:28
  5. QGraphicsView scale function
    By forrestfsu in forum Qt Programming
    Replies: 2
    Last Post: 12th October 2006, 14:05

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
  •  
Qt is a trademark of The Qt Company.