I am trying to upgrade my Seismic Graph Viewer to use tile graphics rendering. I am very unfamiliar with the process but my attempt to create a simple example is below. The reason why I need to use either QVector or QCache(I'm using QVector right now for simplicity) is to save ram and the tiles needed to be created on the fly. I'm not entirely sure if you're able to do what I'm trying to do below, but essentially it creates an array of bitmaps, makes them items, and then tries to add them to the scene. There are twelve errors when this program compiles, none of which directly refer the code that I made in the mainWindow.cpp.
the errors are either this
C:\Qt\Qt5.9.1\5.9.1\mingw53_32\include\QtCore\qvector.h:713: error: use of deleted function 'QGraphicsPixmapItem& QGraphicsPixmapItem::operator=(const QGraphicsPixmapItem&)' with the only thing changing being the location of the error (different header files)
or this
C:\Qt\Qt5.9.1\5.9.1\mingw53_32\include\QtWidgets\qgraphicsitem.h:861: error: 'QGraphicsPixmapItem::QGraphicsPixmapItem(const QGraphicsPixmapItem&)' is private Q_DISABLE_COPY(QGraphicsPixmapItem) which is in the qgraphicsitem.h header file
The code that produces doesn't compile due to these errors popping up in the header files
int count;
QVector<QBitmap> BitmapArrayTiles;
QVector<QGraphicsPixmapItem> PixmapItemsArray;
QGraphicsPixmapItem currentItem;
QBitmap currentBitmap;
QGraphicsScene *scene = new QGraphicsScene();
for(count = 0; count < 4; count++)
{
currentBitmap = QBitmap(150,150);
QPainter Painter(¤tBitmap);
QPen Pen(Qt::black); // just to be explicit
Painter.setPen(Pen);
drawStuff(Painter);
BitmapArrayTiles.insert(0, currentBitmap);
currentItem.setPixmap(BitmapArrayTiles[count]);
PixmapItemsArray.insert(count, currentItem);
scene->addItem(¤tItem);
currentItem.mapToScene((count*150)+150, (count*150)+150);
}
ui->TileView->setScene(scene);
^
I have not changed the header files manually so I'm not entirely sure why I would be getting these errors.