Package Camelot :: Package camelot :: Package view :: Package controls :: Package delegates
[frames] | no frames]

Package delegates

source code

Camelot includes a number of Qt delegates, most of them are used as default
delegates for the various sqlalchemy and camelot field types.

Some delegates take specific arguments into account for their construction.
All :attr:`field_attributes` specified for a certain field will be propagated
towards the constructor of the delegate.  Some of them will be used by the delegate
itself, others will be used by the editor, created by the delegate.

BoolDelegate
------------
Custom delegate for boolean values

.. _delegate-BoolDelegate:

.. image:: ../_static/delegates/BoolDelegate_unselected_disabled.png
.. image:: ../_static/delegates/BoolDelegate_unselected_editable.png

.. image:: ../_static/delegates/BoolDelegate_selected_disabled.png
.. image:: ../_static/delegates/BoolDelegate_selected_editable.png


By default, creates a BoolEditor as its editor.

.. image:: ../_static/editors/BoolEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`minimum <field-attribute-minimum>`
 * :ref:`maximum <field-attribute-maximum>`
 * :ref:`editable <field-attribute-editable>`
CodeDelegate
------------


.. _delegate-CodeDelegate:

.. image:: ../_static/delegates/CodeDelegate_unselected_disabled.png
.. image:: ../_static/delegates/CodeDelegate_unselected_editable.png

.. image:: ../_static/delegates/CodeDelegate_selected_disabled.png
.. image:: ../_static/delegates/CodeDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`parts <field-attribute-parts>`
 * :ref:`separator <field-attribute-separator>`
By default, creates a CodeEditor as its editor.

.. image:: ../_static/editors/CodeEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`parts <field-attribute-parts>`
 * :ref:`editable <field-attribute-editable>`
ColorDelegate
-------------


.. _delegate-ColorDelegate:

.. image:: ../_static/delegates/ColorDelegate_unselected_disabled.png
.. image:: ../_static/delegates/ColorDelegate_unselected_editable.png

.. image:: ../_static/delegates/ColorDelegate_selected_disabled.png
.. image:: ../_static/delegates/ColorDelegate_selected_editable.png


By default, creates a ColorEditor as its editor.

.. image:: ../_static/editors/ColorEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`editable <field-attribute-editable>`
ColoredFloatDelegate
--------------------
Custom delegate for float values, representing them in green when they are
  positive and in red when they are negative.
  

.. _delegate-ColoredFloatDelegate:

.. image:: ../_static/delegates/ColoredFloatDelegate_unselected_disabled.png
.. image:: ../_static/delegates/ColoredFloatDelegate_unselected_editable.png

.. image:: ../_static/delegates/ColoredFloatDelegate_selected_disabled.png
.. image:: ../_static/delegates/ColoredFloatDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`minimum <field-attribute-minimum>`
 * :ref:`maximum <field-attribute-maximum>`
 * :ref:`precision <field-attribute-precision>`
 * :ref:`editable <field-attribute-editable>`
 * :ref:`reverse <field-attribute-reverse>`
 * :ref:`neutral <field-attribute-neutral>`
 * :ref:`unicode_format <field-attribute-unicode_format>`
By default, creates a ColoredFloatEditor as its editor.

.. image:: ../_static/editors/ColoredFloatEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`precision <field-attribute-precision>`
 * :ref:`minimum <field-attribute-minimum>`
 * :ref:`maximum <field-attribute-maximum>`
 * :ref:`prefix <field-attribute-prefix>`
 * :ref:`suffix <field-attribute-suffix>`
 * :ref:`editable <field-attribute-editable>`
 * :ref:`reverse <field-attribute-reverse>`
 * :ref:`neutral <field-attribute-neutral>`
ComboBoxDelegate
----------------


.. _delegate-ComboBoxDelegate:

.. image:: ../_static/delegates/ComboBoxDelegate_unselected_disabled.png
.. image:: ../_static/delegates/ComboBoxDelegate_unselected_editable.png

.. image:: ../_static/delegates/ComboBoxDelegate_selected_disabled.png
.. image:: ../_static/delegates/ComboBoxDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`choices <field-attribute-choices>`
 * :ref:`editable <field-attribute-editable>`
By default, creates a ChoicesEditor as its editor.

.. image:: ../_static/editors/ChoicesEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`editable <field-attribute-editable>`
CurrencyDelegate
----------------
Custom delegate for float values

.. _delegate-CurrencyDelegate:

