Skip To Content ArcGIS for Developers Sign In Dashboard

SymbolStyle Class

(Esri::ArcGISRuntime::SymbolStyle)

A mechanism to obtain symbols from a style (*.stylx) file. More...

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

Esri::ArcGISRuntime::DictionarySymbolStyle

Public Functions

SymbolStyle(const QString &styleLocation, QObject *parent = nullptr)
~SymbolStyle()
TaskWatcher defaultSearchParameters()
TaskWatcher fetchSymbol(const QStringList &keys)
TaskWatcher searchSymbols(const SymbolStyleSearchParameters &searchParameters)
QString styleLocation() const
SymbolStyleType symbolStyleType() const

Reimplemented Public Functions

virtual void cancelLoad()
virtual void load()
virtual Error loadError() const
virtual LoadStatus loadStatus() const
virtual void retryLoad()

Signals

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)

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

A mechanism to obtain symbols from a style (*.stylx) file.

A style file is a gallery of symbols that are created and maintained with ArcGIS Pro. Style files are typically used to maintain a common set of symbols for use across your organization. Style files contain many layers of symbols, which can be grouped together to create new multi-layer symbols. A SymbolStyle is the class that ArcGIS Runtime uses to access a style file.

To use a SymbolStyle, construct a SymbolStyle by giving the full path to a style file, and search for symbols with searchSymbols. This will search the style file for symbols that match your input parameters. The results can then be used to create new graphics, renderers, symbol swatch images, or composite symbols.

Note: Style files used with SymbolStyle must be ArcGIS Runtime-enabled style files. The style files used in ArcGIS Pro and ArcMap cannot be directly consumed in ArcGIS Runtime. At the time of release of ArcGIS Runtime SDK 100.0, ArcGIS Runtime-enabled style files cannot be created by any released version of ArcGIS Pro. Once a version of Pro is released that can export these style files, this class can be used to consume them.

See also SymbolStyleSearchParameters, SymbolStyleSearchResult, and SymbolStyleSearchResultListModel.

Member Function Documentation

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.

SymbolStyle::~SymbolStyle()

Destructor.

[virtual] void SymbolStyle::cancelLoad()

Reimplemented from Loadable::cancelLoad().

See Loadable.

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.

[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.

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.

[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.

[virtual] void SymbolStyle::load()

Reimplemented from Loadable::load().

See Loadable.

[virtual] Error SymbolStyle::loadError() const

Reimplemented from Loadable::loadError().

See Loadable.

[virtual] LoadStatus SymbolStyle::loadStatus() const

Reimplemented from Loadable::loadStatus().

See Loadable.

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

Signal emitted when the load status changes for this object.

See also Loadable.

[virtual] void SymbolStyle::retryLoad()

Reimplemented from Loadable::retryLoad().

See Loadable.

TaskWatcher SymbolStyle::searchSymbols(const 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.

[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.

QString SymbolStyle::styleLocation() const

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

SymbolStyleType SymbolStyle::symbolStyleType() const

Gets the type of Symbol Style this object is.


Feedback on this topic?