Results 1 to 8 of 8

Thread: {x,y,z}Rotation property of QGraphicsItem has gone?

  1. #1
    Join Date
    Sep 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default {x,y,z}Rotation property of QGraphicsItem has gone?

    Hi,
    i wonder if anyone knows what happened with a great facility described at QT Blog http://labs.trolltech.com/blogs/2009...spin-on-things

    It looks like {x,y,z}Rotation property of QGraphicsItem won't reach Qt release - code from blog does not work both with 4.6-stable and trunk.

    Is there any other technique you can advise to rotate QGraphicsItem instead of yRotaion + QPropertyAnimation? Is it only QGraphicsRotation + QTimeLine?

    Thanks,
    - Giga

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

    Default Re: {x,y,z}Rotation property of QGraphicsItem has gone?

    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
    Sep 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: {x,y,z}Rotation property of QGraphicsItem has gone?

    It rotates item around z-axis, while i need either x- or y-axis rotation. That is what {x,y,z}Roration property about.

  4. #4
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: {x,y,z}Rotation property of QGraphicsItem has gone?

    Quote Originally Posted by Giga View Post
    It rotates item around z-axis,
    This is true.

    Quote Originally Posted by Giga View Post
    while i need either x- or y-axis rotation
    If you want a 3D rotation, you can use OpenGL.
    Rotation in OpenGL is accomplished through the glRotate*() function, which is defined as:
    Qt Code:
    1. void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
    2. void glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
    To copy to clipboard, switch view to plain text mode 
    So you can provide the axis of rotation.

    You can even try it for Qt 4.6 technology preview is released.
    http://qt.nokia.com/developer/qt-4.6-technology-preview

  5. #5
    Join Date
    Sep 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: {x,y,z}Rotation property of QGraphicsItem has gone?

    Right. glRotate*() rotates GL content, but not entire widget.
    What i need is to rotate an item in graphics scene.

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

    Default Re: {x,y,z}Rotation property of QGraphicsItem has gone?

    Quote Originally Posted by Giga View Post
    It rotates item around z-axis, while i need either x- or y-axis rotation. That is what {x,y,z}Roration property about.
    QGraphicsItem::setTransform() and QTransform::rotate().
    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.


  7. The following user says thank you to wysota for this useful post:

    mhvoorsluys (15th November 2011)

  8. #7
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: {x,y,z}Rotation property of QGraphicsItem has gone?

    Quote Originally Posted by wysota View Post
    QTransform class specifies 2D transformations of a coordinate system.

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

    Default Re: {x,y,z}Rotation property of QGraphicsItem has gone?

    Quote Originally Posted by yogeshgokul View Post
    QTransform class specifies 2D transformations of a coordinate system.
    So? Is your monitor 3D? OpenGL does 2D transformations as well. Sometimes it is worth reading more than just the first sentence of the docs.

    "QTransform differs from QMatrix in that it is a true 3x3 matrix, allowing perspective transformations".
    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. destruction of QGraphicsItem
    By killkolor in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2009, 10:31
  2. Replies: 2
    Last Post: 1st April 2009, 23:52
  3. Replies: 1
    Last Post: 25th February 2009, 00:34
  4. FrameShape property for Q3GroupBox
    By user_mail07 in forum Qt Tools
    Replies: 3
    Last Post: 16th February 2007, 14:41
  5. QPushbutton Flat property and icon appearance.
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 4th November 2006, 08:30

Tags for this Thread

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.