.. image:: ../_static/delegates/CurrencyDelegate_unselected_disabled.png
.. image:: ../_static/delegates/CurrencyDelegate_unselected_editable.png

.. image:: ../_static/delegates/CurrencyDelegate_selected_disabled.png
.. image:: ../_static/delegates/CurrencyDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`minimum <field-attribute-minimum>`
 * :ref:`maximum <field-attribute-maximum>`
 * :ref:`precision <field-attribute-precision>`
 * :ref:`editable <field-attribute-editable>`
 * :ref:`prefix <field-attribute-prefix>`
 * :ref:`suffix <field-attribute-suffix>`
By default, creates a FloatEditor as its editor.

.. image:: ../_static/editors/FloatEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`precision <field-attribute-precision>`
 * :ref:`minimum <field-attribute-minimum>`
 * :ref:`maximum <field-attribute-maximum>`
 * :ref:`editable <field-attribute-editable>`
 * :ref:`prefix <field-attribute-prefix>`
 * :ref:`suffix <field-attribute-suffix>`
 * :ref:`calculator <field-attribute-calculator>`
DateDelegate
------------
Custom delegate for date values

.. _delegate-DateDelegate:

.. image:: ../_static/delegates/DateDelegate_unselected_disabled.png
.. image:: ../_static/delegates/DateDelegate_unselected_editable.png

.. image:: ../_static/delegates/DateDelegate_selected_disabled.png
.. image:: ../_static/delegates/DateDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`editable <field-attribute-editable>`
By default, creates a DateEditor as its editor.

.. image:: ../_static/editors/DateEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`editable <field-attribute-editable>`
 * :ref:`nullable <field-attribute-nullable>`
 * :ref:`format <field-attribute-format>`
DateTimeDelegate
----------------


.. _delegate-DateTimeDelegate:

.. image:: ../_static/delegates/DateTimeDelegate_unselected_disabled.png
.. image:: ../_static/delegates/DateTimeDelegate_unselected_editable.png

.. image:: ../_static/delegates/DateTimeDelegate_selected_disabled.png
.. image:: ../_static/delegates/DateTimeDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`editable <field-attribute-editable>`
By default, creates a DateTimeEditor as its editor.

.. image:: ../_static/editors/DateTimeEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`editable <field-attribute-editable>`
 * :ref:`format <field-attribute-format>`
 * :ref:`nullable <field-attribute-nullable>`
EnumerationDelegate
-------------------
Contrary to the comboboxdelegate, the enumeration delegate does not support dynamic
    choices

.. _delegate-EnumerationDelegate:

.. image:: ../_static/delegates/EnumerationDelegate_unselected_disabled.png
.. image:: ../_static/delegates/EnumerationDelegate_unselected_editable.png

.. image:: ../_static/delegates/EnumerationDelegate_selected_disabled.png
.. image:: ../_static/delegates/EnumerationDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`choices <field-attribute-choices>`
 * :ref:`editable <field-attribute-editable>`
By default, creates a ChoicesEditor as its editor.

.. image:: ../_static/editors/ChoicesEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`editable <field-attribute-editable>`
FileDelegate
------------
Delegate for camelot.types.file fields.  Expects values of type camelot.core.files.storage.StoredFile.
  

.. _delegate-FileDelegate:

.. image:: ../_static/delegates/FileDelegate_unselected_disabled.png
.. image:: ../_static/delegates/FileDelegate_unselected_editable.png

.. image:: ../_static/delegates/FileDelegate_selected_disabled.png
.. image:: ../_static/delegates/FileDelegate_selected_editable.png


By default, creates a FileEditor as its editor.

.. image:: ../_static/editors/FileEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`storage <field-attribute-storage>`
 * :ref:`editable <field-attribute-editable>`
FloatDelegate
-------------
Custom delegate for float values

.. _delegate-FloatDelegate:

.. image:: ../_static/delegates/FloatDelegate_unselected_disabled.png
.. image:: ../_static/delegates/FloatDelegate_unselected_editable.png

.. image:: ../_static/delegates/FloatDelegate_selected_disabled.png
.. image:: ../_static/delegates/FloatDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`minimum <field-attribute-minimum>`
 * :ref:`maximum <field-attribute-maximum>`
 * :ref:`precision <field-attribute-precision>`
 * :ref:`editable <field-attribute-editable>`
 * :ref:`unicode_format <field-attribute-unicode_format>`
 * :ref:`prefix <field-attribute-prefix>`
 * :ref:`suffix <field-attribute-suffix>`
