Results 1 to 6 of 6

Thread: NOT zooming childs after parent zoom.

  1. #1
    Join Date
    Mar 2011
    Posts
    82
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default NOT zooming childs after parent zoom.

    I can't figure out how to make childs NOT zoom in when I zoom in a parent object.

    The reason I need this is for something like a crossplot. If I zoom out enough, I see all the points in the crossplot, but if I zoom in, I don't want to see only one gigant point (actually, it is a QRectF, but theoretically a point) but, instead, I want to see a point the same size it originally was, only that the zoom made the whole thing scale and it's alone in the view frame.


    I don't know if this is clear enough, but picture this: You see a ball pool. each ball is a dot in the pool (plane, scene) and, as I zoom in, I start seeing less and less balls, until I either see a single dot in the center or just a blank space (because the zoom is so big that a minimal distance between two balls is now a huge one. The ball I see in this zoom is still the same size it was on the normal zoom, just that it's scale in relation to the whole scene changed. You could say it is, now, more precise in relation with it's theoreticall point in space value (due to a smaller scale).

    Incidentally, I just might be doing it all wrong and I;m confusing scalling with zooming.

    thanks for your help.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: NOT zooming childs after parent zoom.

    Assuming you are using Graphics View, set ItemIgnoresTransformations flag on your items which shouldn't zoom with their parents.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2011
    Posts
    82
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: NOT zooming childs after parent zoom.

    Ah, yes. Sorry about that.

    I am, indeed, using GraphicsView.

    If I were to use the Ignores Transformation flag, wouldn-t it ignore the parent transformation? That is, I need the parent's scale system to properly position each point in the plane, wouldn't that make the object ignore EVERYTHING that's going on? I think what I need is something along the lines of descalling-zoomingout in direct relation of how I scalled-zoomed in the parent.

    Correct me if I'm wrong, tho.

    thanks in advance.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: NOT zooming childs after parent zoom.

    Quote Originally Posted by alitoh View Post
    If I were to use the Ignores Transformation flag, wouldn-t it ignore the parent transformation?
    If you mean the position of an item relative to its parent then no. If you mean anything related to scaling or rotating the parent then yes.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Mar 2011
    Posts
    82
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: NOT zooming childs after parent zoom.

    Quote Originally Posted by wysota View Post
    If you mean the position of an item relative to its parent then no. If you mean anything related to scaling or rotating the parent then yes.
    Wouldn't zoom cound as a scalling? That is, if I were to zoom the parent object, wouldn't the "unit" that the child object uses to draw itself change too? Say that at 1:1 zoom you have a child at (30,55), which is in the local, parent's unit system. Would that scalling remain for the child if I zoom the object? (like, if I were to zoom in, the redraw would move the childs closer to the parent's (0,0) because that scale would be different than before?)

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: NOT zooming childs after parent zoom.

    Quote Originally Posted by alitoh View Post
    Wouldn't zoom cound as a scalling?
    Yes. And I understand you wish your child item to not zoom when the parent zooms so it fits the usecase.

    That is, if I were to zoom the parent object, wouldn't the "unit" that the child object uses to draw itself change too?
    No. That's the whole point of ItemIgnoresTransformations.
    Say that at 1:1 zoom you have a child at (30,55), which is in the local, parent's unit system. Would that scalling remain for the child if I zoom the object?
    The child would still be at (30,55) of the parent's coordinate system and it would remain the same size (so its scale relative to the parent would change).
    This is usually used for implementing labels for objects, we usually do not want to scale those if the items they describe scale.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. how to zoom in zoom out tableview in QT programming?
    By nageshvk in forum Qt Programming
    Replies: 0
    Last Post: 27th October 2010, 05:05
  2. QWTPlot Zoom: cannot zoom negative value
    By jwieland in forum Qwt
    Replies: 0
    Last Post: 8th January 2010, 16:16
  3. Replies: 1
    Last Post: 16th November 2009, 05:25
  4. QGLWidget with text - zoom in / zoom out
    By h123 in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2008, 09:56
  5. Drag & Drop when parent and childs accept drops?
    By gri in forum Qt Programming
    Replies: 0
    Last Post: 17th October 2008, 09:00

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.