PythonListModel¶
-
class
glue.utils.qt.PythonListModel(items, parent=None)[source]¶ Bases:
PyQt4.QtCore.QAbstractListModelA Qt Model that wraps a python list, and exposes a list-like interface
This can be connected directly to multiple QListViews, which will stay in sync with the state of the container.
Create a new model
Parameters: items : list
The initial list to wrap
parent : QObject
The model parent
Methods Summary
append(value)data(index, role)Retrieve data at each index extend(values)headerData(section, orientation, role)Column labels insert(row, value)pop([row])Remove and return an item (default last item) removeRow(row[, parent])Remove a row from the table rowCount([parent])Number of rows row_label(row)The textual label for the row setData(index, value, role)Update the data in-place set_list(values)Set the model to a new list Methods Documentation
-
pop(row=None)[source]¶ Remove and return an item (default last item)
Parameters: row : int (optional)
Which row to remove. Default=last
Returns: popped : object
-
removeRow(row, parent=None)[source]¶ Remove a row from the table
Parameters: row : int
Row to remove
Returns: successful : bool
-