PyANGGui.GEditor¶
- class GEditor¶
Base class for all the editors in Aimsun Next.
Details
Every class in Aimsun Next can have an editor associated with it. When the user start the edition of an object (double click over an object or using Properties button in the context menu) the system look for a suitable editor. It looks first for an editor registered for its type. If no editor is found then look for an editor for it super type recursively until it founds an editor (the
GKObjecttype has associated a very simple editor).This editor must be a subclass of
GEditorand must implement a C function (an object factory) with the following signature:extern "C" EXPORT_MACRO QDialog * XXXEditorFactory( QWidget* parent, GKModel * model, bool * useExec );
where XXX is the name of the class that will edit (for example in the editor for
GKPolylinethe C function is called GKPolylineEditorPolyline) and EXPORT_MACRO is a macro needed in the Windows platform to export C functions included in a DLL. To know more about this macro look atGKObjectdocumentation.The developer will implement at least the following methods: - GEditor::editThis: to init the editor with the object to be edited. -
accept: to makes the changes in the object edited. -reject: to cancel any edition over the dialog.Is up to the developer how and when do the changes and discard its during the object edition but its recommended the following behavior: - In editThis create a copy of the object to be edited - Do changes in the copy - In accept moves the changes from the copy to the original object - In reject nothing has to be done to the original
<h2>Read only objects</h2> An object cannot accept modifications as returned by the method
canBeEdited. If so the dialog must desativate the OK button (or any other button that changes the object as, maybe, an Apply button). The method GEditor::setEnabledOK is a helper in this direction.<h2>Extending an editor</h2> An editor can be extended in run time with new tab folders using the GEditorExtension class. The editor to be extended must contain a tab folder widget (where the new extensions will be placed). The name of this tab folder widget must be tabs or tabWidget.
Inherited by:
GTimeSeriesViewer,GProgressDialogExtension,GAnyObjectChooserEditorSynopsis¶
Methods¶
def
__init__()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- __init__([parent=None[, fl=Qt.Dialog]])¶
- Parameters:
parent –
QWidgetfl – Combination of
WindowType