feat(Storybook): Utility proxy model for limiting model's count
It's convenient for testing some corner cases (especially when used with Slider) when e.g. model is empty or has only one item.
This commit is contained in:
parent
a6815a7ad2
commit
453d75b304
|
@ -0,0 +1,12 @@
|
|||
import SortFilterProxyModel 0.2
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: root
|
||||
|
||||
property int limit
|
||||
|
||||
filters: IndexFilter {
|
||||
maximumIndex: Math.max(root.limit - 1, 0)
|
||||
minimumIndex: root.limit === 0 ? 1 : 0
|
||||
}
|
||||
}
|
|
@ -15,6 +15,7 @@ InspectionItem 1.0 InspectionItem.qml
|
|||
InspectionItemsList 1.0 InspectionItemsList.qml
|
||||
InspectionPanel 1.0 InspectionPanel.qml
|
||||
InspectionWindow 1.0 InspectionWindow.qml
|
||||
LimitProxyModel 1.0 LimitProxyModel.qml
|
||||
Logs 1.0 Logs.qml
|
||||
LogsAndControlsPanel 1.0 LogsAndControlsPanel.qml
|
||||
LogsView 1.0 LogsView.qml
|
||||
|
|
Loading…
Reference in New Issue