BUG记:new/delete

气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了气死了
写程序得脑子清醒,不清醒,写错一丢丢就会导致一晚上都在Debug!!!
而我!今天!就是!
错误就出现在
T* element = new T(size)T* element = new T[size]的区别
气死了!我以为自己写了个数组,还用delete []导致一运行到最后就中断了!
不过今天也学习了一下这个new 和delete,详细看这个大佬的博客浅谈 C++ 中的 new/delete 和 new[]/delete[]
再见!

import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.2 import FileManage 1.0 import Theme 1.0 import "../general" Rectangle { id:photoRect visible: true width: parent.width height: parent.height color: Theme.surfaceColor//"black"//"#2F2F2F" signal updateImagsSig() signal sendImagsSig(var imgIndex,var imgSource) signal backToImageSig() signal updateRectSig() // 关键优化1:使用ListModel替代普通数组(支持数据变化通知) ListModel { id: imageModel // 替代原images数组,作为GridView的模型 } FileManage { id: fileManage } // ====================== 新增:删除确认弹窗 ====================== Rectangle { id: deleteConfirmDlg visible: false // 默认隐藏,通过按钮点击显示 width: 580 // 固定宽度 height: 300 // 固定高度 anchors.centerIn: parent // 居中显示 color: Theme.backgroundColor//"#2F2F2F" // 深灰色背景 radius: 10 // 圆角 border.color: Theme.borderPrimary//"#666" border.width: 1 z:2 // 半透明遮罩(覆盖整个窗口,防止点击其他区域) Rectangle { id: modalMask anchors.fill: parent color: Theme.surfaceColor//"black" opacity: 0.5 visible: deleteConfirmDlg.visible // 与弹窗同步显示 } // 弹窗内容 ColumnLayout { anchors.fill: parent anchors.margins: 20 spacing: 20 // 提示文本 Text { text: "Confirm to delete the selected images?" color: Theme.textPrimary//"white" font.pointSize: 24 font.family: "等线 Light" horizontalAlignment: Text.AlignHCenter } // 按钮行 RowLayout { Layout.fillWidth: true spacing: 50 Layout.alignment: Qt.AlignHCenter // 按钮居中排列 // 取消按钮(修复color属性错误) Button { text: "Cancel" Layout.preferredWidth: 140 font.pointSize: 30 font.family: "等线 Light" // 关键修复:通过background属性设置背景色 background: Rectangle { anchors.fill: parent radius: 5 // 圆角 color: Theme.buttonCancel //"#666" // 原color属性移至此处 border.color: Theme.buttonCancelBorder//"#444" // 边框颜色(可选) border.width: 1 } // 设置文本颜色(避免与背景色冲突) contentItem: Text { text: parent.text font: parent.font color: Theme.textPrimary//"white" // 白色文本 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } onClicked: { deleteConfirmDlg.visible = false delBtn.currentIndex = 0; } } // 确认按钮(同样修复color属性错误) Button { text: "Confirm" Layout.preferredWidth: 140 font.pointSize: 30 background: Rectangle { anchors.fill: parent radius: 5 color: Theme.buttonConfirm//"#E74C3C" // 红色背景 border.color: Theme.buttonConfirmBorder//"#B03A2E" // 深边框(可选) border.width: 1 } contentItem: Text { text: parent.text font: parent.font color: Theme.textPrimary//"white" horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } onClicked: { deleteSelectedImages() deleteConfirmDlg.visible = false delBtn.currentIndex = 0 } } } } } // ====================== 弹窗结束 ====================== // Main container Rectangle { id:pRect anchors.fill: parent color: Theme.surfaceColor//"black" anchors.topMargin: 100 anchors.leftMargin: 20//140 width: 1760 property var itemScale: 1 // 新增:布局缩放相关属性 property var currentCellWidth: 350 // 动态单元格宽度(初始350) property var minCellWidth: 150 // 最小单元格宽度(控制最大列数) property var maxCellWidth: 600 // 最大单元格宽度(控制最小列数) property var baseCellWidth: 350 // 手势起始时的基准单元格宽度 RowLayout { anchors.fill: parent spacing:0 // GridView(关键优化:绑定ListModel) GridView { id: imageGridView Layout.fillWidth: true Layout.fillHeight: true // 关键修改:cellWidth 绑定到 currentCellWidth(cellHeight 可保持等比或固定) cellWidth: pRect.currentCellWidth*pRect.itemScale cellHeight: pRect.currentCellWidth*pRect.itemScale // 保持等比(若图片为方形),或根据需求调整(如 currentCellWidth * 1.5) flow: GridView.FlowLeftToRight model: imageModel //interactive: !pinchArea.active // 缩放时禁用滚动 delegate: Item { // 原有 delegate 保持不变(已绑定 GridView.view.cellWidth) id: deleItem width: GridView.view.cellWidth // 自动适配 cellWidth 变化 height: GridView.view.cellHeight // 自动适配 cellHeight 变化 Rectangle { id: rect1 layer.enabled: true // 启用GPU层(关键优化) layer.smooth: true // 平滑缩放 // 调整rect1的尺寸(基于父Item的宽高) width: parent.width //- 50 // parent.width 是Item的width(即GridView.view.cellWidth) height: parent.height// - 50 // parent.height 是Item的height(即GridView.view.cellHeight) color: Theme.gridViewUnSelected//"white" // 显式绑定border.color(关键优化) property bool selected: model.selected signal changeStatus(bool value)//Yun radius: 2 //border.width: 10 //border.color: "white" // anchors.fill:parent Binding { target: rect1 property: "border.color" value: selected ? Theme.gridViewSelected : Theme.gridViewUnSelected } // 显式绑定border.width(关键优化) // Binding { //target: rect1 //property: "border.width" //value: selected ? 12 : 10 // } Timer{ id:timer3 repeat: false interval: 10 onTriggered: { rect1.border.color = selected ? Theme.gridViewSelected : Theme.gridViewUnSelected //rect1.border.width = selected ? 12 : 10 mouseArea1.update() } } function changeStatusFun(value)//Yun { rect1.border.color = value ? Theme.gridViewSelected : Theme.gridViewUnSelected //rect1.border.width = value ? 12 : 10 rect1.update() } Row { visible: true x:15 y:300 width: 50 height: rect1.height spacing: 40 z:2 TagItem{ id:infoTag //x:10 //y:10 width: 32 height: 32 visible: true label: "I" z:2 Component.onCompleted: { //console.info(model.index) var isExist = checkInfoRGBX(model.index,"/Info/") isExist.Info? switchToGreen():switchToWhite() } } TagItem{ id:jpgTag // x:10 //y:80 width: 32 height: 32 visible: true label:"P" z:2 Component.onCompleted: { //console.info(model.index) var isExist = checkInfoRGBX(model.index,"/Rgb/") isExist.Rgb? switchToGreen():switchToWhite() } } TagItem{ id:xTag //x:10 // y:160 width: 32 height: 32 label:"X" visible: true z:2 Component.onCompleted: { //console.info(model.index) var isExist = checkInfoRGBX(model.index,"/X/") isExist.X? switchToGreen():switchToWhite() } } } Image { id: deteSingleImage anchors.fill: parent anchors.margins:model.selected?1:0.5; cache: true // 启用缓存(关键优化) asynchronous: true source: model.source + "?t=" + Date.now() // 若需强制刷新,可保留时间戳 fillMode: Image.PreserveAspectCrop // sourceSize.width: parent.width // 限制解码宽度(关键优化) // sourceSize.height: parent.height // 限制解码高度(关键优化) } // 选中遮罩(关键优化:visible直接绑定selected状态) // Rectangle { // id: selectMask // width: parent.width // height: parent.height // color: "#00FF00" // opacity: 0.3 // visible: rect1.selected // 单张图独立控制可见性 // } MouseArea { id:mouseArea1 anchors.fill: parent property int clickInterval: 500 // 延长双击间隔(可选优化) property int lastClickIndex: -1 // 录上次点击的索引 property int lastClickTime: 0 // 录上次点击时间 onClicked: { var now = Date.now() if (lastClickIndex !== model.index && (now - lastClickTime) < clickInterval) { mouse.accepted = true } else { // 修改选中状态 selected = model.selected imageModel.setProperty(model.index, "selected", !model.selected) } lastClickIndex = model.index lastClickTime = now //timer3.restart() rect1.changeStatus(selected) // 强制触发rect1重绘(关键修复) deleItem.update() // 触发当前delegate的重绘 //scrollToTop() //updateSelection() } onDoubleClicked: { // 仅当两次点击目标相同时触发双击(关键修复) if (lastClickIndex === model.index) { photoRect.sendImagsSig(model.index,model.source) } } // onDoubleClicked: { // photoRect.sendImagsSig(model.index) // 传递ListModel中的索引 // console.log("onDoubleClicked****************************") // } // onClicked: { // // 关键优化4:通过ListModel的setProperty修改属性(触发局部刷新) // imageModel.setProperty(model.index, "selected", !model.selected) // } } Component.onCompleted: { rect1.changeStatus.connect(rect1.changeStatusFun)//Yun } } } ScrollBar.vertical: ScrollBar { width: 20 active: true interactive: true } } } // PinchArea { // id: pinchArea // anchors.fill: parent // // 允许缩放(默认已启用,可显式设置) // enabled: true // // 最小/最大缩放限制(可选) // pinch.minimumScale: 0.5 // 最小缩放比例 // pinch.maximumScale: 3 // 最大缩放比例 // // 手势更新时触发 // onPinchUpdated: { // // 当前双指缩放比例(相对于手势开始时的比例) // var currentScale = pinchArea.scale // console.log("当前缩放比例:", currentScale) // // 同步更新目标元素的缩放 // pRect.itemScale = currentScale // } // } // // 新增:双指缩放手势检测区域 // PinchArea { // id: pinchArea // anchors.fill: parent // 覆盖整个 GridView 区域 // property real baseScale: 1.0 // 手势起始时的基准缩放值 // onPinchStarted: { // baseScale = scale // 录手势开始时的初始缩放值 // pRect.baseCellWidth = pRect.currentCellWidth // 录手势开始时的基准 cellWidth // } // onScaleChanged: { // // 计算缩放比例(当前缩放 / 基准缩放) // var scaleFactor = scale / baseScale // // 动态调整 currentCellWidth(基准宽度 * 缩放比例) // var newCellWidth = pRect.baseCellWidth * scaleFactor // // 限制在 min/max 范围内(确保列数合理) // pRect.currentCellWidth = Math.max(pRect.minCellWidth, Math.min(pRect.maxCellWidth, newCellWidth)) // } // onPinchFinished: { // // 可选:手势结束后,将 cellWidth 对齐到“能整除容器宽度”的值(避免列数边缘留白) // var containerWidth = imageGridView.width // var idealColumns = Math.round(containerWidth / pRect.currentCellWidth) // pRect.currentCellWidth = containerWidth / idealColumns // 强制列数为整数 // } // } // // 新增:平滑过渡动画(优化布局变化体验) // NumberAnimation on currentCellWidth { // duration: 200 // easing.type: Easing.InOutQuad // } } NewImageBtn{ id: delBtn x:1800 y:10 width: 100 height: 100 z:2 text:"" //border.color: "black" // border.width: 3 radius: 10 images:[Theme.deleteDarkChange,"../../../res/images/delete_on.png"]/*{ var arr = new Array; arr.push("../../../res/images/delete_off.png"); arr.push("../../../res/images/delete_on.png"); return arr; }*/ onCurrentIndexChanged: { if(currentIndex === 1) { deleteConfirmDlg.visible = true // 点击显示弹窗 } } } NewImageBtn{ id: addnoteBtn x:1800 y:150 width: 100 height: 100 z:2 text:"" //border.color: "black" // border.width: 3 radius: 10 images:[Theme.addnoteDarkChange,"../../../res/images/addnote_on.png"] // onCurrentIndexChanged: { // if(currentIndex === 1) // { // deleteConfirmDlg.visible = true // 点击显示弹窗 // } // } } // MouseArea{ // id : backArea // height: 50 // width: photoRect.width // anchors.top: photoRect.top // enabled: false // property var firstPosY: 100 // onPressed: { // firstPosY = mouseY // } // onReleased: { // var currentMouseY = mouseY // if(currentMouseY>300&&firstPosY<50) // { // photoRect.backToImageSig() // } // } // } CustomBackDlg { id:toPhotosDlg height: 100 width: 800 x:photoRect.width/2-width/2-91 y:5 normalImage: "../../../res/images/line_off.png" // 未选中时的星星图标 checkedImage: "../../../res/images/back2_on.png" // 选中时的填充星星图标 iconWidth: 64 iconHeight: 64 checked: false // 初始状态 opacity: 1 imageRotaAngle: 0 desc: ""//"ShootingWindow" textUpPos :0 function backToImageAlbum() { photoRect.backToImageSig(); } Component.onCompleted: { toPhotosDlg.backSig.connect(toPhotosDlg.backToImageAlbum) } // id:toPhotosDlg // height: 90 // width: 800 // x:photoRect.width/2-width/2 // y:photoRect.height-toPhotosDlg.height // normalImage: "../../../res/images/back2_off.png" // 未选中时的星星图标 // checkedImage: "../../../res/images/back2_on.png" // 选中时的填充星星图标 // iconWidth: 64 // iconHeight: 64 // checked: false // 初始状态 // opacity: 1 // imageRotaAngle: 180 // desc: "ShootingWindow" // textUpPos :1 // function backToImageAlbum() // { // photoRect.backToImageSig(); // //console.log("backToPhotoAlbum") // } // Component.onCompleted: { // toPhotosDlg.backSig.connect(toPhotosDlg.backToImageAlbum) // // toPhotosDlg.backSig.connect(imageArea.showDetecSig) // } } Component.onCompleted: { photoRect.updateImagsSig(); infoHandle.refreshPhotoAblumSignal.connect(photoRect.deleteImage) } // 新增:控制滚动到顶部的函数 function scrollToTop() { imageGridView.contentY = 0; // 设置垂直滚动偏移量为0(回到顶部) } // 重置选中状态(优化为遍历ListModel) function resetSelection() { for (var i = 0; i < imageModel.count; i++) { imageModel.setProperty(i, "selected", false) } } function updateSelection() {//Yun for (var i = 0; i < imageModel.count; i++) { if(imageModel.get(i).selected) { imageModel.setProperty(i, "selected", false) imageModel.setProperty(i, "selected", true) console.log(i,imageModel.get(i).selected) } } } // 删除选中项(优化为反向遍历ListModel) function deleteSelectedImages() { // 反向遍历避免索引错乱(ListModel删除后索引自动调整) var rest = true for (var i = imageModel.count - 1; i >= 0; i--) { if (imageModel.get(i).selected) { console.log(imageModel.get(i).source) rest &= deleteFiles(imageModel.get(i).source) if(rest) imageModel.remove(i) else return rest } } return rest } // 删除指定名称的文件 function deleteFiles(filePath) { console.log(filePath) var fileInfo = splitFilePath(filePath) //console.log("=================") //console.log(fileInfo.directory) //console.log(fileInfo.fileName) var result = fileManage.deleteFilesWithName(fileInfo.directory, fileInfo.fileName); if (result) { console.log("Files deleted successfully"); } else { console.log("Some files failed to delete"); } return result } function setImages(values) { imageModel.clear(); // 清空原有数据 if (!values || !Array.isArray(values)/*||(rgbPhoto.length!==values.length)*/) { return; } // 遍历数组并添加元素到ListModel for (var i = 0; i < values.length; i++) { var path = values[i]; if (typeof path === "string") { imageModel.append({ // 向ListModel添加元素(自动触发模型更新) source: path, selected: false, //selected: false }); } } } function deleteImage(value) { // 反向遍历避免索引错乱(ListModel删除后索引自动调整) for (var i = imageModel.count - 1; i >= 0; i--) { if (imageModel.get(i).source.indexOf(value) !== -1) { imageModel.remove(i) } } } // 分离路径的函数 function splitFilePath(filePath) { if (!filePath) return { directory: "", fileName : "" }; var path = filePath.toString(); if (path.startsWith("file:///")) { path = path.substring(8); // 移除 file:/// } else if (path.startsWith("file://")) { path = path.substring(7); // 移除 file:// } // 找到最后一个斜杠或反斜杠的位置 var lastSlash = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\")); if (lastSlash === -1) { return { directory: "", fileName : path }; } return { directory: getParentDirectory(path), fileName : getFileNameWithoutExtension(path.substring(lastSlash + 1)) }; } // 获取文件扩展名 function getFileExtension(fileName) { var lastDot = fileName.lastIndexOf("."); if (lastDot === -1) return ""; return fileName.substring(lastDot + 1); } // 获取不带扩展名的文件名 function getFileNameWithoutExtension(fileName) { var lastDot = fileName.lastIndexOf("."); if (lastDot === -1) return fileName; return fileName.substring(0, lastDot); } // 获取父级目录(倒数第二个斜杠前的内容) function getParentDirectory(filePath) { if (!filePath) return ""; // 标准化路径 var path = normalizePath(filePath.toString()); // 找到所有斜杠和反斜杠的位置 var slashPositions = []; for (var i = 0; i < path.length; i++) { if (path[i] === '/' || path[i] === '\\') { slashPositions.push(i); } } // 如果没有斜杠或只有一个斜杠,返回空字符串 if (slashPositions.length < 2) { return ""; } // 获取倒数第二个斜杠的位置 var secondLastSlash = slashPositions[slashPositions.length - 2]; return path.substring(0, secondLastSlash + 1); } function normalizePath(path) { if (path.startsWith("file:///")) { return path.substring(8); } else if (path.startsWith("file://")) { return path.substring(7); } else if (path.startsWith("qrc:/")) { return path.substring(4); } return path; } function checkInfoRGBX(i,dir) { var filePath = imageModel.get(i).source var parentPath = getParentDirectory(filePath) var fileName = splitFilePath(filePath).fileName if(dir === "/Info/") fileName += ".txt"// need confirm else if(dir === "/Rgb/") fileName += ".jpg" // need confirm else if(dir === "/X/") fileName += ".x"// need confirm //console.info(parentPath+dir+fileName) return { Info: fileManage.isFileExist(parentPath+dir+fileName), Rgb: fileManage.isFileExist(parentPath+dir+fileName), X: fileManage.isFileExist(parentPath+dir+fileName) }; } // Component to add more functionalities (like back button, etc.) can be added here } 如何在Linux环境下,利用QT5.6的QML实现imageGridView内每个元素的缩放,通过双指缩放,但是不能与imageGridView内元素的MouseArea事件冲突
09-30
<think>好的,我现在需要解决用户的问题:如何在Linux环境下使用Qt 5.6的QML实现imageGridView内每个元素的缩放,通过双指缩放,并且不能与imageGridView内元素的MouseArea事件冲突。首先,我得仔细分析用户提供的代码,看看现有的结构以及可能的问题所在。 用户提供的代码中有一个PinchArea的注释部分,看起来之前尝试过实现缩放功能,但被注释掉了。现在需要重新启用并调整它,确保双指缩放和MouseArea的点击事件不冲突。首先,我需要理解PinchArea和MouseArea之间的交互机制。在QML中,手势操作如PinchArea和MouseArea可能会有事件竞争,导致其中一个无法正常工作。因此,需要正确配置它们的优先级或处理方式。 首先,用户提到的imageGridView是一个GridView,里面每个delegate都有一个MouseArea处理点击和双击事件。当启用PinchArea进行双指缩放时,需要确保PinchArea不会拦截MouseArea的事件。通常,PinchArea应该覆盖整个需要处理缩放的区域,而MouseArea处理单点事件。但如何让两者共存而不冲突呢? 根据Qt的文档,PinchArea和MouseArea可以通过设置属性来协调事件处理。例如,PinchArea有一个属性叫`propagateComposedEvents`,如果设置为true,当PinchArea处理完事件后,事件会继续传递给子元素的MouseArea。这可能是一个关键点。此外,还需要确保PinchArea和MouseArea的事件类型不冲突,比如双指操作由PinchArea处理,而单点操作由MouseArea处理。 接下来,用户希望缩放的是imageGridView内的每个元素,而不仅仅是整个视图。不过,根据用户提供的代码,当前的PinchArea是覆盖整个pRect(即主容器),这可能意味着缩放整个GridView的内容,而不是单个元素。但用户的需求是每个元素的缩放,这可能需要不同的处理方式,比如在每个delegate内部添加PinchArea来处理缩放,但这样可能会影响性能,尤其是在元素较多的情况下。 或者,用户可能希望整个GridView的缩放,从而影响每个元素的显示大小。此时,需要调整GridView的cellWidth和cellHeight属性,通过PinchArea的缩放比例来动态改变这些值。用户现有的代码中有相关的属性如currentCellWidth、baseCellWidth等,这可能用于调整单元格的大小,从而实现缩放效果。 现在的问题是如何将PinchArea的缩放与这些属性结合起来,并确保MouseArea的点击事件不受影响。例如,当用户用双指缩放时,PinchArea处理事件,而单指操作则由MouseArea处理。可能需要将PinchArea放在一个合适的层级,覆盖整个GridView区域,但允许子元素的MouseArea处理单点事件。 另外,需要注意在Qt 5.6中,QML的PinchArea和MouseArea的事件处理机制是否有特定限制或已知问题。例如,在旧版本中可能存在手势识别的延迟或冲突,需要调整事件的传递顺序。 可能的解决方案步骤: 1. 启用并正确配置PinchArea,使其覆盖整个imageGridView区域,处理双指缩放。 2. 设置PinchArea的`propagateComposedEvents`为true,允许事件传递到子元素的MouseArea。 3. 在PinchArea的onPinchUpdated中调整currentCellWidth,从而动态改变GridView的cell大小。 4. 确保MouseArea的onClicked和onDoubleClicked事件仅在非缩放状态下触发,可能需要检查PinchArea是否处于活动状态。 5. 测试并调试事件冲突,确保双指缩放和单指点击互不干扰。 具体到代码层面,用户提供的注释部分有一个PinchArea,需要将其取消注释,并调整相关属性。例如: - 设置PinchArea的anchors.fill为imageGridView,确保覆盖正确的区域。 - 在onPinchStarted中录初始缩放比例和基准单元格宽度。 - 在onPinchUpdated中根据当前缩放比例调整currentCellWidth,限制在最小和最大值之间。 - 在onPinchFinished中可能调整cellWidth以保持整数列,避免布局错乱。 - 在MouseArea的onClicked中检查PinchArea是否处于active状态,如果是则忽略点击事件,防止冲突。 此外,可能需要调整delegate中的MouseArea的属性,例如设置`accepted: false`或`enabled: !pinchArea.active`,以在缩放时禁用点击事件,避免误触。 还需要考虑动画效果,如NumberAnimation来平滑缩放过程,提升用户体验。 最后,测试在Linux环境下Qt 5.6对PinchArea的支持情况,确保没有版本相关的bug。可能需要查阅Qt 5.6的文档或社区资源,确认PinchArea和MouseArea的兼容性。 </think>在Qt 5.6的QML中实现双指缩放且避免与MouseArea冲突,可通过以下方式: ```qml // 取消注释并调整PinchArea PinchArea { id: pinchArea anchors.fill: imageGridView // 精准覆盖GridView区域 propagateComposedEvents: true // 关键:允许事件传递给子MouseArea // 设置最小/最大缩放限制 minimumScale: 0.5 maximumScale: 3 onPinchStarted: { baseScale = pinch.scale // 录初始缩放比例 pRect.baseCellWidth = pRect.currentCellWidth // 录基准单元格宽度 } onPinchUpdated: { // 计算动态缩放比例 var scaleFactor = pinch.scale / baseScale var newCellWidth = pRect.baseCellWidth * scaleFactor // 限制在合理范围内 pRect.currentCellWidth = Math.max( pRect.minCellWidth, Math.min(pRect.maxCellWidth, newCellWidth) ) } onPinchFinished: { // 优化列数对齐(可选) var containerWidth = imageGridView.width var idealColumns = Math.round(containerWidth / pRect.currentCellWidth) pRect.currentCellWidth = containerWidth / idealColumns } } // 修改MouseArea逻辑(在delegate中) MouseArea { // 新增:检查PinchArea状态 enabled: !pinchArea.active // 缩放时禁用点击 accepted: false // 显式允许事件传递 onClicked: { if (!pinchArea.active) { // 原有点击逻辑 imageModel.setProperty(model.index, "selected", !model.selected) } } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值