# Path: Qt.py



from Qt import QtWidgets, Qt
        placesIndexes = simulation.placesModel.match(
            startSearchIndex, Qt.DisplayRole, code, 1,
            Qt.MatchExactly | Qt.MatchWrap
        )
        if len(placesIndexes) > 0:
            placeIndex = placesIndexes[0].row()
        else:
            placeIndex = 0
        editor.setCurrentIndex(placeIndex)

    def setModelData(self, editor, model, index):
        """Sets the values from the combo box to the model after editing"""
        code = editor.currentText()
        model.setData(index, code, Qt.EditRole)

    def updateEditorGeometry(self, editor, option, index):
        """Sets the editor geometry."""
        editor.setGeometry(option.rect)


class PropertyValuesDelegate(QtWidgets.QStyledItemDelegate):
    """PropertyValuesDelegate is a delegate that provides different editing
    delegates for property values depending on the property propType."""

    def createEditor(self, parent, option, index):
        """Creates the editor, i.e. a combo box for selecting an end
        direction."""
        prop = index.model().trackItems[0].properties[index.row()]
        if prop.propType == "enum":
            comboBox = QtWidgets.QComboBox(parent)

# Path: Qt.py



# Path: ts2/editor/delegates.py
from Qt import QtWidgets, Qt

        placesIndexes = simulation.placesModel.match(
            startSearchIndex, Qt.DisplayRole, code, 1,
            Qt.MatchExactly | Qt.MatchWrap
        )
        if len(placesIndexes) > 0:
            placeIndex = placesIndexes[0].row()
        else:
            placeIndex = 0
        editor.setCurrentIndex(placeIndex)

    def setModelData(self, editor, model, index):
        """Sets the values from the combo box to the model after editing"""
        code = editor.currentText()
        model.setData(index, code, Qt.EditRole)

    def updateEditorGeometry(self, editor, option, index):
        """Sets the editor geometry."""
        editor.setGeometry(option.rect)


class PropertyValuesDelegate(QtWidgets.QStyledItemDelegate):
    """PropertyValuesDelegate is a delegate that provides different editing
    delegates for property values depending on the property propType."""

    def createEditor(self, parent, option, index):
        """Creates the editor, i.e. a combo box for selecting an end
        direction."""
        prop = index.model().trackItems[0].properties[index.row()]
        if prop.propType == "enum":
            comboBox = QtWidgets.QComboBox(parent)

            comboBox.insertItems(0, prop.enumNames)