RangeFilter QML Type | Qt 6.12
Description: Filters data in a SortFilterProxyModel by testing whether a role value falls within a given range.
Keywords: qmltype

- Qt 6.12
- QML Types
- RangeFilter
- Qt 6.12.0 Reference Documentation

# RangeFilter QML Type

Filters data in a SortFilterProxyModel by testing whether a role value falls within a given range. More...

Import Statement: | `import QtQml.Models`
Since: | Qt 6.12
Inherits: | RoleFilter
Status: | Technology preview

This type is in technology preview and is subject to change.

- List of all members, including inherited members

## Properties

- maximum : variant
- minimum : variant

## Methods

- variant exclusive(value)

## Detailed Description

RangeFilter accepts rows where the value of the configured role falls between minimum and maximum. Both bounds are inclusive by default.

The following example shows processes with the CPU usage in the range between 70 and 100:

     SortFilterProxyModel {
         sourceModel: processModel
         filters: [
             RangeFilter {
                 roleName: "cpuUsage"
                 minimum: 70
                 maximum: 100
             }
         ]
     }

Use exclusive() when a bound should exclude the boundary value itself:

     RangeFilter {
         roleName: "cpuUsage"
         minimum: exclusive(70)
         maximum: 100
     }

## Property Documentation

### maximum : variant

The upper bound of the range. Rows whose role value is greater than this value are excluded. When not set, there is no upper bound.

Assigning a plain value makes the bound inclusive — rows equal to `maximum` are accepted. Use exclusive() to exclude the boundary value itself.

### minimum : variant

The lower bound of the range. Rows whose role value is less than this value are excluded. When not set, there is no lower bound.

Assigning a plain value makes the bound inclusive — rows equal to `minimum` are accepted. Use exclusive() to exclude the boundary value itself.

## Method Documentation

### variant exclusive(value)

Returns a boundary that excludes value from the range. Rows whose role value equals value are rejected.

     RangeFilter {
         roleName: "score"
         minimum: 0
         maximum: RangeFilter.exclusive(100)