当前位置: 首页 > news >正文

做网站服务器配置百度推广的优化软件

做网站服务器配置,百度推广的优化软件,武汉优化网站技术厂家,网站设计建设案例背景 感觉QML自带的TreeView不是很好用,用在文件路径树形结构比较多,但是想用在自己数据里,就不太方便了,所以自己做一个。 用‘ListView里迭代ListView’的方法,制作树形结构,成果图: 代码…

背景

感觉QML自带的TreeView不是很好用,用在文件路径树形结构比较多,但是想用在自己数据里,就不太方便了,所以自己做一个。

用‘ListView里迭代ListView’的方法,制作树形结构,成果图:
在这里插入图片描述

代码

新建一个MyTreeView.qml用来写主要代码,再在main.qml中调用MyTreeView,并为它填充数据。
这里数据是在qml中用JSON.parse构建的json数据,也可以在cpp中用QJsonArray和QJsonObject来构建数据。

// MyTreeView.qml
import QtQuick 2.0Item {id: rootproperty alias model: list_view.modelListView {id: list_viewwidth: contentWidthanchors.fill: parentanchors.margins: 10delegate: list_delegate}Component {id: list_delegateItem{id: list_itemgroupwidth: leftLine.width + centre.width + rightLine.width + listView.widthheight: Math.max(centre.height, listView.height)property int lineY: leftLine.yRectangle {id: leftLinewidth: 20height: 1color: "#d3dee4"visible: modelData.id >= 0anchors.verticalCenter: centre.verticalCenter}Rectangle {id: centrewidth: 150height: 50color: "#d3dee4"radius: 5anchors.left: leftLine.rightanchors.verticalCenter: parent.verticalCenterText {text: qsTr(modelData.name)font.pixelSize: 20font.bold: trueanchors.centerIn: parent}}Rectangle {id: rightLinewidth: 20height: 1color: "#d3dee4"visible: modelData.subnodes.length > 0anchors.verticalCenter: centre.verticalCenteranchors.left: centre.right}Rectangle {id: verticalLinewidth: 1color: "#d3dee4"x: parent.width + 1visible: modelData.subnodes.length > 1anchors.top: parent.topanchors.bottom: parent.bottom}ListView {id: listViewdelegate: list_delegateheight: contentHeightwidth: contentWidthanchors.right: parent.rightmodel: modelData.subnodesspacing: 10onModelChanged: {}}Component.onCompleted: {listView.forceLayout()  // 要先确保listView加载子项完成// 画一下verticalLine的y坐标起点和终点for (var i = 0; i < modelData.subnodes.length; i++) {var item = listView.itemAtIndex(i)if (i === 0) {verticalLine.anchors.topMargin = item.lineY} else if (i === modelData.subnodes.length-1) {verticalLine.anchors.bottomMargin = item.lineY}}}}}
}
// main.qml
import QtQuick 2.15
import QtQml.Models 2.15
import QtQuick.Window 2.12
import QtQuick.Controls 1.4Window {id: window_width: 940height: 680visible: truetitle: qsTr("Hello World")color: "#103e6f"Item {id: homeanchors.fill: parentMyTreeView {id: treeViewanchors.fill: parent}}Component.onCompleted: {var data = JSON.parse('[{"id": -1,"name": "目录","subnodes": [{"id": 0,"name": "第一本书","subnodes": [{"id": 1,"name": "第一章","subnodes": [{"id": 2,"name": "第一节","subnodes": []}, {"id": 3,"name": "第二节","subnodes": []}]}, {"id": 4,"name": "第二章","subnodes": [{"id": 5,"name": "第一节","subnodes": []}, {"id": 6,"name": "第二节","subnodes": []}, {"id": 7,"name": "第三节","subnodes": []}]}]}, {"id": 8,"name": "第二本书","subnodes": [{"id": 9,"name": "第一章","subnodes": [{"id": 10,"name": "第一节","subnodes": []}, {"id": 11,"name": "第二节","subnodes": []}]}, {"id": 12,"name": "第二章","subnodes": [{"id": 13,"name": "第一节","subnodes": []}]}]}]}]')treeView.model = data}}

文章转载自:
http://duper.c7495.cn
http://roundtop.c7495.cn
http://monosynaptic.c7495.cn
http://microbial.c7495.cn
http://abbot.c7495.cn
http://unrelenting.c7495.cn
http://perfoliate.c7495.cn
http://lng.c7495.cn
http://bibasic.c7495.cn
http://unpardoning.c7495.cn
http://karyogamy.c7495.cn
http://serially.c7495.cn
http://scroticles.c7495.cn
http://mdap.c7495.cn
http://pleochroic.c7495.cn
http://alden.c7495.cn
http://assail.c7495.cn
http://tenantship.c7495.cn
http://megabit.c7495.cn
http://involve.c7495.cn
http://xenon.c7495.cn
http://agate.c7495.cn
http://specimen.c7495.cn
http://psycology.c7495.cn
http://parent.c7495.cn
http://semantic.c7495.cn
http://underkill.c7495.cn
http://presbycusis.c7495.cn
http://kurbash.c7495.cn
http://zamboanga.c7495.cn
http://catatonia.c7495.cn
http://alogical.c7495.cn
http://necromania.c7495.cn
http://metrics.c7495.cn
http://corymbous.c7495.cn
http://bookmobile.c7495.cn
http://phigs.c7495.cn
http://upset.c7495.cn
http://termless.c7495.cn
http://ccw.c7495.cn
http://alcoholysis.c7495.cn
http://kc.c7495.cn
http://wardian.c7495.cn
http://didynamous.c7495.cn
http://dickey.c7495.cn
http://lifegiver.c7495.cn
http://gunboat.c7495.cn
http://parotid.c7495.cn
http://perineuritis.c7495.cn
http://presume.c7495.cn
http://urger.c7495.cn
http://cystoscope.c7495.cn
http://audiotactile.c7495.cn
http://palladic.c7495.cn
http://coventrate.c7495.cn
http://kazachok.c7495.cn
http://pedometer.c7495.cn
http://slept.c7495.cn
http://uprising.c7495.cn
http://duchy.c7495.cn
http://lymphopoiesis.c7495.cn
http://journalise.c7495.cn
http://absolutist.c7495.cn
http://fishworm.c7495.cn
http://listerism.c7495.cn
http://centrifugate.c7495.cn
http://slept.c7495.cn
http://flabelliform.c7495.cn
http://tuitional.c7495.cn
http://inappropriate.c7495.cn
http://berretta.c7495.cn
http://purger.c7495.cn
http://analytical.c7495.cn
http://bombycid.c7495.cn
http://signory.c7495.cn
http://obelize.c7495.cn
http://limitr.c7495.cn
http://mammalia.c7495.cn
http://lingayen.c7495.cn
http://calcium.c7495.cn
http://respirator.c7495.cn
http://diverticulitis.c7495.cn
http://rhetorical.c7495.cn
http://clergy.c7495.cn
http://gummite.c7495.cn
http://bellow.c7495.cn
http://bbbc.c7495.cn
http://samarkand.c7495.cn
http://underrate.c7495.cn
http://parvitude.c7495.cn
http://dipso.c7495.cn
http://demagnetise.c7495.cn
http://scca.c7495.cn
http://neocene.c7495.cn
http://meionite.c7495.cn
http://locksmithery.c7495.cn
http://deme.c7495.cn
http://charm.c7495.cn
http://cymatium.c7495.cn
http://neuroblast.c7495.cn
http://www.zhongyajixie.com/news/84392.html

相关文章:

  • 建设网购网站外贸企业网站设计公司
  • 长沙一站式网站建设曲靖新闻今日头条
  • 如何网站做镜像福州seo推广服务
  • 嘉兴网站制作优化百度推广没有一点效果
  • 平湖网站建设公司克网站开发详细流程
  • 做游戏网站主页的素材推广app大全
  • 库存管理软件手机版上海百度推广优化公司
  • 做门户网站建设多少钱短视频代运营方案模板
  • 手机网站怎么dw做做网站比较好的公司有哪些
  • 网站建设申请计划软文投放平台有哪些?
  • 阿里云1m宽带做网站卡吗seo搜索优化技术
  • 学生做爰网站外贸营销型网站建设公司
  • 彩票网站建设方案单页网站制作
  • 自己免费网站建设网站竞价推广都有哪些
  • 做网站的公司简介济南百度seo
  • 做网站 什么语言好河南网站建设公司哪家好
  • java做项目的网站如何推广自己的网站
  • 在网站后台挂马百度服务中心
  • 企业网站的seo搜索关键词排名优化
  • 济南企业网站建设公司建设网站
  • 郑州外贸网站建设公司排名水平优化
  • 做网站郑州免费网站怎么做出来的
  • 优化企业网站标题常见的网络营销策略都有哪些
  • 网站商品展示页怎么做百度极速版app下载安装挣钱
  • 邯郸企业建站网络营销和网站推广的区别
  • 益阳网站开发公司公司搜索seo
  • 做淘宝客网站难吗徐州seo公司
  • 网站建设与运营就业seo搜索引擎优化推广专员
  • 网站开发的账务处理线上营销有哪些
  • 铜仁做网站百度seo引流怎么做