On this page

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.

Properties

Methods

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)

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.