Skip navigation
All Places > Developer Communities > Native App Developers > ArcGIS Runtime SDK for Qt > Blog
1 2 Previous Next

ArcGIS Runtime SDK for Qt

28 posts

macOS Catalina introduced a new feature called Gatekeeper, which is designed to keep your Mac safe from malicious apps. In order for Mac apps to run without being flagged as potentially malicious, there is a new notarization process in place for all apps distributed outside of the macOS App Store. The new notarization process will be enforced starting February 3, 2020. All currently released ArcGIS Runtime SDK for Qt installers and sample viewers have not undergone this process, so these released apps will begin to be flagged when opened. The next release of the software will be notarized. For the time being, the installer, post installer, and sample viewers can be run by going to System Preferences > Security & Privacy > under the General tab, find the app you want to run, and select Open Anyway. These details and more can be found in the Apple documentation.

We're pleased to announce an update to the ArcGIS Runtime SDK for Qt Embedded Linux Beta program: Beta 3.

Beta 3 is now based on the 100.7 Runtime release, so you can use all the great new features from 100.7 on your Embedded Linux devices. Some of the highlights are discussed in this blog.

 

In addition, the new release of the SDK is built on top of Qt 5.12.6, which means your apps must be built with 5.12.6 or later. Additional release notes can be found in the Qt SDK Guide.

 

As before, we're interested to see what types of solutions you're going to build. Whether this project moves forward or not depends entirely on your feedback. We're available on the early adopter forums, so feel free to reach out with any questions. We want to know what types of devices you want to target, or if there are devices we don't support yet that you want.

 

Head over to https://earlyadopter.esri.com/key/runtimeqtembeddedlinux to get started.

We are pleased to announce that Qt joins the other Runtime SDKs in supporting AR workflows for iOS and Android platforms. The primary workflows supported include displaying 3D scenes on a tabletop, exploring scenes in flyover mode, and displaying 3D GIS content in full scale. More details about the capabilities of AR in Runtime can be found in this blogpost. To get started, reference the details in our Toolkit's readme.

We're pleased to announce an update to the ArcGIS Runtime SDK for Qt Embedded Linux Beta program: Beta 2.

Beta 2 is now based on the 100.6 Runtime release, so you can use all the great new features from 100.5 and 100.6 on your Embedded Linux devices. We've also done some internal build improvements and optimizations which should result in better performance for your apps.

Since the Beta 1 release we've tested on even lower-end devices. We've deployed apps to the NVIDIA® Jetson Nano™ developer kit, which is a $99 device.

As before, we're interested to see what types of solutions you're going to build. We're available on the early adopter forums, so feel free to reach out with any questions. We want to know what types of devices you want to target, or if there are devices we don't support yet that you want.

Head over to https://earlyadopter.esri.com/key/runtimeqtembeddedlinux to get started.

Beginning with Qt version 5.12.4, Qt relies on a newer version of OpenSSL. Details of this upgrade are highlighted in this Qt blog. Please build OpenSSL for your Qt application using the latest version of OpenSSL recommended by Qt. For more information, see OpenSSL.  Also note that due to the recent updates to OpenSSL, Esri will no longer be shipping the Android OpenSSL libs.

LDanzinger-esristaff

Update 5 is here!

Posted by LDanzinger-esristaff Employee Apr 10, 2019

Yesterday, we released Update 5 of ArcGIS Runtime SDK for Qt version 100. To get an overview all of the new functionality across all of the Runtime SDKs, you can read the blog on the ArcGIS Blog. Some notable new features include support for WFS, 3D subsurface navigation, mobile scene packages, and several new 3D layer types. In addition to this, the Qt team has been working very hard on some additional work items throughout the release. Here are some noteworthy things to know about the Update 5 release for the Qt SDK:

 

Qt 5.12 Upgrade


We updated our build environment to be based on Qt 5.12. This brought us a whole host of new features such as improved performance and memory consumption. In addition, 5.12 brought in support for Xcode 10, which is critical for apps that are deployed to Apple's AppStore. Finally, 5.12 brought in a compiler change in Android from gcc to clang. This allowed us to update our NDK minimum and bring in support for Android armv8 (64-bit). This is crucial for apps that are deployed to the Google Play Store and also opens the door for performance gains.

 

C++ 11 range-based for loops


We now fully support using C++ 11 style range-based for loops with our list model types. This means you can migrate your C-style loops from this:

for (int i = 1; i < m_graphicsOverlay->graphics()->size(); i++)
{
}

to this:

for (auto graphic : *(m_graphicsOverlay->graphics()))
{
}

 

New compiler warnings for deprecations


We have refactored the selection mechanism for visually selecting features and graphics in 2D and 3D. As such, we have some newly deprecated members. As part of this release, we have introduced new compiler warnings that will warn you if you are using these deprecated members. We plan to use this pattern going forward to notify you of any API deprecations.

 

ECMAScript 6 & 7 Support


One of the cool new features of Qt 5.12 is the inclusion of ES 6 & 7 features within QML's JavaScript engine. We have sanity tested many of the newer JS language features and everything thus far is working as expected. Some new features include arrow functions, string interpolation, constant variables (const instead of var), block scoped variables (let instead of var), function default parameters, classes, static functions, and more. This was one of the topics of discussion at this year's Dev Summit, so feel free to check out this video of the presentation if you'd like to hear more.

 

TableView


Qt 5.12 brings in support for a new Qt Quick Table View. At the Dev Summit last month, Neil MacDonald gave an interesting talk on how you can use our AttributeListModel and the Qt Quick Table View to build an attribute table. You can watch this presentation here.

 

Sample Improvements


Upgrading our minimum to Qt 5.12 means that we now fully embrace Qt Quick Controls 2 and have removed Qt Quick Controls 1 from all samples (Qt Quick Controls 1 were deprecated at 5.11). As such, we now have a unified style throughout the samples and our sample viewer app, and we were also able to utilize Qt's new high DPI support. This can be enabled by setting 

QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

in your main.cpp. Once this is enabled, your code can be cleaned up by removing all of the scaleFactor multiplications that were previously required to scale pixel values on different DPI devices. In the coming weeks, we will be adding more Update 5 samples to the master branch of our GitHub page, so please continue to watch the repo here.

 

Platform updates


As mentioned in our 100.4 release notes, 100.5 will no longer support Ubuntu 14.04, macOS Sierra, or iOS 10. As such, 100.5 also dropped support for 32-bit iOS, which means our static library size was cut in half, and the macOS installer is now significantly smaller than previous releases. As mentioned earlier, we now support 64-bit android, and we also have an embedded Linux beta available for ARM devices. You can join this beta program through the early adopter site.

Today, The Qt Company announced the release of Qt 5.12 LTS. This release brings with it support for Xcode 10 for the first time. ArcGIS Runtime SDK for Qt 100.4 was built with Qt version 5.9, which for iOS builds, utilizes Xcode 9. 

 

What does this mean?

 

If you develop iOS apps with ArcGIS Runtime SDK for Qt 100.4, you should continue to use Xcode 9. We have performed some ad-hoc testing with Xcode 10, and have not found any new issues, but it is possible that there are some binary compatibility issues, and we therefore do not recommend this. Starting in March 2019, Apple's App Store will require that all submission be built with Xcode 10. We recommend pushing any required updates before this date and waiting for the 100.5 release of ArcGIS Runtime, which will support Xcode 10. We are planning on releasing 100.5 near the end of Q1 2019, so we hope this will cause minimal issues.

 

Thanks!

 

The ArcGIS Runtime SDK for Qt Development Team

Today, The Qt Company announced that Qt 5.12 LTS has been released! LTS. This stands for "Long-Term Support". There are some important changes in this release that could affect current ArcGIS Runtime Qt developers who build for Android. We would like to bring these to your attention.

 

Prior to Qt 5.12, the Qt Android kits were built using the GCC compiler. Starting with Qt 5.12, the Android kits are now built with the Clang compiler and a newer version of the NDK, which no longer supports GCC. What does this mean to you? If you develop Qt Android apps and use ArcGIS Runtime SDK for Qt versions 100.0-100.4, you will not be able to use 5.12, as the currently released Android binaries support GCC only. If you require Android and Qt 5.12, you will need to wait for our 100.5 release, which will be built with 5.12 and Clang. Other platforms are not affected, and you can use 5.12 with our previous releases of ArcGIS Runtime without any known issues.

 

As always, we are keen to hear about your experiences.

 

Happy coding!

 

The ArcGIS Runtime SDK for Qt Development Team

It's Update 3 release time! On top of the many exciting new features that are supported across the Runtime SDKs (web scenes, 3D distance measurement analysis, identifying and selecting web scene features, new WMS capibilities, etc), the Qt team has been hard at work adding some new features unique to this SDK for 100.3.

 

Here are some of the highlights...


Runtime API

 

  • Transactional edit support. This allows the developer to commit or rollback a set of edits as one transaction. Other APIs introduced this at Update 2, and Qt now supports this feature with Update 3.
  • Pagination of query results. This allows developers to set a result offset in the QueryParameters so that results can easily be paginated. Other APIs introduced this at Update 2, and Qt now supports this feature with Update 3.
  • Time aware layers. The TimeAware interface was added and implemented by FeatureLayer, RasterLayer, ArcGISMapImageLayer, and WmsLayer. The new API allows you to set a time extent on the GeoView, and all layers participating will be filtered by the time extent. Other APIs introduced this at Update 2, and Qt now supports this feature with Update 3.
  • The Runtime Error object is now creatable. This means that you can create custom Errors throughout your application and utilize the same error handling logic throughout your application, as well as provide additional details for any known issues.
  • Support for OpenGL rendering on Windows. Qt has two different rendering engines for the Windows platform : OpenGL and DirectX via ANGLE. By default, Qt will try and render using OpenGL and if the proper drivers are not available, it will fall back to using ANGLE. Previous releases of ArcGIS Runtime only supported ANGLE. Update 3 fully supports both OpenGL and ANGLE so that you can fully utilize either rendering engine and Qt's fallback mechanism for when OpenGL cannot be utilized on a given system. For more information on this, please see Qt's documenation - https://wiki.qt.io/Qt_5_on_Windows_ANGLE_and_OpenGL
  • Ability to get size and ID properties as either a string or int type in QML. Previously, these properties always returned as strings due to a limitation of the QML integer type being a 32-bit integer as opposed to 64-bit. You can now request the property as an int and get an actual QML int back.


Toolkit API

 

  • TimeSlider toolkit component. Coinciding with our new TimeAware support is a ready-to-use Toolkit component that allows you easily filter data based on time. The TimeSlider also allows you to play and pause an animation of your spatiotemporal data.
  • CoordinateConversion toolkit component. An easy-to-use UI component is now available to help you convert a given coordinate to one or more different formats. For example, you could convert from Decimal Degrees to MGRS with this tool. This tool has a slick new UI making use of the modern Qt Quick Controls 2 module.


SDK improvements

 

  • Improved API documentation details added, as well as additional code snippets added throughout the documentation.
  • Dozens of new samples have been added, with an extra emphasis placed on providing more fundamental samples, such as Geometry and GeometryEngine samples, as opposed to only new features.

 

We are looking forward to hearing about your experience with this exciting release. Happy coding!

 

- The Qt SDK Development Team

We've identified an issue with the templates provided with the SDK installation. You'd get these added to Qt Creator if you run the post installer and select the Qt Creator option. The issue is minor. However, with Qt Creator 4.6.0, Qt Creator will crash if you attempt to create any of the templates after the first page of the template wizard.

We've fixed the templates for the upcoming Summer release (100.3) of the ArcGIS Runtime SDK for Qt.

The issue is the same for all the templates. There's a section in the wizard.json file that references an invalid index.

 

If you change that value to 0 or 1 it will fix the issue. If you've already run the post installer then the templates will be installed on your system. For example, on Windows, the templates are found in this path:

C:\Users\<user>\AppData\Roaming\QtProject\qtcreator\templates\wizards\ArcGISRuntime*

On Linux:

/<user_home>/.config/QtProject/qtcreator/templates/wizards/ArcGISRuntime*

In those template directories, you can find the wizard.json file and make the updates. You'll need to restart Qt Creator after you've made the changes.

We apologize for any disruptions in your development this may have caused.

 

Sincerely,

 

The ArcGIS Runtime SDK for Qt Development Team

Early next week, we will be announcing the release of 100.2.0, also known as Update 2, for you to download. We're very excited about this release for a number of reasons. 100.2 is the culmination of what we envisioned the Quartz 100 Runtime platform to be. It also brings us closer to functional parity with the 10.2.x versions of Runtime. Here are some highlights to look forward to:

 

  • Display and identify WMS layer
  • Display and identify ENC layers (Electronic Navigational Charts)  
  • Read and edit shapefiles
  • Read rasters from GeoPackage
  • Read and edit vector data from GeoPackage
  • Support for multi-layered symbology
  • Analysis - viewshed and line of sight on the GPU
  • Statistical queries
  • Improved support for geotransformations and custom geotransformations
  • Offline mapping enhancements - Preplanned workflows
  • A few additional tools: Compass and Coordinate Conversion tools
  • A new topic that indicates which classes invoke which Runtime license level (extremely useful!)

These are just a few.

 

We'll be announcing the release very soon, so keep watch! As always, thank you for using ArcGIS Runtime SDK for Qt.

ArcGIS Pro is a powerful desktop application that allows you to perform many essential GIS tasks, such as designing maps and symbols. One common requirement that many organizations have is to use a standardized set of symbols in their maps, so that they have a consistent look and feel associated with their maps and their brand. The best way to handle this is to create a Style and to store all of your symbols in the Style. You can then share this Style file with anyone in your organization so they can access the same symbols. This is not a new workflow - Styles have been around in ArcMap for quite some time. But one really cool new things you can do with ArcGIS Pro is create Mobile Style Files, which are style files that can be shared with ArcGIS Runtime based applications. This means that you can create your custom symbol sets in ArcGIS Pro, and then apply those same symbols to graphics and features in ArcGIS Runtime Apps. If you have ever wanted to create and display intricate custom symbols that are beyond what the Runtime API will allow you to programmatically create, then this workflow is for you.

 

Step 1: Create a Mobile Style File in Pro

  • Open Pro and create a new Project
  • Open your Catalog Window and find the "Styles" section
  • Right click Styles and select New > New Mobile Style.
  • Give a name and location to create the style file.
  • More details on the specs and limitations of a Mobile Style file can be found here.

 

Step 2: Create and save a custom symbol into the Style File

  • Insert a new map and add some vector data to your map
  • Select the layer in the Contents pane, right click, and select Symbology
  • This will open the Symbology pane and display the current symbol for the layer. You can modify this by changing color, size, and adding additional symbol layers. This allows you to make a completely customized symbol. Modify the symbol to your liking, and press Apply to see the symbol applied to the map.
  • Once you have the desired output, click the "hamburger" icon in the top right of the Symbology pane and select Save Symbol to Style.
  • Fill in the Name and Category and optionally give it a Key. This key will be used for fetching the Symbol in Runtime. (You could also query for all symbols and sort through the results programmatically, but retaining and fetching from a Key is the most straight forward way to get started)
  • From the Style dropdown, select your newly created Style file.
  • Click OK, and your symbol is now saved to your Style file and is ready for use in ArcGIS Runtime.
  • More details about the process of creating symbol styles can be found here.

 

Step 3: Consume in Runtime

  • Create a GraphicsOverlay object to display Graphics in a MapView
  • m_graphicsOverlay = new GraphicsOverlay(this);
  • Create a SimpleRenderer and set this to the GraphicsOverlay. A SimpleRenderer will display the same symbol for every graphic in the overlay
m_simpleRenderer = new SimpleRenderer(this);
m_graphicsOverlay->setRenderer(m_simpleRenderer);
  • Create a SymbolStyle object by passing in the path to the constructor 
m_symbolStyle = new SymbolStyle("/Users/<username>/Desktop/RuntimeStyles.stylx", this);
  • Connect to the SymbolStyle::fetchSignalCompleted signal. This will emit when a symbol has been asynchronously fetched from the Style. A Symbol object is passed through as a parameter, and this symbol object can then be used to set the symbol used by the SimpleRenderer
connect(m_symbolStyle, &SymbolStyle::fetchSymbolCompleted, this, [this](QUuid, Symbol* symbol)
{
  m_simpleRenderer->setSymbol(symbol);
});
  • Fetch the symbol by the unique Key defined in Pro 
  • m_symbolStyle->fetchSymbol(QStringList{"RuntimeArrow"});
  • Add graphics to your graphics overlay, and they will be symbolized with the custom symbol. In the below example, a simple black line with an arrow at the end of the line was created in Pro and consumed in ArcGIS Runtime.

 

 

An example ArcGIS Runtime project can be found here. You will need to update the path to your style file and any keywords that you may be searching for.

Geofencing is a concept in location aware apps that is used to determine if your current location is approaching, entering, dwelling, or leaving a point of interest (POI). For example, you may want to alert drivers of upcoming road closures, home buyers of newly available houses nearby, or tourists of an attraction they are approaching. This can be done with ease using ArcGIS Runtime's GeometryEngine. The GeometryEngine provides several static functions that allow you to ask questions about the spatial relationship of 2 or more geometries. For example, some questions you can ask are "does geometry 1 intersect geometry 2", "does geometry 1 completely contain geometry 2", and "how many meters is it from geometry 1 to geometry 2". The great thing about the GeometryEngine is that this works completely client side without any network connectivity, which means there is no internet usage, and thus limited battery consumption. By using the GeometryEngine, you can perform Geofencing with the following workflow:

 

  • Obtain your device's current location from the location display, and project it to the map's spatial reference
connect(m_mapView->locationDisplay(), &LocationDisplay::locationChanged, this, [this](Location location)
{
  Point currentLocation = GeometryEngine::project(location.position(), SpatialReference::webMercator());
  ...
  • Obtain a POI polygon. This could be created programatically and displayed as a Graphic, or it could be stored in a FeatureTable and displayed as a FeatureLayer
  • Once you have access to the Geometry object, perform the GeometryEngine function. The following code assumes you have created a polygon Graphic named m_graphic. 
    m_within = GeometryEngine::intersects(currentLocation, m_graphic->geometry());
  • If the GeometryEngine function returns true, alert the user. 
    if (m_within)
      alertUser("within");
  • From here, you can take it further, and keep track of if the previous location was within the POI or not, which will tell you if you are entering, dwelling, or leaving the POI. You could also use the GeometryEngine::distance function to send an alert when you get near the POI.

 

A basic sample of this workflow can be found on GitHub. Give it a try, and see if you can enhance it to fit your organization's needs and use cases.

ArcGIS Runtime SDK for Qt 100 brought many new features to the SDK, such as Raster support, 3D, Vector Tiles, and much more. Beyond many of these big ticket items, there were also lots of architectural and design improvements to the API that make it much easier and more convenient to develop apps with the SDK. One of my favorite new features of the ArcGIS Runtime SDK for Qt (version 100) is the extensive use of list models throughout the API. List models are data structures similar to to lists or vectors that can be used directly in any of the various views that Qt supports (i.e. ListView, GridView, etc). What this means to you as a developer is that you can very easily take the data returned to you from the Runtime API (like features, graphics, maps, layers, attributes, symbols, attachments, and so on), and display them in a view with no data manipulation or massaging. For example, if I wanted to build a table of contents (TOC) for the operational layers in a map, I could access the Map::operationalLayers property, and this would return to me a list model of the layers in the map. I could then take that list model and pass it directly into a ListView component, and display the data in the ListView. This has many benefits including:

  • It is good practice to separate your UI from your business logic
  • The models and views are dynamic, so if a list model gets updated (e.g. a new layer gets added to the map), the View will update automatically without you writing any code to handle this.
  • For QML, it greatly reduces the amount of imperitive JavaScript code, allowing you to write almost exclusively declarative QML code. Writing as declarative of code as possible is something you should always strive for with QML.

 

Model/view, MVC, MVVM, and other similar concepts have endless resources explaining the benefits of the pattern and how to best architect your application using these patterns. Because of this, this article will not discuss that type of information, but will instead focus on the fundamentals of working with list models coming from ArcGIS Runtime, and how you can integrate them with Qt's various view types.

 

There are 3 main concepts that you will need to understand in order to display your data from a list model in a view: Models, Views, and Delegates.

 

Models
Models are lists of data and are found throughout the ArcGIS Runtime. Some examples include a LayerListModel, LegendInfoListModel, AttachmentListModel, and AttributeListModel. Models have a couple of important things to know about as an application developer. The first thing you need to know is what the model contains. In the example of a LayerListModel, you can read in the documentation that it is a list of Layers available in the map. The second important thing to note are the roles available on the model. For example, the LayerListModel has a name and layerVisible role (among many others). These roles are basically the properties that you can access for each item in the list model. With this information, you should begin to see how one could start building a table of contents.

 

Views
Views are the UI elements that actually display the data. ListViews and GridViews are some of the most common types. Your phone's music app will likely make heavy use of these types of views, as they might display a list of songs by a particular artist, or they might show a grid of a particular artist's album covers. One important thing to understand is that the View determines what will be shown, but it will not determine how something is shown. For example, in the example of the TOC control, we might know that we want to have a list of layers shown in a view, but the view does not dictate how each element in that list of layers looks (i.e. the text to display, the color of text, the type face, etc). Rather, the delegate controls this information.

 

Delegates
Delegates describe what each element in the list will look like. Going back to the TOC example, we know that we want each item show a Checkbox/Switch, so that the user can toggle visibility, and then have the layer name to the right of that. This is where the list model's roles come into play. The delegate can access any of the roles that are exposed and documented in the API reference. The view will use the defined delegate as a template for how to display the data coming out of the model.

 

A simple example

To see this all in practice, I suggest you look at the various samples on GitHub. A good, simple example of this is the "Change Sublayer Visibility" sample. This sample has a basemap and a map image layer that contains 3 sublayers: Cities, Continent, and World.

 

We can use the ArcGISSublayerListModel to build a simple TOC where you can see the sublayer name, and toggle the visibility. This section of code contains all of the code related to the TOC control that you see in the upper left of this screenshot. Going back to the previous discussion, there are 3 important things we need: a model, a view, and a delegate.

 

In this case, a ListView is declared, and some anchoring and sizing properties are set. All this is doing is saying that we are going to display a list of something.

ListView {
id: layerVisibilityListView
anchors.margins: 10 * scaleFactor
width: parent.width
height: parent.height
clip: true

Next you see a model property. This is setting the View's model property to the map service's sublayer list model. 

model: mapImageLayer.mapImageSublayers

Finally, we need a delegate to define how each item in the list will appear. In this case, we want text displaying the layer's name, and a Switch component for toggling visibility. These name and visibility properties are available as the roles "name" and "sublayerVisible" (this can be found the in the documentation for ArcGISSublayerListModel).

 

delegate: Item {
    id: layerVisibilityDelegate
    width: parent.width
    height: 35 * scaleFactor

    Row {
        spacing: 5
        anchors.verticalCenter: parent.verticalCenter
        Text {
            width: 75 * scaleFactor
            text: name // "name" is a role in the list model
            wrapMode: Text.WordWrap
            font.pixelSize: 14 * scaleFactor
        }
        Switch {
            checked: sublayerVisible // "sublayerVisible" is a role in the list model
            onCheckedChanged: {
                sublayerVisible = checked;
            }
        }
   }
}

 

All together, this results in the following code for building a basic TOC:

// Create a list view to display the items
ListView {
    id: layerVisibilityListView
    anchors.margins: 10 * scaleFactor
    width: parent.width
    height: parent.height
    clip: true

    // Assign the model to the list model of sublayers
    model: mapImageLayer.mapImageSublayers

    // Assign the delegate to the delegate created above
    delegate: Item {
        id: layerVisibilityDelegate
        width: parent.width
        height: 35 * scaleFactor

        Row {
            spacing: 5
            anchors.verticalCenter: parent.verticalCenter
            Text {
                width: 75 * scaleFactor
                text: name
                wrapMode: Text.WordWrap
                font.pixelSize: 14 * scaleFactor
            }

            Switch {
                checked: sublayerVisible

                onCheckedChanged: {
                    sublayerVisible = checked;
                }
            }
        }
    }
}

 

The above example focuses on Qt Quick, but you can utilize these model types  with Qt Widgets as well. Many of the same concepts apply, but the workflow differs slightly when working in a QWidgets based UI. To use these with widgets, you can bind the model types to a QAbstractItemView (for example a QTableView) by calling setModel. In order to customise the data you wish to display in the view, a good approach is to create your own QIdentityProxyModel to expose those parts of the underlying model data you wish to use. For example, when using a BasemapListModel you could create your own "BasemapsProxyModel” which takes a BasemapListModel as the sourceModel and returns two columns of data from the full list in the BasemapRoles enum (the basemap title and the snippet which describes it). Your proxy model should then override QIdentityProxyModel::columnCount to return a count of 2. For QIdentityProxyModel::data you should return data from the underlying model based on the column of the supplied QModelIndex. Your code could look something like this:

 

QModelIndex srcIdx = sourceModel()->index(index.row(), 0);
if (role == Qt::DisplayRole)
{
    switch (index.column())
    {
    case 0:
      return sourceModel()->data(srcIdx, Esri::ArcGISRuntime::BasemapListModel::BasemapItemTitleRole);
      break;
    case 1:
      return sourceModel()->data(srcIdx, Esri::ArcGISRuntime::BasemapListModel::BasemapItemSnippetRole);
      break;
    default:
      break;
    }
}

 

This is only a small introduction to a very large topic. Once these concepts become clear to you, I encourage you to start creating more views for the various models that are exposed in the Runtime API. Here are some additional helpful resources that should help explain model/view programming with Qt.

 

Additional Resources:

QML:
- QML Book - http://qmlbook.github.io/ch06/
- Models and Views in Qt Quick - http://doc.qt.io/qt-5/qtquick-modelviewsdata-modelview.html
- Using C++ Models with Qt Quick Views - http://doc.qt.io/qt-5/qtquick-modelviewsdata-cppmodels.html

Qt Widgets Resources:
- Model/View Programming - http://doc.qt.io/qt-5/model-view-programming.html

We hope you are finding ArcGIS Runtime SDK 100.1 for Qt (Update 1) to be useful and productive for you. As always, please continue to use GeoNet and share your feedback. We're here to help you in any way we can.

 

Now, regarding support for Qt 5.9.0:

During our certification of Update 1 we discovered a critical Qt 5.9.0 bug specific to iOS and macOS in the Qt 5.9.0 final release. All https requests report an SSL handshake error so not even Esri basemaps will draw on iOS or macOS devices. There is no viable workaround for this issue that we are aware of that will ensure the security of your applications. You can read the bug report (QTBUG-61053) here, which indicates that it was fixed in 5.9.1. Also, you will encounter compilation errors using 5.9.0 Qt Creator (4.3.0) on El Capitan v.10.11.16 when compiling any of the Esri template projects.

 

In light of these issues, we strongly advise that you avoid using the Qt 5.9.0 for development with the ArcGIS Qt SDK. Instead, use Qt 5.9.1. Keep in mind, ArcGIS Runtime SDK 100.1 also supports Qt 5.6.2 and Qt 5.8.

Please let us know if you have any questions. Thank you.

 

The ArcGIS Runtime SDK for Qt Team