By default, creates a FloatEditor as its editor.

.. image:: ../_static/editors/FloatEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`precision <field-attribute-precision>`
 * :ref:`minimum <field-attribute-minimum>`
 * :ref:`maximum <field-attribute-maximum>`
 * :ref:`editable <field-attribute-editable>`
 * :ref:`prefix <field-attribute-prefix>`
 * :ref:`suffix <field-attribute-suffix>`
 * :ref:`calculator <field-attribute-calculator>`
ImageDelegate
-------------

    .. image:: ../_static/image.png
    
IntegerDelegate
---------------
Custom delegate for integer values

.. _delegate-IntegerDelegate:

.. image:: ../_static/delegates/IntegerDelegate_unselected_disabled.png
.. image:: ../_static/delegates/IntegerDelegate_unselected_editable.png

.. image:: ../_static/delegates/IntegerDelegate_selected_disabled.png
.. image:: ../_static/delegates/IntegerDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`minimum <field-attribute-minimum>`
 * :ref:`maximum <field-attribute-maximum>`
 * :ref:`editable <field-attribute-editable>`
 * :ref:`unicode_format <field-attribute-unicode_format>`
By default, creates a IntegerEditor as its editor.

.. image:: ../_static/editors/IntegerEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`minimum <field-attribute-minimum>`
 * :ref:`maximum <field-attribute-maximum>`
 * :ref:`editable <field-attribute-editable>`
 * :ref:`prefix <field-attribute-prefix>`
 * :ref:`suffix <field-attribute-suffix>`
 * :ref:`calculator <field-attribute-calculator>`
LabelDelegate
-------------


.. _delegate-LabelDelegate:

.. image:: ../_static/delegates/LabelDelegate_unselected_disabled.png
.. image:: ../_static/delegates/LabelDelegate_unselected_editable.png

.. image:: ../_static/delegates/LabelDelegate_selected_disabled.png
.. image:: ../_static/delegates/LabelDelegate_selected_editable.png


By default, creates a LabelEditor as its editor.

.. image:: ../_static/editors/LabelEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`text <field-attribute-text>`
Many2OneDelegate
----------------
Custom delegate for many 2 one relations
    
  .. image:: ../_static/manytoone.png
  
ManyToOneChoicesDelegate
------------------------
Display a ManyToOne field as a ComboBox, filling the list of choices with
  the objects of the target class. 
  
  .. image:: ../_static/enumeration.png   
  
NoteDelegate
------------


.. _delegate-NoteDelegate:

.. image:: ../_static/delegates/NoteDelegate_unselected_disabled.png
.. image:: ../_static/delegates/NoteDelegate_unselected_editable.png

.. image:: ../_static/delegates/NoteDelegate_selected_disabled.png
.. image:: ../_static/delegates/NoteDelegate_selected_editable.png


By default, creates a NoteEditor as its editor.

.. image:: ../_static/editors/NoteEditor_editable.png
Field attributes supported by this editor : 

PlainTextDelegate
-----------------
Custom delegate for simple string values

.. _delegate-PlainTextDelegate:

.. image:: ../_static/delegates/PlainTextDelegate_unselected_disabled.png
.. image:: ../_static/delegates/PlainTextDelegate_unselected_editable.png

.. image:: ../_static/delegates/PlainTextDelegate_selected_disabled.png
.. image:: ../_static/delegates/PlainTextDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`length <field-attribute-length>`
 * :ref:`editable <field-attribute-editable>`
 * :ref:`translate_content <field-attribute-translate_content>`
By default, creates a TextLineEditor as its editor.

.. image:: ../_static/editors/TextLineEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`length <field-attribute-length>`
 * :ref:`editable <field-attribute-editable>`
RichTextDelegate
----------------

  

.. _delegate-RichTextDelegate:

.. image:: ../_static/delegates/RichTextDelegate_unselected_disabled.png
.. image:: ../_static/delegates/RichTextDelegate_unselected_editable.png

.. image:: ../_static/delegates/RichTextDelegate_selected_disabled.png
.. image:: ../_static/delegates/RichTextDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`editable <field-attribute-editable>`
By default, creates a RichTextEditor as its editor.

.. image:: ../_static/editors/RichTextEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`editable <field-attribute-editable>`
SmileyDelegate
--------------
Delegate for Smiley's
  

.. _delegate-SmileyDelegate:

