|
Krita Source Code Documentation
|
Classes | |
| class | Error |
| class | PyQtClass |
| class | PyQtMethod |
| class | PyQtProperty |
Functions | |
| convert_value (value) | |
| create_pyqt_class (metaobject) | |
| create_pyqt_object (obj) | |
| from_variant (variant) | |
| is_qobject (obj) | |
| is_scripter_child (qobj) | |
| unwrap (obj) | |
| wrap (obj, force=False) | |
| wrap_variant_object (variant) | |
Variables | |
| dict | pyqt_classes = {} |
| dict | qtclasses = {} |
| dict | variant_converter |
SPDX-FileCopyrightText: 2016 Boudewijn Rempt <boud@valdyas.org> SPDX-License-Identifier: LGPL-2.0-or-later
| mikro.convert_value | ( | value | ) |
Convert a given value, upcasting to the highest QObject-based class if possible, unpacking lists and dicts.
Definition at line 92 of file mikro.py.
References convert_value(), from_variant(), and wrap().
| mikro.create_pyqt_class | ( | metaobject | ) |
Definition at line 356 of file mikro.py.
| mikro.create_pyqt_object | ( | obj | ) |
Wrap a QObject and make all slots and properties dynamically available. @type obj: QObject @param obj: an unwrapped QObject @rtype: PyQtClass object @return: dynamically created object with all available properties and slots This is probably the only function you need from this module. Everything else are helper functions and classes.
Definition at line 398 of file mikro.py.
References create_pyqt_class().
| mikro.from_variant | ( | variant | ) |
convert a QVariant to a Python value
Definition at line 74 of file mikro.py.
| mikro.is_qobject | ( | obj | ) |
checks if class or wrapped class is a subclass of QObject
Definition at line 158 of file mikro.py.
References unwrap().
| mikro.is_scripter_child | ( | qobj | ) |
walk up the object tree until Scripter or the root is found
Definition at line 168 of file mikro.py.
| mikro.unwrap | ( | obj | ) |
| mikro.wrap | ( | obj, | |
| force = False ) |
If a class is not known by PyQt it will be automatically casted to a known wrapped super class. But that limits access to methods and properties of this super class. So instead this functions returns a wrapper class (PyQtClass) which queries the metaObject and provides access to all slots and all properties.
Definition at line 126 of file mikro.py.
References create_pyqt_object().
| mikro.wrap_variant_object | ( | variant | ) |
convert a QObject or a QWidget to its wrapped superclass
Definition at line 66 of file mikro.py.
References Krita.fromVariant(), and wrap().
| dict mikro.variant_converter |