def METHOD_NAME(self, parent):
    """Finishes initializing the editor by creating the underlying toolkit
    widget.
    """
    if self.factory.readonly:
        self.control = QtGui.QLineEdit(self.str_value)
        self.control.setReadOnly(True)
        self.set_tooltip()
    else:
        super().METHOD_NAME(parent)
    pal = QtGui.QPalette(self.control.palette())
    pal.setColor(QtGui.QPalette.ColorRole.Base, self.ok_color)
    self.control.setPalette(pal)
    # Install EventFilter on control to handle DND events.
    drop_event_filter = _DropEventFilter(self.control)
    self.control.installEventFilter(drop_event_filter)
    self.control._qt_editor = self