SessionWidgetItemBase¶
Methods¶
qconcurrency.widgets._sessionwidgets_.SessionWidgetItemBase.__init__(val) |
|
||
qconcurrency.widgets._sessionwidgets_.SessionWidgetItemBase.get_savedval() |
Returns the value that is currently saved in the database. | ||
qconcurrency.widgets._sessionwidgets_.SessionWidgetItemBase.get_value() |
A dummy method that should be re-implemented in subclasses of SessionWidgetItemBase. |
||
qconcurrency.widgets._sessionwidgets_.SessionWidgetItemBase.id() |
Returns the item’s Id | ||
qconcurrency.widgets._sessionwidgets_.SessionWidgetItemBase.is_changed() |
Returns True/False if the widget’s current value is different than it’s saved-value. | ||
qconcurrency.widgets._sessionwidgets_.SessionWidgetItemBase.is_editable() |
Returns True if the widget is currently editable. |
||
qconcurrency.widgets._sessionwidgets_.SessionWidgetItemBase.is_new() |
Returns True/False if the widget is new or not. | ||
qconcurrency.widgets._sessionwidgets_.SessionWidgetItemBase.refresh_status() |
Re-Checks all status information, refreshing it’s internal status, and emitting status_changed if it has changed. |
||
qconcurrency.widgets._sessionwidgets_.SessionWidgetItemBase.setFlags(…) |
Sets the widget’s flags, then checks if there is a change to the editable status (emitting status_changed if there is a change). |
||
qconcurrency.widgets._sessionwidgets_.SessionWidgetItemBase.set_saved([_id]) |
Marks the information represented by this widget as correct, and saved into long-term storage. | ||
qconcurrency.widgets._sessionwidgets_.SessionWidgetItemBase.status_changed |
Documentation¶
-
class
qconcurrency.widgets._sessionwidgets_.SessionWidgetItemBase(val, _id=None, saved_val=None)[source]¶ Bases:
objectParent class for all SessionWidgetItems (items that get added a
SessionWidgetEstablishes consistent variables for subclasses, and provides convenience methods.
-
__init__(val, _id=None, saved_val=None)[source]¶ Parameters: - val (object) – The value assigned to your object. This will be displayed in the widget.
- _id (str, int, optional) – An id, unique to the collection of items the main. If this is a new item (no saved_val is provided) this argument is optional, and a uuid will be assigned in it’s place.
- saved_val (object, optional) – The value stored in long-term-storage. (database, json, etc). The presence of this
-
get_savedval()[source]¶ Returns the value that is currently saved in the database.
Note
If this is a new item,
Nonewill be returned.
-
get_value()[source]¶ A dummy method that should be re-implemented in subclasses of
SessionWidgetItemBase.This method should retrieve the current value from the widget.
-
is_changed()[source]¶ Returns True/False if the widget’s current value is different than it’s saved-value.
-
refresh_status()[source]¶ Re-Checks all status information, refreshing it’s internal status, and emitting
status_changedif it has changed.
-
setFlags(*args, **kwds)[source]¶ Sets the widget’s flags, then checks if there is a change to the editable status (emitting
status_changedif there is a change).
-
set_saved(_id=None)[source]¶ Marks the information represented by this widget as correct, and saved into long-term storage.
- Changes the item’s id (if _id is specified )
- sets the current val to
self._saved_val - calls
self.refresh_status()
Parameters: _id (object, optional) – If the long-term-storage id has changed as a result of this widget’s info being saved, you may provide a new value for self._id
-
status_changed= <PySide.QtCore.Signal object>¶
-