Skip to content

FormAttachment Class

  • FormAttachment
  • class Esri::ArcGISRuntime::FormAttachment

    Represents an attachment belonging to a feature form. Wraps the Attachment object and adds additional properties and methods to support displaying attachments in a FeatureForm. More...

    Header: #include <FormAttachment.h>
    Since: Esri::ArcGISRuntime 200.8
    Inherits: Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::Loadable

    Public Functions

    virtual ~FormAttachment() override
    Esri::ArcGISRuntime::Attachment *attachment() const
    QString contentType() const
    QFuture<QImage> createFullImageAsync()
    QFuture<QImage> createThumbnailAsync(int width, int height)
    QString filePath() const
    bool isLocal() const
    QString name() const
    void setName(const QString &name)
    qint64 size() const
    Esri::ArcGISRuntime::FormAttachmentType type() 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

    Signals

    void doneLoading(const Esri::ArcGISRuntime::Error &loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Detailed Description

    Member Function Documentation

    [override virtual noexcept] FormAttachment::~FormAttachment()

    Destructor.

    Esri::ArcGISRuntime::Attachment *FormAttachment::attachment() const

    Returns the underlying Attachment.

    [override virtual] void FormAttachment::cancelLoad()

    Reimplements: Loadable::cancelLoad().

    Cancels loading metadata for the object.

    Cancels loading the metadata if the object is loading and always calls doneLoading.

    QString FormAttachment::contentType() const

    Returns the MIME content type of the FormAttachment.

    QFuture<QImage> FormAttachment::createFullImageAsync()

    Creates the full image for displaying the attachment in full screen or larger than a thumbnail.

    This is only applicable if the attachment type is FormAttachmentType::Image.

    This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

    See Working with QFuture for further details.

    QFuture<QImage> FormAttachment::createThumbnailAsync(int width, int height)

    Creates a thumbnail image with the specified width and height.

    • width - Width of the thumbnail.
    • height - Height of the thumbnail.

    This is only applicable if the attachment type is FormAttachmentType::Image.

    This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

    See Working with QFuture for further details.

    [signal] void FormAttachment::doneLoading(const 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.

    QString FormAttachment::filePath() const

    Returns the local temporary file path that stores the attachment once it is loaded.

    bool FormAttachment::isLocal() const

    Returns whether "loading" (fetching the data) can be accomplished without using the network.

    This is true if data needs to be pulled from a database and false if loading causes a network request.

    [override virtual] void FormAttachment::load()

    Reimplements: Loadable::load().

    Loads the metadata for the object asynchronously.

    Loads the metadata if the object is not loaded and always calls doneLoading.

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

    Reimplements: Loadable::loadError() const.

    Returns the load error.

    See also Error.

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

    Reimplements: Loadable::loadStatus() const.

    Returns the load status.

    See also LoadStatus.

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

    Signal emitted when the load status changes for this object.

    See also Loadable.

    QString FormAttachment::name() const

    Returns the name of the FormAttachment.

    See also setName().

    [override virtual] void FormAttachment::retryLoad()

    Reimplements: Loadable::retryLoad().

    Loads or retries loading metadata for the object asynchronously.

    Will retry loading the metadata if the object is failed to load. Will load the object if it is not loaded. Will not retry to load the object if the object is loaded. Will always call the done loading if this is called.

    void FormAttachment::setName(const QString &name)

    Sets the name to name.

    See also name.

    qint64 FormAttachment::size() const

    Returns the size of the FormAttachment in bytes.

    Esri::ArcGISRuntime::FormAttachmentType FormAttachment::type() const

    Returns the type of the FormAttachment.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.