ClassInfo¶
This class is used to associate extra information to the class, which is available using QObject.metaObject(). Qt and PySide doesn’t use this information.
The extra information takes the form of a dictionary with key and value in a literal string.
The recommended usage is to provide the key/value using python keyword syntax, where the keyword becomes the key, and the provided string becomes the value.
If the key needs to contain special characters (spaces, commas, ‘::’, start with a number, etc), it is also possible to pass a python dictionary with arbitrary strings for both the key and value and enabling special characters in the key.
Note
This Class is a implementation of Q_CLASSINFO macro.
Example¶
# Recommended syntax
@ClassInfo(Author='PySide Team', URL='http://www.pyside.org')
class MyObject(QObject):
...
# Provided to support keys not supported by Python's keyword syntax
@ClassInfo({'Some key text $': 'This syntax supports special characters in keys'})
class MyObject(QObject):
...
© 2022 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.