SessionList

Methods

qconcurrency.widgets._sessionwidgets_.SessionList.__init__([…])
param colours:An optional dictionary, indicating colours to use
qconcurrency.widgets._sessionwidgets_.SessionList.add_item(val) Adds a new item to the list.
qconcurrency.widgets._sessionwidgets_.SessionList.changes_exist True/False if unsaved changes exist
qconcurrency.widgets._sessionwidgets_.SessionList.clear() Clears the list, and all internal data.
qconcurrency.widgets._sessionwidgets_.SessionList.keyPressEvent(event) If an item is selected in the list, the last-item in the selection is toggled between editable and normal modes.
qconcurrency.widgets._sessionwidgets_.SessionList.remove_item(_id) Removes a single item from the list.
qconcurrency.widgets._sessionwidgets_.SessionList.selectedItems() Wraps QtWidgets.QListWidget.selectedItems() , and returns all selected SessionListItems .
qconcurrency.widgets._sessionwidgets_.SessionList.setSelectionMode(…) Wraps QListWidget.setSelectionMode()
qconcurrency.widgets._sessionwidgets_.SessionList.setSelectionModel(…) Wraps QListWidget.setSelectionModel()
qconcurrency.widgets._sessionwidgets_.SessionList.staticMetaObject

Documentation

class qconcurrency.widgets._sessionwidgets_.SessionList(colours=None)[source]

Bases: qconcurrency.widgets._sessionwidgets_._basewidgets_.SessionWidgetBase, PySide.QtGui.QWidget

__init__(colours=None)[source]
Parameters:colours (dict, optional) –

An optional dictionary, indicating colours to use for QListWidgetItems based on their status.

Any key that is not set in the dictionary uses the stylesheet’s default colours for QListWidgetItems

{
    ‘normal’:  {‘fg’:QColor(255,255,255), ‘bg’:QColor(255,255,255)},
    ‘changed’: {‘fg’:QColor(255,255,255), ‘bg’:QColor(255,255,255)},
    ‘new’:     {‘fg’:QColor(255,255,255), ‘bg’:QColor(255,255,255)},
    ‘editable’: {‘fg’:QColor(255,255,255), ‘bg’:QColor(255,255,255)},
}
add_item(val, _id=None, saved_val=None)[source]

Adds a new item to the list.

Parameters:
  • val (object) – (ex:  'itemA' ) The item you’d like to add to the widget
  • _id (object, optional) –

    If the item exists and has already been assigned an Id provide it here.

    Or, if the item is new, but you want to assign a specific Id, you may also provide an Id here.

  • saved_val (object, optional) –

    If this argument is assigned a value, the item will tracked as being an item that is already saved to the database (or other long-term-storage).

    You can test whether or not a widget’s current value is different from this saved value using the method SessionListItem.is_changed()

changes_exist = <PySide.QtCore.Signal object>

True/False if unsaved changes exist

clear()[source]

Clears the list, and all internal data.

keyPressEvent(event)[source]

If an item is selected in the list, the last-item in the selection is toggled between editable and normal modes.

remove_item(_id)[source]

Removes a single item from the list.

Parameters:_id (object, optional) – The _id of the item that you want to delete.
selectedItems()[source]

Wraps QtWidgets.QListWidget.selectedItems() , and returns all selected SessionListItems .

setSelectionMode(selectionMode)[source]

Wraps QListWidget.setSelectionMode()

setSelectionModel(selectionModel)[source]

Wraps QListWidget.setSelectionModel()

staticMetaObject = <PySide.QtCore.QMetaObject object>