There is an example for using an IntValidator right there in the documentation of TextInput's validator property.

A Google query for "qml textinput validator" returns this as its first hit.

Cheers,
_