Results 1 to 10 of 10

Thread: QGraphicsItems somtimes not diplaying

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Posts
    81
    Thanks
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QGraphicsItems somtimes not diplaying

    Hello all, I have a rather weird problem.

    I have a class started in QThread which sends via signals/slots to another class information for a QGraphicsItems which are then placed on the QGraphicsScene. The problem arises when I send too many of these items....sometimes some items simply don't get diplayed; it is completely random which ones don't get drawn on the scene...and it is always just a couple that don't get displayed...the majority 98% or so always do...

    here is my code in the slot that catches the signal from the thread.

    void myClass::getItem(...){
    m_items.push_back(new itemOnScene(...));
    m_mainScene->addItem(items.back());
    m_items.back()->setPos(QPointF(0, 0));
    m_items.back()->setVisible(true);//defualt is true anyways...just to make sure...
    m_items.back()->update();//just to make sure...
    }

    if I add Sleep(10); after the update call all items are displayed 100% of the time...what's going on with QT? A signal being sent too close after a previous one gets lost? What's going on here? Does this have to do with how items are painted?

    Thanks for your help in advance...a truly baffling problem...

    Jonathan

    Edit://even works all the time with Sleep(1);
    Last edited by JonathanForQT4; 1st June 2007 at 14:18.

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.