QGraphicssceneの背景として色付きのタイルを描画し、QGraphicsViewを使用してシーンにパンおよびズーム機能を提供したいと思います。まず、QGraphicItemsを使用して各タイルを描画しました。私は多くのタイルを持っているので、これはパンまたはズーム時にかなりのパフォーマンスの問題でしたが、後でタイルのどの部分も変更する必要がないので、次のコードを使用してQPixmapの生成に切り替えました。
void plotGrid(){
    Plotable::GraphicItems items;
    append(items,mParticleFilter.createGridGraphics());
    append(items,mParticleFilter.getRoi().mRectangle.createGraphics(greenPen()));
    scaleItems(items,1.0,-1.0);
    QGraphicsScene scene;
    showItemsOnScene(items,&scene);
    QRectF boundingRect = scene.itemsBoundingRect();
    double cScale = ceil(1920.0/boundingRect.size().width());
    QSize size(boundingRect.size().toSize()*cScale);
    QPixmap pixmap(size);
    pixmap.fill(Qt::transparent);
    QPainter p(&pixmap);
    //p.setRenderHint(QPainter::Antialiasing);
    scene.render(&p);
    p.end();
    QGraphicsPixmapItem* item = new QGraphicsPixmapItem(pixmap);
    item->setOffset(boundingRect.topLeft()*cScale);
    item->scale(1/cScale,1/cScale);
    mpView->showOnScene(item);
  }
これでズームとパンの問題は解決しますが、ピックスマップを生成する時間は、おそらく最初にシーンを作成してからレンダリングするため、かなりの遅延が発生します。QGraphicItemsから開始してその場でQPixmapを作成するより速い方法はありますか?
完全を期すために、タイルの画像: