ArcGIS Runtime SDK version 100.15 is a long-term support release focused exclusively on bug fixes and minor updates. ArcGIS Maps SDKs for Native Apps version 200.x builds on the proven architecture of 100.15, and is designed to leverage the latest developer framework innovations. This topic outlines areas of the API that have undergone changes and provides guidance for re-factoring 100.x code for a 200.x app.
Support for Qt 6
ArcGIS Maps SDK for Qt version 200.0 is the first release to support Qt 6. This major release of ArcGIS Maps SDK for Qt modernizes the SDK and paves the path toward supporting newer compilers, language features, rendering engines, and more.
This move from Qt 5 to Qt 6 support has breaking changes that must be addressed to compile your app. The Qt Group has created a porting guide to aid in porting your apps. The first two steps in that guide are critically important:
- Upgrade your app to the latest version of Qt 5.15.
- Remove and replace deprecated APIs in your apps.
Where possible, Qt has tried to deprecate APIs that are removed at Qt 6, which gives developers an opportunity to remove their usage from apps before moving to Qt 6. To make this migration as seamless as possible, Esri has followed The Qt Group’s plan and has deprecated several classes, properties, and methods present in version 100.15 and prior versions. These deprecations have been removed from version 200.0.
In lockstep with The Qt Group, Esri recommends that you first upgrade your apps to the latest version of Qt 5.15 and ArcGIS Runtime SDK version 100.15. After upgrading, remove deprecated API usage in your apps and adopt the newer patterns. This will greatly decrease the number of compilation errors you will see when upgrading to Qt 6 and ArcGIS Maps SDK 200.x. For details on removing deprecated APIs from your apps, see the following blog:
Installation and setup
Qt 6 installers now have more fine-grained control than earlier installers over which Qt modules are installed. When installing Qt 6 on your system, ensure that you have the following “Additional Libraries” selected, because they are required dependencies of ArcGIS Maps SDK for Qt:
- Qt Multimedia
- Qt Positioning
- Qt Sensors
- Qt WebEngine
- Qt WebView
- Qt Connectivity (iOS and Android only)
- Qt WebSockets
See System Requirements for specific versions of software needed for each supported platform.
API Breaking Changes
In addition to removing deprecated APIs from your apps, version 200.0 has a targeted set of changes that may result in additional breaking changes in your applications. These changes were necessary due to underlying Qt changes or due to API patterns that were inconsistent, incorrect, error prone, or going against best practices. In general, these changes could not be deprecated in an earlier release due to their nature.
- C++ API headers are now standardized to use forward declarations throughout the API, to improve build times and follow C++ best practices. This change will require developers to update apps to include the types they are using in their apps. In prior releases, API headers over-included other headers, resulting in client apps needing fewer includes, but at the cost of a build times. With this change, our testing showed build time reductions ranging from 16 to 33 percent for projects of different breadth and depth. Times may vary depending on a variety of factors, such as how extensive your usage of ArcGIS Maps SDK is (how many headers you have included). See this Toolkit pull request for the types of changes needed.
- All enums are now registered using
Q
, which makes enum usage easier throughout Qt. If you previously added these declarations in your app code, the duplicate registration needs to be removed._DECLARE _METATYPE - Base-class copy constructors are now marked as explicit. This primarily affects geometry types. See this Sample pull request for example migration. Previously, the following code was allowed:
Point p = Geometry
. The downside is that this allowed invalid workflows, such as creating an::from Json("{\"x\" :0,\"y\" :0}"); Envelope
fromPoint JSON
. For example:Envelope e = Geometry
.::from Json("{\"x\" :0,\"y\" :0}"); Travel
is no longer aMode Q
. It is a value object and was previously inadvertently marked as aObject Q
.Object - Single argument value object constructors are now marked as explicit. For example,
Spatial
is now explicit, which means passing an int into a function that requires aReference(int wkid) Spatial
object will no longer implicitly convert.Reference - Signal arguments have been standardized to be
const-ref
throughout. Bookmark
is removed. UseList Model ::bookmark Removed Bookmark
instead.List Model ::item Removed Class
is removed. UseBreak List Model ::class Break Removed Class
instead.Break List Model ::item Removed Preplanned
is removed. Access items inMap Area ::content Items Completed Preplanned
instead.Map Area ::package Items Job
is removed. Use::cancel Job
instead.::cancel Async - The following classes are no longer inadvertently declared as metatypes:
Feature
,Edit Result Feature
,Table Edit Result Generate
,Offline Map Parameter Overrides Geo
,Element Graphic
,Identify
,Graphics Overlay Result Identify
,Layer Result Related
. These can be registered in client code instead usingFeature Query Result q
.Register Meta Type
ArcGIS Extras API
System.is
is removed andOnline System.reachability
is added.is
supplied a simple boolean, whileOnline reachability
supplies more fine-grained information about a device's connection status. This is following Qt's change with QNetworkInformation reachability.Q
no longer supportsExif Image Header JI
due to a change in Qt.S X208-1990 codec
Qt 6 changes that affect common ArcGIS Maps SDK use cases
-
QML import versions are now completely optional. For simplicity, we recommend removing version numbers from your QML import statements. For example, change
import Esri.
toArcGIS Runtime 100.15 import Esri.
.ArcGIS Runtime -
Some Qt Modules have not been ported to Qt 6 yet, such as Graphical Effects. The core5compat library can be used to aid in migration for some missing modules (see Porting from Qt 5 to Qt 6 using Qt5Compat library). Other missing modules, such as QTextToSpeech, are planned for upcoming Qt releases.
-
Q
APIs, which are used in GeoViewMouse Event on
signals, have changed. For example, useMouse Clicked mouse.pos().x()
instead ofmouse.x()
. -
Use
Q
to tell the Meta Object Compiler (MOC) to add an include when you’ve forward declared types used in properties, signals, and slots. For example, you must add_MOC _INCLUDE Q
to your header if exposing_MOC _INCLUD E(“ Map Quick View.h”) Map
as a Q_PROPERTY.Quick View -
QML signals must name parameters used in the handler. For example,
on
will becomeMouse Clicked : { … } on
. For more details, see the Qt documentation Signal parameters.Mouse Clicked : (mouse)= >{ … } -
The Toolkit pull request and the Sample pull request presented for porting from Qt 5 to Qt 6 can be used as a reference for the most common changes required for migrating your ArcGIS Maps SDK for Qt app from Qt 5 to Qt 6.