mmSolver.ui.uimodels#

Qt models used in Model-View-Controller designs.

mmSolver.ui.uimodels.getNameFromDict(index, names_dict, lookup_dict)#

Get the ‘name’ from an index, using a specific data structure.

For example:

index = 0
names_dict = {
    0: 'Column',
}
lookup_dict = {
    'Column': 'name',
}
x = getNameFromDict(index, names_dict, lookup_dict)
# x equals 'name'
Parameters:
  • index – Index to look up.

  • names_dict – The mapping data, from index to ‘second key’.

  • lookup_dict – Mapping data structure from ‘second key’ to final look up name.

Returns:

The name in ‘lookup_dict’ referred to by index in ‘names_dict’, or None if the name is not in the dictionary.

Return type:

str or None

class mmSolver.ui.uimodels.ItemModel(*args, **kw)#
defaultNodeType()#
columnNames()#
columnAlignments()#
getGetAttrFuncFromIndex(index)#
getSetAttrFuncFromIndex(index)#
getColorFuncFromIndex(index)#
indexEnabled(index)#
indexCheckable(index)#
indexSelectable(index)#
indexEditable(index)#
indexIcon(index)#
indexColumnAlignment(index)#
getColumnNameFromIndex(index)#
getColumnIndexFromColumnName(name)#
rootNode()#
setRootNode(rootNode)#
getNode(index)#
columnCount(parent=<MyCustomMock name='mock()' id='140422717381648'>)#
rowCount(parent=<MyCustomMock name='mock()' id='140422717381840'>)#
data(index, role)#
setData(index, value, role=<MyCustomMock id='140422717381904'>)#
headerData(section, orientation, role)#
flags(index)#
parent(index)#
index(row, column, parent)#
insertRows(position, rows, parent=<MyCustomMock name='mock()' id='140422717382096'>)#
removeRows(position, rows, parent=<MyCustomMock name='mock()' id='140422719097936'>)#
class mmSolver.ui.uimodels.TableModel(*args, **kw)#
defaultNodeType()#
columnNames()#
getGetAttrFuncFromIndex(index)#
getSetAttrFuncFromIndex(index)#
getColorFuncFromIndex(index)#
indexEnabled(index)#
indexCheckable(index)#
indexSelectable(index)#
indexEditable(index)#
indexIcon(index)#
getColumnNameFromIndex(index)#
getColumnIndexFromColumnName(name)#
columnCount(parent=<MyCustomMock name='mock()' id='140422717382288'>)#
rowCount(parent=<MyCustomMock name='mock()' id='140422717382416'>)#
data(index, role)#
setData(index, value, role=<MyCustomMock id='140422717382224'>)#
nodeList()#

Get a copy of the internal node list for this model.

setNodeList(node_list)#

Replace the internal node list entirely.

headerData(section, orientation, role)#
flags(index)#
insertRows(position, rows, parent=<MyCustomMock name='mock()' id='140422717382608'>)#
removeRows(position, rows, parent=<MyCustomMock name='mock()' id='140422717382544'>)#
class mmSolver.ui.uimodels.StringDataListModel(*args, **kw)#
stringDataList()#
setStringDataList(stringDataList)#
headerData(section, orientation, role)#
data(index, role=<MyCustomMock id='140422717452624'>)#
flags(index)#
insertRows(row, count, parent=<MyCustomMock name='mock()' id='140422717452880'>)#
removeRows(row, count, parent=<MyCustomMock name='mock()' id='140422717453264'>)#
rowCount(parent=<MyCustomMock name='mock()' id='140422717453584'>)#
setData(index, value, role=<MyCustomMock id='140422717453904'>)#
class mmSolver.ui.uimodels.ComboBoxDelegate(*args, **kw)#
getValueList()#

Sub-class, override this method and return a list of strings for the combo-box values.

createEditor(parent, option, index)#
setEditorData(editor, index)#
setModelData(editor, model, index)#
class mmSolver.ui.uimodels.ItemModel(*args, **kw)#
defaultNodeType()#
columnNames()#
columnAlignments()#
getGetAttrFuncFromIndex(index)#
getSetAttrFuncFromIndex(index)#
getColorFuncFromIndex(index)#
indexEnabled(index)#
indexCheckable(index)#
indexSelectable(index)#
indexEditable(index)#
indexIcon(index)#
indexColumnAlignment(index)#
getColumnNameFromIndex(index)#
getColumnIndexFromColumnName(name)#
rootNode()#
setRootNode(rootNode)#
getNode(index)#
columnCount(parent=<MyCustomMock name='mock()' id='140422717381648'>)#
rowCount(parent=<MyCustomMock name='mock()' id='140422717381840'>)#
data(index, role)#
setData(index, value, role=<MyCustomMock id='140422717381904'>)#
headerData(section, orientation, role)#
flags(index)#
parent(index)#
index(row, column, parent)#
insertRows(position, rows, parent=<MyCustomMock name='mock()' id='140422717382096'>)#
removeRows(position, rows, parent=<MyCustomMock name='mock()' id='140422719097936'>)#
class mmSolver.ui.uimodels.TableModel(*args, **kw)#
defaultNodeType()#
columnNames()#
getGetAttrFuncFromIndex(index)#
getSetAttrFuncFromIndex(index)#
getColorFuncFromIndex(index)#
indexEnabled(index)#
indexCheckable(index)#
indexSelectable(index)#
indexEditable(index)#
indexIcon(index)#
getColumnNameFromIndex(index)#
getColumnIndexFromColumnName(name)#
columnCount(parent=<MyCustomMock name='mock()' id='140422717382288'>)#
rowCount(parent=<MyCustomMock name='mock()' id='140422717382416'>)#
data(index, role)#
setData(index, value, role=<MyCustomMock id='140422717382224'>)#
nodeList()#

Get a copy of the internal node list for this model.

setNodeList(node_list)#

Replace the internal node list entirely.

headerData(section, orientation, role)#
flags(index)#
insertRows(position, rows, parent=<MyCustomMock name='mock()' id='140422717382608'>)#
removeRows(position, rows, parent=<MyCustomMock name='mock()' id='140422717382544'>)#
class mmSolver.ui.uimodels.StringDataListModel(*args, **kw)#
stringDataList()#
setStringDataList(stringDataList)#
headerData(section, orientation, role)#
data(index, role=<MyCustomMock id='140422717452624'>)#
flags(index)#
insertRows(row, count, parent=<MyCustomMock name='mock()' id='140422717452880'>)#
removeRows(row, count, parent=<MyCustomMock name='mock()' id='140422717453264'>)#
rowCount(parent=<MyCustomMock name='mock()' id='140422717453584'>)#
setData(index, value, role=<MyCustomMock id='140422717453904'>)#
class mmSolver.ui.uimodels.ComboBoxDelegate(*args, **kw)#
getValueList()#

Sub-class, override this method and return a list of strings for the combo-box values.

createEditor(parent, option, index)#
setEditorData(editor, index)#
setModelData(editor, model, index)#