.. image:: ../_static/delegates/SmileyDelegate_unselected_disabled.png
.. image:: ../_static/delegates/SmileyDelegate_unselected_editable.png

.. image:: ../_static/delegates/SmileyDelegate_selected_disabled.png
.. image:: ../_static/delegates/SmileyDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`editable <field-attribute-editable>`
By default, creates a SmileyEditor as its editor.

.. image:: ../_static/editors/SmileyEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`img <field-attribute-img>`
 * :ref:`editable <field-attribute-editable>`
StarDelegate
------------
Delegate for integer values from (1 to 5)(Rating Delegate)
  
  

.. _delegate-StarDelegate:

.. image:: ../_static/delegates/StarDelegate_unselected_disabled.png
.. image:: ../_static/delegates/StarDelegate_unselected_editable.png

.. image:: ../_static/delegates/StarDelegate_selected_disabled.png
.. image:: ../_static/delegates/StarDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`editable <field-attribute-editable>`
 * :ref:`maximum <field-attribute-maximum>`
By default, creates a StarEditor as its editor.

.. image:: ../_static/editors/StarEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`maximum <field-attribute-maximum>`
 * :ref:`editable <field-attribute-editable>`
TextBoolDelegate
----------------
TextEditDelegate
----------------
Custom delegate for simple string values

.. _delegate-TextEditDelegate:

.. image:: ../_static/delegates/TextEditDelegate_unselected_disabled.png
.. image:: ../_static/delegates/TextEditDelegate_unselected_editable.png

.. image:: ../_static/delegates/TextEditDelegate_selected_disabled.png
.. image:: ../_static/delegates/TextEditDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`editable <field-attribute-editable>`
By default, creates a TextEditEditor as its editor.

.. image:: ../_static/editors/TextEditEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`length <field-attribute-length>`
 * :ref:`editable <field-attribute-editable>`
TimeDelegate
------------


.. _delegate-TimeDelegate:

.. image:: ../_static/delegates/TimeDelegate_unselected_disabled.png
.. image:: ../_static/delegates/TimeDelegate_unselected_editable.png

.. image:: ../_static/delegates/TimeDelegate_selected_disabled.png
.. image:: ../_static/delegates/TimeDelegate_selected_editable.png

Field attributes supported by the delegate : 

 * :ref:`editable <field-attribute-editable>`
By default, creates a TimeEditor as its editor.

.. image:: ../_static/editors/TimeEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`editable <field-attribute-editable>`
 * :ref:`format <field-attribute-format>`
VirtualAddressDelegate
----------------------

  

.. _delegate-VirtualAddressDelegate:

.. image:: ../_static/delegates/VirtualAddressDelegate_unselected_disabled.png
.. image:: ../_static/delegates/VirtualAddressDelegate_unselected_editable.png

.. image:: ../_static/delegates/VirtualAddressDelegate_selected_disabled.png
.. image:: ../_static/delegates/VirtualAddressDelegate_selected_editable.png


By default, creates a VirtualAddressEditor as its editor.

.. image:: ../_static/editors/VirtualAddressEditor_editable.png
Field attributes supported by this editor : 

 * :ref:`editable <field-attribute-editable>`

Submodules

Variables
  doc = 'Camelot includes a number of Qt delegates, most of them...
  custom_delegates = [<class 'Camelot.camelot.view.controls.dele...
  __doc__ = """Camelot includes a number of Qt delegates, most o...
  __package__ = 'Camelot.camelot.view.controls.delegates'
Variables Details

doc

Value:
'''Camelot includes a number of Qt delegates, most of them are used as\
 default
delegates for the various sqlalchemy and camelot field types.

Some delegates take specific arguments into account for their construc\
tion.
All :attr:`field_attributes` specified for a certain field will be pro\
pagated
...

custom_delegates

Value:
[<class 'Camelot.camelot.view.controls.delegates.booldelegate.BoolDele\
gate'>,
 <class 'Camelot.camelot.view.controls.delegates.codedelegate.CodeDele\
gate'>,
 <class 'Camelot.camelot.view.controls.delegates.colordelegate.ColorDe\
legate'>,
 <class 'Camelot.camelot.view.controls.delegates.coloredfloatdelegate.\
ColoredFloatDelegate'>,
...

__doc__

Value:
"""Camelot includes a number of Qt delegates, most of them are used as\
 default
delegates for the various sqlalchemy and camelot field types.

Some delegates take specific arguments into account for their construc\
tion.
All :attr:`field_attributes` specified for a certain field will be pro\
pagated
...