Camelot includes editors for various types of fields. Each editor at least supports these features :
- a set_value method to set a python type as the editor’s value
- a get_value method to retrieve a python type from the editor
- the ValueLoading state : an editor has as its value ValueLoading upon construction and
the editor’s value can be set to ValueLoading if the value that should be displayed is not yet available in the GUI thread, but is still on it’s way from the model to the GUI. This means that once set_value( ValueLoading ) is called, get_value() will always return ValueLoading until set_value is called with another argument.
Bases: PyQt4.QtGui.QCheckBox, camelot.view.controls.editors.customeditor.AbstractCustomEditor
Widget for editing a boolean field
Bases: PyQt4.QtGui.QFrame, camelot.view.controls.editors.customeditor.CustomEditor, camelot.view.controls.editors.wideeditor.WideEditor
Editor to display and manipulate matplotlib charts. The editor itself is generic for all kinds of plots, it simply provides the data to be ploted with a set of axes. The data itself should know how exactly to plot itself.
Copy the chart to the clipboard
intercept mouse clicks on a chart to show the chart fullscreen
draw the matplotlib figure on the canvas
Popup a print preview dialog for the Chart
Overwrite set_field attributes because a ChartEditor cannot be disabled or have its background color changed
Accepts a camelot.container.chartcontainer.FigureContainer or a camelot.container.chartcontainer.AxesContainer
Show the plot full screen, using the litebox
Parameters: | chart – a chart container |
---|---|
Returns: | the widget showing the chart, by default a LiteBoxView |
Bases: PyQt4.QtGui.QComboBox, camelot.view.controls.editors.customeditor.AbstractCustomEditor
A ComboBox aka Drop Down box that can be assigned a list of keys and values
Return type: | a list of (value,name) tuples |
---|
Get the current value of the combobox
Parameters: | choices – a list of (value,name) tuples. name will be displayed in the combobox, |
---|
while value will be used within get_value and set_value. This method changes the items in the combo box while preserving the current value, even if this value is not in the new list of choices.
Set the current value of the combobox where value, the name displayed is the one that matches the value in the list set with set_choices
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for editing a float field, with a calculator
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Bases: PyQt4.QtGui.QWidget, camelot.view.controls.editors.customeditor.AbstractCustomEditor
Base class for implementing custom editor widgets. This class provides dual state functionality. Each editor should have the posibility to have ValueLoading as its value, specifying that no value has been set yet.
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for editing date values
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for editing date and time separated and with popups
Bases: camelot.view.controls.editors.customeditor.CustomEditor, camelot.view.controls.editors.wideeditor.WideEditor
Widget for editing a many 2 one relation a a form embedded in another form.
@todo: properly take care of making the form editable or not, simply enabling or disabling the widget as a whole is not functional, since tabs don’t work in that case
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for editing File fields
Called inside init, overwrite this method for custom file edit widgets
Slot to be called when a new stored_file has been created by the storage
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for editing a float field, with a calculator button. The calculator button can be turned of with the calculator field attribute.
Bases: camelot.view.controls.editors.fileeditor.FileEditor, camelot.view.controls.editors.wideeditor.WideEditor
Editor to view and edit image files, this is a customized implementation of a FileEditor
Check a byte_array into the storage
Copy the image to the clipboard
Paste an image from the clipboard into the editor
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for editing an integer field, with a calculator
Special use cases of the IntegerEditor :
we have a required integer field without a default.
so the model will do set_value( None )
since this is a required field, the user should be able to enter a value, 0 is a legitimate value.
when get_value is called, 0 should be returned if the user has set the editor to 0, and None if the user didn’t touch the editor.
so the editor should make a visual difference between None and 0, so the user can see he didn’t enter something yet
we have a non required integer field without a default
the model will do set_value( None )
the get_value() should return None and not 0. because in case it returns 0, 0 will be written to the db, causing an unneeded update of the db.
Bases: PyQt4.QtGui.QLabel, camelot.view.controls.editors.customeditor.AbstractCustomEditor
Bases: PyQt4.QtGui.QComboBox, camelot.view.controls.editors.customeditor.AbstractCustomEditor
A ComboBox that shows a list of languages, the editor takes as its value the ISO code of the language
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for browsing local files and directories
Called inside init, overwrite this method for custom file edit widgets
Bases: camelot.view.controls.editors.one2manyeditor.One2ManyEditor, camelot.view.controls.editors.abstractmanytooneeditor.AbstractManyToOneEditor
Remove the selected rows in this tableview, but don’t delete them
Bases: camelot.view.controls.editors.customeditor.CustomEditor, camelot.view.controls.editors.abstractmanytooneeditor.AbstractManyToOneEditor
Widget for editing many 2 one relations
Bases: PyQt4.QtCore.QAbstractListModel
Returns: | a function that returns the selected entity or ValueLoading |
---|
or None
Search for object that match text, to fill the list of completions
Returns: | a list of tuples of (object_representation, object_getter) |
---|
Update the gui
Parameters: | value – either ValueLoading, or a function that returns None |
---|
or the entity to be shown in the editor
Bases: camelot.view.controls.editors.customeditor.CustomEditor
MonthsEditor
composite months and years editor
Bases: PyQt4.QtGui.QLabel, camelot.view.controls.editors.customeditor.AbstractCustomEditor
An editor that behaves like a note, the editor hides itself when there is no text to display
Bases: camelot.view.controls.editors.customeditor.CustomEditor, camelot.view.controls.editors.wideeditor.WideEditor
Bases: camelot.view.controls.editors.choiceseditor.ChoicesEditor
Makes sure choices are not reset when changing the field attributes
Bases: camelot.view.controls.editors.customeditor.CustomEditor, camelot.view.controls.editors.wideeditor.WideEditor
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Bases: PyQt4.QtGui.QLineEdit, camelot.view.controls.editors.customeditor.AbstractCustomEditor
Bases: PyQt4.QtGui.QTimeEdit, camelot.view.controls.editors.customeditor.AbstractCustomEditor
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Bases: PyQt4.QtGui.QLabel, camelot.view.controls.editors.customeditor.AbstractCustomEditor
Parameter : |
|
---|
Bases: PyQt4.QtGui.QTextEdit, camelot.view.controls.editors.customeditor.AbstractCustomEditor, camelot.view.controls.editors.wideeditor.WideEditor
Bases: object
Class signaling that an editor, is a wide editor, so it’s label should be displayed on top of the editor and the editor itself should take two columns:
class WideTextLineEditor(TextLineEditor, WideEditor):
pass
will generate a test line editor where the text line takes the whole with of the form
Bases: PyQt4.QtGui.QCheckBox, camelot.view.controls.editors.customeditor.AbstractCustomEditor
Widget for editing a boolean field
Bases: PyQt4.QtGui.QLabel, camelot.view.controls.editors.customeditor.AbstractCustomEditor
Parameter : |
|
---|
Bases: PyQt4.QtGui.QFrame, camelot.view.controls.editors.customeditor.CustomEditor, camelot.view.controls.editors.wideeditor.WideEditor
Editor to display and manipulate matplotlib charts. The editor itself is generic for all kinds of plots, it simply provides the data to be ploted with a set of axes. The data itself should know how exactly to plot itself.
Overwrite set_field attributes because a ChartEditor cannot be disabled or have its background color changed
Accepts a camelot.container.chartcontainer.FigureContainer or a camelot.container.chartcontainer.AxesContainer
Parameters: | chart – a chart container |
---|---|
Returns: | the widget showing the chart, by default a LiteBoxView |
Bases: PyQt4.QtGui.QComboBox, camelot.view.controls.editors.customeditor.AbstractCustomEditor
A ComboBox aka Drop Down box that can be assigned a list of keys and values
Parameters: | choices – a list of (value,name) tuples. name will be displayed in the combobox, |
---|
while value will be used within get_value and set_value. This method changes the items in the combo box while preserving the current value, even if this value is not in the new list of choices.
Set the current value of the combobox where value, the name displayed is the one that matches the value in the list set with set_choices
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for editing a float field, with a calculator
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Bases: object
Helper class to be used to build custom editors. This class provides functionality to store and retrieve ValueLoading as an editor’s value.
Guidelines for implementing CustomEditors :
Bases: PyQt4.QtGui.QWidget, camelot.view.controls.editors.customeditor.AbstractCustomEditor
Base class for implementing custom editor widgets. This class provides dual state functionality. Each editor should have the posibility to have ValueLoading as its value, specifying that no value has been set yet.
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for editing date values
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for editing date and time separated and with popups
Bases: camelot.view.controls.editors.customeditor.CustomEditor, camelot.view.controls.editors.wideeditor.WideEditor
Widget for editing a many 2 one relation a a form embedded in another form.
@todo: properly take care of making the form editable or not, simply enabling or disabling the widget as a whole is not functional, since tabs don’t work in that case
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for editing File fields
Bases: PyQt4.QtGui.QDoubleSpinBox
Spinbox that doesn’t accept mouse scrolling as input
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for editing a float field, with a calculator button. The calculator button can be turned of with the calculator field attribute.
Bases: camelot.view.controls.editors.fileeditor.FileEditor, camelot.view.controls.editors.wideeditor.WideEditor
Editor to view and edit image files, this is a customized implementation of a FileEditor
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for editing an integer field, with a calculator
Special use cases of the IntegerEditor :
we have a required integer field without a default.
so the model will do set_value( None )
since this is a required field, the user should be able to enter a value, 0 is a legitimate value.
when get_value is called, 0 should be returned if the user has set the editor to 0, and None if the user didn’t touch the editor.
so the editor should make a visual difference between None and 0, so the user can see he didn’t enter something yet
we have a non required integer field without a default
the model will do set_value( None )
the get_value() should return None and not 0. because in case it returns 0, 0 will be written to the db, causing an unneeded update of the db.
Bases: PyQt4.QtGui.QLabel, camelot.view.controls.editors.customeditor.AbstractCustomEditor
Bases: PyQt4.QtGui.QComboBox, camelot.view.controls.editors.customeditor.AbstractCustomEditor
A ComboBox that shows a list of languages, the editor takes as its value the ISO code of the language
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Widget for browsing local files and directories
Bases: camelot.view.controls.editors.customeditor.CustomEditor, camelot.view.controls.editors.abstractmanytooneeditor.AbstractManyToOneEditor
Widget for editing many 2 one relations
Returns: | a function that returns the selected entity or ValueLoading |
---|
or None
Search for object that match text, to fill the list of completions
Returns: | a list of tuples of (object_representation, object_getter) |
---|
Bases: camelot.view.controls.editors.one2manyeditor.One2ManyEditor, camelot.view.controls.editors.abstractmanytooneeditor.AbstractManyToOneEditor
Bases: camelot.view.controls.editors.customeditor.CustomEditor
MonthsEditor
composite months and years editor
Bases: PyQt4.QtGui.QLabel, camelot.view.controls.editors.customeditor.AbstractCustomEditor
An editor that behaves like a note, the editor hides itself when there is no text to display
Bases: camelot.view.controls.editors.customeditor.CustomEditor, camelot.view.controls.editors.wideeditor.WideEditor
Bases: camelot.view.controls.editors.choiceseditor.ChoicesEditor
Bases: PyQt4.QtGui.QTextEdit
A TextEdit editor that sends editingFinished events when the text was changed and focus is lost.
Bases: camelot.view.controls.editors.customeditor.CustomEditor, camelot.view.controls.editors.wideeditor.WideEditor
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Bases: PyQt4.QtGui.QTextEdit, camelot.view.controls.editors.customeditor.AbstractCustomEditor, camelot.view.controls.editors.wideeditor.WideEditor
Bases: PyQt4.QtGui.QLineEdit, camelot.view.controls.editors.customeditor.AbstractCustomEditor
Bases: PyQt4.QtGui.QTimeEdit, camelot.view.controls.editors.customeditor.AbstractCustomEditor
Bases: camelot.view.controls.editors.customeditor.CustomEditor
Validates wether a virtual address is valid and correct it if possible. :param address_type: the type of address to validate, eg ‘phone’ :param address: the address itself :return: (valid, corrected_address) a tuple with a :type:`boolean`
indicating if the address is valid and a string with the corrected address.
Bases: object
Class signaling that an editor, is a wide editor, so it’s label should be displayed on top of the editor and the editor itself should take two columns:
class WideTextLineEditor(TextLineEditor, WideEditor):
pass
will generate a test line editor where the text line takes the whole with of the form