Results 1 to 4 of 4

Thread: Bend QGraphicsItem animation

  1. #1
    Join Date
    Jun 2010
    Posts
    97
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Bend QGraphicsItem animation

    Hi,

    I am developing application which involves QGraphicsItem animation using QPropertyAnimation.
    As per application requirement, I have to bend QGraphicsRectItem's one end to certain degree using animation. What is the mechanism available to bend QGraphicsItem. Pl. find attached picture for reference.


    Thanks

    Manish
    Attached Images Attached Images

  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: Bend QGraphicsItem animation

    If you can do the bending yourself then you can use QGraphicsTransform to modify any graphics item. Other than that it might be easier to implement your own graphics item from scratch.
    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
    Jun 2010
    Posts
    97
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Bend QGraphicsItem animation

    Thanks wysota,

    I am not sure about how to bend it. QGraphicsTransform do not have anything to bend it.
    Any clue which will help me to bend rectangle box will be appreciated.


    Thanks

    Manish

  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: Bend QGraphicsItem animation

    If you want to use QGraphicsTransform then you need to do proper maths and do the bending yourself. There is no QGraphicsBendMyItemInAnArbitraryPlaceTransform class that you can just take and use. If you just want an item with a rounded corner then use QGraphicsPathItem and compose the path of two lines connected with an arc.
    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. Replies: 7
    Last Post: 29th November 2010, 19:20
  2. Animation of QGraphicsItem in QGraphicsView
    By mirelon in forum Qt Programming
    Replies: 4
    Last Post: 19th December 2009, 15:25
  3. Animation in Qt
    By yogesh884 in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2009, 09:56
  4. Casting QGraphicsItem child from QGraphicsItem
    By patrik08 in forum Qt Programming
    Replies: 3
    Last Post: 29th August 2008, 15:37
  5. Replies: 2
    Last Post: 28th June 2008, 16:31

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.