SEXP qt_qupdate_QGraphicsItem(SEXP rself) { QGraphicsItem *item = unwrapQGraphicsItem(rself, QGraphicsItem); // HACK: purge the cache before updating. QGraphicsScene does not // seem to update the cache properly when there are multiple // views. This is not very efficient, but usually one is not // caching items that are frequently updated. QGraphicsItem::CacheMode mode = item->cacheMode(); item->setCacheMode(QGraphicsItem::NoCache); item->setCacheMode(mode); item->update(); return rself; }
SEXP qt_qupdate_QGraphicsScene(SEXP rself) { QGraphicsScene *scene = unwrapQObject(rself, QGraphicsScene); QList<QGraphicsItem *> items = scene->items(); for (int i = 0; i < items.size(); i++) { QGraphicsItem *item = items[i]; QGraphicsItem::CacheMode mode = item->cacheMode(); item->setCacheMode(QGraphicsItem::NoCache); item->setCacheMode(mode); } scene->update(); return rself; }
SEXP qt_qcacheMode_QGraphicsItem(SEXP rself) { QGraphicsItem *item = unwrapQGraphicsItem(rself, QGraphicsItem); return ScalarInteger(item->cacheMode()); }