ResourceMap Class

Maps compiled-in Qt resources to workspace documents and vice versa. More...

Header: #include <ResourceMap>
Inherits: QObject

Public Functions

ResourceMap(QObject *parent = nullptr)
QString errorString() const
LiveDocument toDocument(const QString &resource) const
QString toResource(const LiveDocument &document) const
bool updateMapping(const LiveDocument &qrcDocument, QIODevice *qrcFile)

Detailed Description

A ResourceMap is managed and owned by a LiveNodeEngine. LiveDocument uses ResourceMap to enable convenient handling of documents that may reside either under workspace on file system or in Qt resources at run time.

See also LiveNodeEngine::resourceMap() and LiveDocument.

Member Function Documentation

ResourceMap::ResourceMap(QObject *parent = nullptr)

Constructs with the given parent object.

QString ResourceMap::errorString() const

Returns an user readable description of the last error occurred.

The error string may be set by the updateMapping() call.

LiveDocument ResourceMap::toDocument(const QString &resource) const

Returns the document that maps to the given resource or a null LiveDocument if no corresponding mapping exists.

This is a low level API. LiveDocument provides more convenient API.

QString ResourceMap::toResource(const LiveDocument &document) const

Returns the resource that maps to the given document or an empty QString if no corresponding mapping exists.

This is a low level API. LiveDocument provides more convenient API.

bool ResourceMap::updateMapping(const LiveDocument &qrcDocument, QIODevice *qrcFile)

Updates mapping from the given .qrc document

Old mappings for the given qrcDocument will be removed, then new mappings will be added based on the content of the qrcFile.

Returns true on success. Otherwise errorString() is set and false returned.

© 2019 Luxoft Sweden AB. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.