Results 1 to 5 of 5

Thread: QGraphicsObject text not updating on QGraphicsView widget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2014
    Posts
    23
    Thanks
    4

    Default QGraphicsObject text not updating on QGraphicsView widget

    I have created an object using QGraphicsObject as Base class, in this object's paint function i am using painter->drawText() function to draw a text at a particular coordinate..... The text gets updated only when i do some mouse action inside QGraphicsView Widget or outside the application......if i put a timer and constantly trying to update text , its not getting updates......

    I need to be able to update Text with timer also.....any help is appreciated

    Here is my code for paint function

    void Text_Display:aint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
    {
    painter->setFont(font);
    painter->setPen(pen);
    painter->drawText(pos.x(),pos.y(),text);
    }


    -> Paint function is being called repeatatly and text variable is getting updated too , only thing is it's not getting updated on screen
    Last edited by vinothrajendran; 2nd July 2015 at 09:10.

Similar Threads

  1. Replies: 1
    Last Post: 28th July 2011, 11:28
  2. Listwidgetitem text is chpopped while updating widget
    By sudhansu in forum Qt Programming
    Replies: 1
    Last Post: 24th June 2010, 15:37
  3. QGraphicsView not updating properly.
    By spraff in forum Qt Programming
    Replies: 0
    Last Post: 3rd July 2009, 10:36
  4. Replies: 9
    Last Post: 22nd February 2008, 16:22
  5. Updating QGraphicsView
    By has2k1 in forum Newbie
    Replies: 2
    Last Post: 8th April 2007, 21:02

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.