1

現在QGraphicsViewによって行われている、表示したい大きなQGraphicsSceneがあります。ローカルで使用する場合はすべて問題ありませんが、アプリを ssh -X で使用するとすぐに非常に遅くなります。もちろん、いくつかのデータは常に転送する必要がありますが、たとえば画像をパンするだけの場合など、何も変わらない場合、帯域幅を節約するにはどうすればよいでしょうか?

これは私の QGraphicsView です:

#include "graphicsview.h"
#include <QGraphicsPixmapItem>
#include <QPixmap>
#include <QDebug>
#include <QMouseEvent>
#include <QWheelEvent>
#include <cmath>
#include <QPixmapCache>

GraphicsView::GraphicsView(QWidget *parent) :
    QGraphicsView(parent)
{
    QPixmapCache::setCacheLimit(16777216); //did not do the trick either
    this->setMouseTracking(true);
    setTransformationAnchor(AnchorUnderMouse);
    this->setDragMode(QGraphicsView::ScrollHandDrag);
    scene = new QGraphicsScene(this);
    setScene(scene);
    background = QPixmap(8000,8000);
    qDebug() << background.rect();
    scene->setSceneRect(background.rect());
    scene->setBackgroundBrush(QBrush(background));
    show();
}

void GraphicsView::wheelEvent(QWheelEvent* event) {
    scale(pow(2,event->delta()/240.0), pow(2,event->delta()/240.0));
}
4

0 に答える 0