parent
bdded864f2
commit
a2e6bc00dd
|
@ -104,9 +104,8 @@ ApplicationWindow {
|
|||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
PagesList {
|
||||
FilteredPagesList {
|
||||
anchors.fill: parent
|
||||
|
||||
currentPage: root.currentPage
|
||||
model: pagesModel
|
||||
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
import QtQuick 2.14
|
||||
import QtQuick.Layouts 1.14
|
||||
import QtQuick.Controls 2.14
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
|
||||
property alias model: filteredModel.sourceModel
|
||||
property alias currentPage: pagesList.currentPage
|
||||
|
||||
signal pageSelected(string page)
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: filteredModel
|
||||
|
||||
filters: ExpressionFilter {
|
||||
enabled: textField.length > 0
|
||||
expression: {
|
||||
const searchText = textField.text.toLowerCase()
|
||||
return model.title.toLowerCase().indexOf(searchText) !== -1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: textField
|
||||
|
||||
Layout.fillWidth: true
|
||||
placeholderText: "search"
|
||||
|
||||
Keys.onEscapePressed: {
|
||||
text = ""
|
||||
focus = false
|
||||
}
|
||||
}
|
||||
|
||||
PagesList {
|
||||
id: pagesList
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
model: filteredModel
|
||||
|
||||
onPageSelected: root.pageSelected(page)
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
CompilationErrorsBox 1.0 CompilationErrorsBox.qml
|
||||
FilteredPagesList 1.0 FilteredPagesList.qml
|
||||
HotComponentFromSource 1.0 HotComponentFromSource.qml
|
||||
HotLoader 1.0 HotLoader.qml
|
||||
HotReloader 1.0 HotReloader.qml
|
||||
|
|
Loading…
Reference in New Issue