pycrossword  0.4
Pure-Python implementation of a crossword puzzle generator and editor
Public Member Functions | Public Attributes | List of all members
pycross.forms.ComboboxDelegate Class Reference

Delegate class for table and tree-like widgets implementing an in-cell combobox. More...

Inheritance diagram for pycross.forms.ComboboxDelegate:

Public Member Functions

def __init__ (self, editable=False, data_role=QtCore.Qt.UserRole+1, parent=None)
 Constructor. More...
 
QtWidgets.QWidget createEditor (self, QtWidgets.QWidget parent, QtWidgets.QStyleOptionViewItem option, QtCore.QModelIndex index)
 Overridden method of QtWidgets.QStyledItemDelegate: creates the underlying delegate (editor widget). More...
 
def setEditorData (self, editor, QtCore.QModelIndex index)
 Overridden method of QtWidgets.QStyledItemDelegate: updates the editor data (text) from the underlying model. More...
 
def setModelData (self, editor, QtCore.QAbstractItemModel model, QtCore.QModelIndex index)
 Overridden method of QtWidgets.QStyledItemDelegate: updates the underlying model from the editor data (text). More...
 
def updateEditorGeometry (self, editor, QtWidgets.QStyleOptionViewItem option, QtCore.QModelIndex index)
 Overridden method of QtWidgets.QStyledItemDelegate: updates the editor position and size for a given model index. More...
 

Public Attributes

 data_role
 
 editable
 

Detailed Description

Delegate class for table and tree-like widgets implementing an in-cell combobox.

Constructor & Destructor Documentation

◆ __init__()

def pycross.forms.ComboboxDelegate.__init__ (   self,
  editable = False,
  data_role = QtCore.Qt.UserRole + 1,
  parent = None 
)

Constructor.

Parameters
model_indiceslist list of indices in underlying model that must contain the BrowseEdit fields
thisparentQtWidgets.QWidget parent widget for this instance
browse_edit_kwargskeyword arguments keyword arguments passed to BrowseEdit constructor

Member Function Documentation

◆ createEditor()

QtWidgets.QWidget pycross.forms.ComboboxDelegate.createEditor (   self,
QtWidgets.QWidget  parent,
QtWidgets.QStyleOptionViewItem  option,
QtCore.QModelIndex  index 
)

Overridden method of QtWidgets.QStyledItemDelegate: creates the underlying delegate (editor widget).

◆ setEditorData()

def pycross.forms.ComboboxDelegate.setEditorData (   self,
  editor,
QtCore.QModelIndex  index 
)

Overridden method of QtWidgets.QStyledItemDelegate: updates the editor data (text) from the underlying model.

◆ setModelData()

def pycross.forms.ComboboxDelegate.setModelData (   self,
  editor,
QtCore.QAbstractItemModel  model,
QtCore.QModelIndex  index 
)

Overridden method of QtWidgets.QStyledItemDelegate: updates the underlying model from the editor data (text).

◆ updateEditorGeometry()

def pycross.forms.ComboboxDelegate.updateEditorGeometry (   self,
  editor,
QtWidgets.QStyleOptionViewItem  option,
QtCore.QModelIndex  index 
)

Overridden method of QtWidgets.QStyledItemDelegate: updates the editor position and size for a given model index.

Member Data Documentation

◆ data_role

pycross.forms.ComboboxDelegate.data_role

◆ editable

pycross.forms.ComboboxDelegate.editable

The documentation for this class was generated from the following file: