Select to view content in your preferred language

How to migrate from QGraphicsView to MapGraphicsView?

1221
1
10-14-2020 11:05 PM
FatmaAkdemir
Frequent Contributor

 I have an application (not QML) using Qt's QGraphicsView framework. I want to change my application so that I have a basemap as background and some items on that map. I have a QGraphicsScene in which my items (QGraphicsItem) are added. How can I change my items so that QGraphicsItem's are added to Esri::ArcGISRuntime::Map instead of QGraphicsScene? I could not find any example on Internet.

0 Kudos
1 Reply
JamesBallard1
Esri Regular Contributor

Hi Fatma Akdemir‌,

      We do have some Widgets examples apps in our samples repo. I would encourage you to take a look at those.

arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples_Widgets at master · Esri/arcgis-runtime-samp... 

Also if you check into the templates we provide with our SDK, one of them is a Qt Widgets template. After you run the post installer after SDK installation, our templates will be integrated into Qt Creator. The widgets one will be called "ArcGIS Runtime 100.9 Qt Widgets app", or whatever version you have installed. Here is some info about our templates.

Develop your first map app—ArcGIS Runtime SDK for Qt | ArcGIS for Developers 

The template shows a different workflow than our samples by subclassing QMainWindow and calling setCentralWidget. That might be closer to the pattern you use now.

0 Kudos