I am trying to implement a custom maps, which is consists on multiple tile images.
I could successfully load tiles based on viewport Rect.
void updateRasterTiles(const QRectF &viewport)
{
.....
Q_FOREACH(QString fileName, fileNames)
{
XXX::IRasterGISItem* rasterGISItem = provider->provide(fileName);
QGraphicsItem* graphicsItem = dynamic_cast<QGraphicsItem*>(rasterGISItem);
graphicsItem->setPos(d->tilesResolutionTopLeftDirectoryHash.key(fileName)->x(),
d->tilesResolutionTopLeftDirectoryHash.key(fileName)->y());
rasterGISLayerItem->addRasterGISItem(rasterGISItem);
}
.....
}
So, whenever i give topleft and bottomRight coordinates, it successfully loads the images on the QGraphicsItem.
Issue:-
i am looking for something like signal or event,
Where, if viewport coordinate changes via mouse drag / wheel (zoom in/out), i can all this updateRasterTiles(const QRectF & viewport)