Results 1 to 6 of 6

Thread: QGraphicsItem disappeare during rotation around Qt::XAxis

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2008
    Location
    Czech
    Posts
    44
    Thanks
    2
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default QGraphicsItem disappeare during rotation around Qt::XAxis

    Hi,
    I can't find the reason, why my object disappearing during transformation around the XAxis.
    I am showing here the short code which better expain what I mean.
    When I use QTransform on the scene and rotate the view, then if i use high angle the QGraphicsRectItem disappeare.
    Or if I make the view window height bigger, which anybody who would help me can try in this small app.


    Qt Code:
    1. #include <QApplication>
    2. #include <QGraphicsView>
    3.  
    4.  
    5. int main(int argc, char **argv)
    6. {
    7. QApplication app(argc, argv);
    8.  
    9. scene.addRect(QRectF(0,0,100,100), QPen(), QBrush(QColor(Qt::red)));
    10. QGraphicsView view(&scene);
    11. view.show();
    12.  
    13. QTransform transform;
    14. transform.rotate(80, Qt::XAxis);
    15. view.setTransform(transform);
    16.  
    17. return app.exec();
    18. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 18th January 2009 at 21:56. Reason: missing [code] tags

Similar Threads

  1. Problem with rotation of QGraphicsItem
    By ashishsaryar in forum Qt Programming
    Replies: 2
    Last Post: 10th July 2008, 15:03
  2. rotation of an animated QGraphicsItem
    By darksaga in forum Qt Programming
    Replies: 9
    Last Post: 9th September 2007, 08:11

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.