代码拉取完成,页面将自动刷新
同步操作将从 compilelife/loginsight 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 1.4
import './app.js' as App
ColumnLayout {
id: root
width: parent.width
TextField {
id: processText
Layout.preferredWidth: root.width
// width: 1000//parent.width
placeholderText: '请输入要启动的程序名称(全路径),多个参数已空格分割'
}
RowLayout {
spacing: 10
Text {
text: '缓存上限'
}
SpinBox {
id: cacheSpin
minimumValue: 2
maximumValue: 10000
value: 100
}
Text {
text: '块 (一个块200k)'
}
}
RowLayout{
width: parent.width
Layout.fillHeight: true
Layout.minimumHeight: 300
ListView {
id: recordListView
Layout.fillWidth: true
Layout.preferredHeight: parent.height
clip: true
headerPositioning: ListView.OverlayHeader
header: RowLayout {
z: 10
width: recordListView.width
PaperText {
Layout.fillWidth: true
bgColor: 'lightgrey'
text: '程序'
}
PaperText {
Layout.preferredWidth: 150
bgColor: 'lightgrey'
text: '缓存(单位块)'
}
}
delegate: Item {
width: recordListView.width
height: childrenRect.height
RowLayout {
width: parent.width
property string bgColor: recordListView.currentIndex === index ? 'steelblue' : 'white'
property string fgColor: recordListView.currentIndex === index ? 'white' : 'black'
PaperText{
bgColor: parent.bgColor
fgColor: parent.fgColor
Layout.fillWidth: true
text: process
}
PaperText {
bgColor: parent.bgColor
fgColor: parent.fgColor
Layout.preferredWidth: 150
text: cache
}
}
MouseArea {
anchors.fill: parent
onClicked: recordListView.currentIndex = index
}
}
model: ListModel{}
onCurrentItemChanged: {
const v = model.get(currentIndex)
if (v) {
processText.text = v.process
cacheSpin.value = v.cache
}
}
}
Column {
Layout.alignment: Qt.AlignTop
Button {
width: height
text: '+'
onClicked: {
appendRecord()
}
}
Button {
width: height
text: '-'
onClicked: {
recordListView.model.remove(recordListView.currentIndex, 1)
saveRecords()
}
}
}
}
function initRecords() {
recordListView.model.clear()
for (const record of App.settings.processManager.records) {
recordListView.model.append(record)
}
}
function saveRecords() {
const ret = []
const model = recordListView.model
for (let i = 0; i < model.count; i++) {
ret.push(model.get(i))
}
App.settings.processManager.records = ret
App.main.storeSettings()
}
function appendRecord() {
recordListView.model.append({'process': processText.text, 'cache': cacheSpin.value})
saveRecords()
recordListView.currentIndex = recordListView.model.count - 1
}
function getUserSelect() {
return {process: processText.text, cache: cacheSpin.value}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。