### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- core »

# utils

Utility functions

class `camelot.core.utils.``CollectionGetterFromObjectGetter`(object_getter)

  Convert an object getter to a collection getter. The resulting class is callable and will make sure object_getter is only called once, even if collection getter is called multiple times.

`camelot.core.utils.``dgettext`(domain, message)

  Like ugettext but look the message up in the specified domain. This uses the Translation table.

`camelot.core.utils.``is_deleted`(qobj)

  Parameters: | qobj – a `QtCore.QObject`
  Returns: | `True` if the qobj was deleted, `False` otherwise

`camelot.core.utils.``is_deleted_pyqt`(qobj)

  Parameters: | qobj – a `QtCore.QObject`
  Returns: | `True` if the qobj was deleted, `False` otherwise

`camelot.core.utils.``is_deleted_pyside`(qobj)

  Parameters: | qobj – a `QtCore.QObject`
  Returns: | `True` if the qobj was deleted, `False` otherwise

`camelot.core.utils.``load_translations`()

  Fill the global dictionary of translations with all data from the database, to be able to do fast gui thread lookups of translations

`camelot.core.utils.``set_translation`(source, value)

  Store a tranlation in the global translation dictionary

`camelot.core.utils.``ugettext`(string_to_translate)

  Translate the string_to_translate to the language of the current locale. This is a two step process. First the function will try to get the translation out of the Translation entity, if this is not successfull, the function will ask QCoreApplication to translate string_to_translate (which tries to get the translation from the .qm files)

class `camelot.core.utils.``ugettext_lazy`(string_to_translate)

  Like :function:`ugettext`, but delays the translation until the string is shown to the user. This makes it possible for the user to translate the string.

`camelot.core.utils.``variant_to_pyobject`(qvariant=None)

  Try to convert a QVariant to a python object as good as possible

### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- core »

Comments
blog comments powered by Disqus