根据Qt Documentation,“void QGraphicsItem :: update(const QRectF&rect = QRectF())”不会立即引起油漆;相反,它会在控制到达事件循环后调度由QGraphicsView处理的绘制请求。这是我的代码:
this->item->setPixmap( QPixmap::fromImage(*coloration->image) );// QGraphicsPixmapItem
this->item->update();
this->scene->update(); // QGraphicsScene
this->view->update(); // QGraphicsView
并且代码在一个方法中,该方法将每100毫秒调用一次(并且其中着色 - >图像将改变),但是Qt拒绝每100毫秒更新一次图像,并且它只渲染最终图像。那么,我怎么能立刻画出这个项目呢?
你必须阻止你的事件循环,否则你的项目实现是不好的。我无法重现你的问题。