objectMap Functions

These functions are used by Squish for the Text-Based Object Map. When using the Script-Based Object Map, object names are plain script variables, or native dictionaries, so there is no equivalent API for add/load. However, it is possible to add objects to the text-based object-map, and later fetch the realName or symbolicName, for debugging/demo purposes, even if script-based object maps are also in use.

For information about manipulating the Object Map using the squishide see the Object Map view. For more about Object Maps in use see Object Map.

Note: In Ruby, the name of the API object is ObjectMap, while it is objectMap in the other script languages.

objectMap.add(object)

This function adds the given object to the text-based object map. (A suitable object can be obtained using the Object waitForObject(objectOrName) function or the Object findObject(objectName) function.)

objectMap.load(filename)

This function loads a text-based object map from the given filename and uses it to replace the current object map. If the file does not exist, an exception is raised and the current object map is left unchanged.

String objectMap.realName(object)

String objectMap.realName(symbolicName)

This function returns the real (multi-property) name for the given object, or for the object with the given symbolicName.

String objectMap.symbolicName(object)

String objectMap.symbolicName(objectOrRealName)

This function tries to return the symbolic name for the specified object or real name from the object map.

If the objectOrRealName is a real name, and it does not match any existing object, it will simply be returned; no error will be thrown.

If the objectOrRealName is an invalid real name it will simply be returned; no error will be thrown.

If the objectOrRealName is a reference to an object and the text-based object map does not contain an entry for this object, then a real name for this object will be returned.

SequenceOfStrings objectMap.symbolicNames()

This function returns an array (a tuple in Python) containing all the mapped symbolic names. The returned names are in an arbitrary order.

© 2024 The Qt Company Ltd. 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.

Search Results