# Funciones específicas de QML

## Modelo

### Funciones

Disponible en: [lista QML](/36/velneo-vdevelop/proyectos-objetos-y-editores/proyecto-de-aplicacion/lista-qml.md).

Sintaxis de funciones que usan el modelo: **objetoQML.model.función**

#### **Obtener el nº de registro que hay en el modelo**

`int Count() const;`

#### **Limpia el modelo dejándolo sin registros**

`void Clear();`

#### **Ordenar los registros del modelo**

```
bool Sort( const QString& szIDCampo, bool bInvertirLista, bool bProgressDialog = false);
```

#### **Quitar un registro del modelo**

```
void RemoveAtIndex( int nIndex );
```

#### **Resetear el modelo**

```
void ResetModel();
```

#### **Leer el valor de la ficha seleccionada del modelo**

```
int GetIndexSelect() const;
```

#### **Fijar la ficha seleccionada del modelo**

```
void SetIndexSelect( int nIndex );
```

#### **Ejecutar un proceso**

```qml
bool RunProcess( const QString& szIDProceso );
// szIDProceso = AliasProyecto@IdProceso
```

Por el momento AliasProyecto desde indicarse con el nombre del fichero en disco .vca.

Es importante fijar el elemento seleccionado en el modelo antes de ejecutar el proceso SetIndexSelect( index ).

Si el proceso es de ficha el QML le pasará la ficha seleccionada si el proceso es de lista le devuelve la lista de registros del modelo y también tendrá acceso a la ficha seleccionada de la lista.

#### **Obtener un registro de la lista del modelo por el nº de índice**

```
VRegister* GetRegisterAt( int nIndex, bool bLocked ); // bLocked: 0=Sin bloqueo, 1=Con bloqueo
```

## Funciones de root

```
closeForm() // permite cerrar el formulario QML. Sintaxis a utilizar theRoot.closeForm()
```

## Documentación adicional

### Imágenes

En el objeto image de QML para imágenes servidas por se procesa la propiedad asynchronous : bool declarada en el objeto.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.velneo.com/36/velneo-vdevelop/scripts/lenguajes/qml/funciones-especificas-de-qml.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
