ArcGIS Developers

SymbolStyle Class

class Esri::ArcGISRuntime::SymbolStyle

A symbol style object. More...

Header: #include <SymbolStyle>
Since: Esri::ArcGISRuntime 100.0
Inherits: Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::Loadable
Inherited By:


This class was introduced in Esri::ArcGISRuntime 100.0.

Public Functions

SymbolStyle(const QString &styleName, Esri::ArcGISRuntime::Portal *portal, QObject *parent = nullptr)
SymbolStyle(Esri::ArcGISRuntime::PortalItem *portalItem, QObject *parent = nullptr)
SymbolStyle(const QString &styleLocation, QObject *parent = nullptr)
virtual ~SymbolStyle() override
Esri::ArcGISRuntime::TaskWatcher defaultSearchParameters()
Esri::ArcGISRuntime::TaskWatcher fetchSymbol(const QStringList &keys)
Esri::ArcGISRuntime::Portal *portal() const
Esri::ArcGISRuntime::PortalItem *portalItem() const
Esri::ArcGISRuntime::TaskWatcher searchSymbols(const Esri::ArcGISRuntime::SymbolStyleSearchParameters &searchParameters)
QString styleLocation() const
QString styleName() const
Esri::ArcGISRuntime::SymbolStyleType symbolStyleType() const
QUrl url() const

Reimplemented Public Functions

virtual void cancelLoad() override
virtual void load() override
virtual Esri::ArcGISRuntime::Error loadError() const override
virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
virtual void retryLoad() override


void defaultSearchParametersCompleted(QUuid taskId, const Esri::ArcGISRuntime::SymbolStyleSearchParameters &searchParameters)
void doneLoading(Esri::ArcGISRuntime::Error loadError)
void fetchSymbolCompleted(QUuid taskId, Esri::ArcGISRuntime::Symbol *symbol)
void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)
void searchSymbolsCompleted(QUuid taskId, Esri::ArcGISRuntime::SymbolStyleSearchResultListModel *searchResults)

Static Public Members

Esri::ArcGISRuntime::SymbolStyle *createSymbolStyleFromUrl(const QUrl &webStyleUrl, QObject *parent = nullptr)

Detailed Description

A SymbolStyle is created from a style file located on disk (an SQLite database with a .stylx extension, created with ArcGIS Pro), a dictionary style file hosted on ArcGIS Online, or a web style accessed from an ArcGIS Enterprise portal.

When used by itself, the symbol style supports two key workflows. One is to return a symbol based on a provided set of key values. Because each symbol in the style has a key that uniquely identifies it, you can pass an array of keys into fetchSymbol() to return a new Symbol built from the individual symbols represented by those keys. You might use this symbol to create a new Graphic.

The other common workflow is to use a standalone symbol style to search for symbol primitives. Symbol primitives are the individual symbols that compose more complex symbols. This is achieved using searchSymbols(). You could create a symbol picker app, for example, that searches for all symbols in the style that have the tag "maritime". The search results contain symbols that you could use directly. You could also extract their individual symbol components to create a new multilayer symbol.

See also DictionarySymbolStyle.

Member Function Documentation

SymbolStyle::SymbolStyle(const QString &styleName, Esri::ArcGISRuntime::Portal *portal, QObject *parent = nullptr)

Creates a new symbol style object using the unique registered name for the web style on the portal.

  • styleName - The registered symbol style name on the portal.
  • portal - The portal that contains the web style. If nullptr is passed, ArcGIS online is used as the default portal.
  • parent - The optional parent QObject.

Use this constructor to create a symbol style using the web style's unique name on the portal. If nullptr is passed, ArcGIS online is used as the default portal. Esri provides a set of webstyles "out of the box" for localized use with ArcGIS Online and Enterprise. An overview of styles and symbols currently in production is available for 3D and 2D. Tip: Click on the symbol icon to find its associated style name. A registered style name can also be found as a json item of the symbols style using "http://<server>/portal/sharing/rest/content/items/<style_itemid>?f=pjson" URL and replacing server and style_itemid with your info. See item json for EsriThematicShapesStyle hosted on ArcGIS Online.

This function was introduced in Esri::ArcGISRuntime 100.10.

SymbolStyle::SymbolStyle(Esri::ArcGISRuntime::PortalItem *portalItem, QObject *parent = nullptr)

Creates a new symbol style object from a portal item. The portal item must contain a style.

  • portalItem - A PortalItem that contains a web style.
  • parent - The optional parent QObject.

If you have the item id of a style file, you can search the portal to find the item using its item id. Use this constructor if you have a reference to a portal item.

This function was introduced in Esri::ArcGISRuntime 100.10.

SymbolStyle::SymbolStyle(const QString &styleLocation, QObject *parent = nullptr)

Constructor that takes a styleLocation, with an optional parent.

The styleLocation is the full path to an ArcGIS Runtime-enabled style file, created with ArcGIS Pro.

[signal] void SymbolStyle::defaultSearchParametersCompleted(QUuid taskId, const Esri::ArcGISRuntime::SymbolStyleSearchParameters &searchParameters)

Signal emitted when the defaultSearchParameters asynchronous task has completed.

See also SymbolStyleSearchParameters.

[signal] void SymbolStyle::doneLoading(Esri::ArcGISRuntime::Error loadError)

Signal emitted when this object is done loading.

  • loadError - Details about any error that may have occurred.

Note: If there is a load error it will also be emitted on the errorOccurred signal.

