Results 1 to 3 of 3

Thread: QPainter::rotate problem in QGraphicsItem

  1. #1
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default QPainter::rotate problem in QGraphicsItem

    When i draw a pixmap in QGraphicsItem by painter and then rotate it, it won't erase previous state ! :S

    there is an attachment.(there is dial i want to rotate needle but you see what happens!)Screenshot-1.jpg

  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: QPainter::rotate problem in QGraphicsItem

    Show us your code please.
    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
    Aug 2012
    Posts
    1
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: QPainter::rotate problem in QGraphicsItem

    I have same problem. How can I rotate a widget which on another widget? This is my code:

    Qt Code:
    1. ..
    2. QGraphicsScene *scene = new QGraphicsScene(ui->gemiSekme);
    3. QGraphicsItem *item = new QGraphicsItem(ui->label_2);
    4. item->rotate(45);
    5. scene->addItem(item);
    6. ui->graphicsView->setScene(scene);
    To copy to clipboard, switch view to plain text mode 
    I get this error:
    Qt Code:
    1. error: cannot allocate an object of abstract type 'QGraphicsItem'
    To copy to clipboard, switch view to plain text mode 
    Also I tried this code, does not run.
    Qt Code:
    1. ..
    2. QGraphicsProxyWidget *proxy = scene.addWidget(ui->label_2);
    3. proxy->rotate(20);
    4. ui->graphicsView->setScene( &scene);
    5. ui->graphicsView->show();
    To copy to clipboard, switch view to plain text mode 
    Thanks for your time.

Similar Threads

  1. QPainter::rotate and Qwt problems
    By alex_sh in forum Qwt
    Replies: 2
    Last Post: 20th October 2011, 17:44
  2. Is it possible to use QPainter with QGraphicsItem?
    By william.dias in forum Qt Programming
    Replies: 4
    Last Post: 2nd February 2008, 10:19
  3. Qt3-QPainter rotate exception
    By Raccoon29 in forum Qt Programming
    Replies: 4
    Last Post: 4th September 2007, 17:43
  4. Replies: 3
    Last Post: 30th April 2006, 19:22
  5. QPainter rotate function
    By ir210 in forum Newbie
    Replies: 3
    Last Post: 17th January 2006, 04: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.