See also Loadable and Object.

[signal] void SymbolStyle::fetchSymbolCompleted(QUuid taskId, Esri::ArcGISRuntime::Symbol *symbol)

Signal emitted when the fetchSymbol asynchronous task has completed.

  • taskId - The task ID of the asynchronous task.
  • symbol - The Symbol requested.

The returned Symbol object has the SymbolStyle as its parent.

See also Returned QObjects Parenting and SymbolStyleSearchParameters.

[signal] void SymbolStyle::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

Signal emitted when the load status changes for this object.

See also Loadable.

[signal] void SymbolStyle::searchSymbolsCompleted(QUuid taskId, Esri::ArcGISRuntime::SymbolStyleSearchResultListModel *searchResults)

Signal emitted when the searchSymbols asynchronous task has completed.

The returned SymbolStyleSearchResultListModel object has the SymbolStyle as its parent.

See also Returned QObjects Parenting.

[override virtual] SymbolStyle::~SymbolStyle()


[override virtual] void SymbolStyle::cancelLoad()

Reimplements: Loadable::cancelLoad().

See Loadable.

[static] Esri::ArcGISRuntime::SymbolStyle *SymbolStyle::createSymbolStyleFromUrl(const QUrl &webStyleUrl, QObject *parent = nullptr)

Returns a new symbol style object using web style item URL.

  • webStyleUrl
  • parent - The optional parent QObject.

A symbol style using style item's URL. For example, is the URL of the "Basic Shapes" style on ArcGIS Online.".

This function was introduced in Esri::ArcGISRuntime 100.10.

Esri::ArcGISRuntime::TaskWatcher SymbolStyle::defaultSearchParameters()

Retrieves all of the valid SymbolStyleSearchParameters for the SymbolStyle.

This asynchronous task retrieves all the valid input search parameters in the style file. This means you get all of the possible input values for categories, keys, names, symbolClasses, and tags. This is an expensive task that should be used sparingly. The defaultSearchParametersCompleted signal emits once complete, giving access to pre-populated SymbolStyleSearchParameters.

Esri::ArcGISRuntime::TaskWatcher SymbolStyle::fetchSymbol(const QStringList &keys)

Gets a Symbol, as defined by the input keys.

This function is useful for obtaining a single, multi-layer symbol from the supplied keys. This is commonly used to create symbols and graphics on-the-fly. A common workflow for this would be to first call searchSymbols, which searches for symbols in the style file. This returns a list model of SymbolStyleSearchResults, all of which contain a key. Create a string list of all the keys you want in your resulting symbol, and call fetchSymbol with this string list. This will return a new symbol from all of the individual symbol keys provided.

The fetchSymbolCompleted signal emits once complete, giving access to the resulting symbol.

If the SymbolStyle is not loaded then starting this task will start the load cycle.

Note: The order of the keys in the string list determines how the output symbol will look. The first key in the string list will be at the bottom of the output symbol.

See also fetchSymbolCompleted.

[override virtual] void SymbolStyle::load()

Reimplements: Loadable::load().

See Loadable.

[override virtual] Esri::ArcGISRuntime::Error SymbolStyle::loadError() const

Reimplements: Loadable::loadError() const.

See Loadable.

[override virtual] Esri::ArcGISRuntime::LoadStatus SymbolStyle::loadStatus() const

Reimplements: Loadable::loadStatus() const.

See Loadable.

Esri::ArcGISRuntime::Portal *SymbolStyle::portal() const

Returns the portal that hosts the web style identified with styleName. This will be nullptr if the style was identified with a PortalItem, URL, or a local .stylx file on disk.

This function was introduced in Esri::ArcGISRuntime 100.10.

Esri::ArcGISRuntime::PortalItem *SymbolStyle::portalItem() const

Returns the portal item that contains the web style. This will be nullptr if the style was identified with a URL, a style name, or a local .stylx file on disk.

This function was introduced in Esri::ArcGISRuntime 100.10.

[override virtual] void SymbolStyle::retryLoad()

Reimplements: Loadable::retryLoad().

See Loadable.

Esri::ArcGISRuntime::TaskWatcher SymbolStyle::searchSymbols(const Esri::ArcGISRuntime::SymbolStyleSearchParameters &searchParameters)

Searches for symbols using searchParameters.

This asynchronous task searches for symbols in a style file. The input searchParameters define what is searched for. For example, you could search for all symbols that have the tag "airspace" or "forestry". You can also set the match to be strict or not, which will determine if the search uses "=" or "LIKE" for each parameter. The searchSymbolsCompleted signal emits once complete, giving access to a SymbolStyleSearchResultListModel.

Note: To get all available style symbol search results, pass in a default constructed SymbolStyleSearchParameters.

QString SymbolStyle::styleLocation() const

Returns the path of the style (*.stylx) file.

QString SymbolStyle::styleName() const

Returns the name of the web style. This will be empty if the style was identified with a URL, or a PortalItem, or a local .stylx file on disk.

This function was introduced in Esri::ArcGISRuntime 100.10.

Esri::ArcGISRuntime::SymbolStyleType SymbolStyle::symbolStyleType() const

Gets the type of Symbol Style this object is.

QUrl SymbolStyle::url() const

Returns the URL of the web style. This will be empty if the style was identified with a PortalItem, style name, or a local .stylx file on disk.

This function was introduced in Esri::ArcGISRuntime 100.10.

Feedback on this topic?