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

独立网站运营seo黑帽技术工具

独立网站运营,seo黑帽技术工具,一个网站的制作过程,做个有用网站目录 一、属性绑定1、直接绑定 property01: property02实例代码 2、条件绑定 Qt.binding实例代码 二、信号传递1、on<Property>Changed实例代码 2、on<Signal>实例代码 3、条件信号传递 connect实例代码 4、Connections 一、属性绑定 属性绑定具有持续性 1、直接…

目录

  • 一、属性绑定
    • 1、直接绑定 property01: property02
      • 实例
      • 代码
    • 2、条件绑定 Qt.binding
      • 实例
      • 代码
  • 二、信号传递
    • 1、on<Property>Changed
      • 实例
      • 代码
    • 2、on<Signal>
      • 实例
      • 代码
    • 3、条件信号传递 connect
      • 实例
      • 代码
    • 4、Connections

一、属性绑定

属性绑定具有持续性

1、直接绑定 property01: property02

在组件初始化后,一直绑定
子界面可以直接调用父界面的全部组件/属性

实例

在这里插入图片描述

代码

// 父界面
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 1.4ColumnLayout {anchors.fill: parentRectangle {id: rootRecLayout.fillWidth: trueLayout.preferredHeight: Math.round(parent.height / 5)color: "gray"opacity: 0.5Text {id: rootRecSizetext: rootRec.width + " * " + rootRec.heightfont.pixelSize: 22anchors.centerIn: parent}}// 子界面SecondPane {Layout.alignment: Qt.AlignHCenterLayout.topMargin: 50Layout.fillWidth: trueLayout.preferredHeight: 80}
}
// 子界面
import QtQuick 2.15
import QtQuick.Controls 1.4TextField {id: secondText// 内部明确size, 便于预览效果,   实际size在调用处再次设置width: 200// 子界面可以直接调用父界面的组件text: "second call root:  " + rootRecSize.textfont.pixelSize: 20horizontalAlignment: Qt.AlignHCenterverticalAlignment: Qt.AlignVCenter
}

2、条件绑定 Qt.binding

满足某些条件时,才进行绑定动作。
如果绑定时,组件还未初始化完成,绑定动作会失效。

实例

点击方框后,才开始属性绑定
在这里插入图片描述

代码

// 父界面
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 1.4ColumnLayout {anchors.fill: parentRectangle {id: rootRecLayout.fillWidth: trueLayout.preferredHeight: Math.round(parent.height / 3)color: "gray"opacity: 0.5Text {id: rootRecSizetext: rootRec.width + " * " + rootRec.heightfont.pixelSize: 22anchors.centerIn: parent}}// 子界面SecondPane {id: secondPaneLayout.alignment: Qt.AlignHCenterLayout.topMargin: 50Layout.fillWidth: trueLayout.preferredHeight: 80MouseArea {anchors.fill: parentonClicked: {// 单次赋值,不具备持续性
//                secondPane.text = rootRecSize.textsecondPane.text = Qt.binding(function() {return rootRecSize.text})}}}
}
// 子界面
import QtQuick 2.15
import QtQuick.Controls 1.4TextField {id: secondText// 内部明确size, 便于预览效果,   实际size在调用处再次设置width: 200font.pixelSize: 20horizontalAlignment: Qt.AlignHCenterverticalAlignment: Qt.AlignVCenter
}

二、信号传递

1、on<Property>Changed

属性传递分为组件默认属性 和 自定义属性

实例

在这里插入图片描述

代码

//  父界面
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 1.4ColumnLayout {anchors.fill: parentSecondPane {Layout.fillWidth: trueLayout.preferredHeight: Math.round(parent.height / 4)onHeightChanged: { text = "onHeightChanged: " + height }}SecondPane {Layout.fillWidth: trueLayout.preferredHeight: Math.round(parent.height / 4)onAreaChanged: { text = "onAreaChanged: " + area }}
}
// 子界面
import QtQuick 2.15
import QtQuick.Controls 1.4TextField {id: secondTextproperty int area: width * height   // 自定义属性// 内部明确size, 便于预览效果,   实际size在调用处再次设置width: 200height: 80font.pixelSize: 20horizontalAlignment: Qt.AlignHCenterverticalAlignment: Qt.AlignVCenter
}

2、on<Signal>

分为组件默认属性 和 自定义属性

实例

在这里插入图片描述

代码

// 父界面
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 1.4ColumnLayout {anchors.fill: parentRectangle {id: rootRecLayout.fillWidth: trueLayout.preferredHeight: Math.round(parent.height / 4)color: "gray"opacity: 0.5Text {id: rootRecSizetext: rootRec.width + " * " + rootRec.heightfont.pixelSize: 22anchors.centerIn: parent}MouseArea {anchors.fill: parentonWheel: {rootRecSize.text = "default signal"}}}SecondPane {id: pane01Layout.fillWidth: trueLayout.preferredHeight: Math.round(parent.height / 4)onClick: {pane01.text = "自定义信号, 不含参数"}}SecondPane {id: pane02Layout.fillWidth: trueLayout.preferredHeight: Math.round(parent.height / 4)onSigValue: {pane02.text = "自定义信号, 含参数: " + loX + "*" + loY}}
}
// 子界面
import QtQuick 2.15
import QtQuick.Controls 1.4TextField {id: secondText// 自定义信号signal click()signal sigValue(int loX, int loY)width: 200height: 80font.pixelSize: 20horizontalAlignment: Qt.AlignHCenterverticalAlignment: Qt.AlignVCenterMouseArea {anchors.fill: parentonClicked:  {secondText.click()secondText.sigValue(mouseX, mouseY)}}
}

3、条件信号传递 connect

上述 on<Property>Changed 和 on<Signal> 都是属于无条件的信号传递。响应信号的代码都放在元素内部,通过JS代码块就地实现。
如果需要在某些条件下才建立信号机制,则使用connect。

实例

点击”start“按钮之前,任何信号都不会出发
点击之后, 开始建立信号机制
在这里插入图片描述

代码

import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 1.4ColumnLayout {anchors.fill: parentRectangle {id: rootRecLayout.fillWidth: trueLayout.preferredHeight: 50color: "green"opacity: 0.5Text {id: rootRecSizetext: "start"font.pixelSize: 22anchors.centerIn: parent}MouseArea {id: mouseAreaanchors.fill: parentonClicked: {rootRec.opacity = 0.2// 开始建立信号连接机制pane01.click.connect(slotNone)              // 无参数信号pane02.sigValue.connect(slotPara)           // 有参数信号pane03.heightChanged.connect(slotProperty)  // 属性信号}}}SecondPane {id: pane01Layout.alignment: Qt.AlignHCenter}SecondPane {id: pane02Layout.alignment: Qt.AlignHCenter}SecondPane {id: pane03Layout.alignment: Qt.AlignHCenterLayout.preferredHeight: parent.height / 4}function slotNone(){pane01.text = "slotNone"}function slotPara(a){pane02.text = "slotPara: " + a}function slotProperty(){pane03.text = "slotProperty" + pane03.height}
}
import QtQuick 2.15
import QtQuick.Controls 1.4TextField {id: secondTextproperty int area: width * heightsignal click()signal sigValue(int loX)// 内部明确size, 便于预览效果,   实际size在调用处再次设置width: 200height: 60font.pixelSize: 20horizontalAlignment: Qt.AlignHCenterverticalAlignment: Qt.AlignVCenterMouseArea {anchors.fill: parentonClicked:  {secondText.click()secondText.sigValue(mouseX)}}
}

4、Connections

Connections的优点主要有以下3个:

  • List item
  • 将多个对象连接到同一个QML信号上
  • 在发出信号的对象的作用域之外来建立连接 (条件信号传递)
    发射信号的对象是C++

前两条,connect具有同样的效果。

MouseArea {id: area
}Connections {target: areafunction onClicked(mouse) { foo(mouse) }
}
http://www.dinnco.com/news/51763.html

相关文章:

  • 网站建设技巧网页制作成品
  • 阿里巴巴做网站找谁外贸营销网站
  • 政府网站建设困难惠州seo关键词推广
  • wordpress机械主题谷歌seo外链平台
  • 珠海做网站哪家好网站定制开发
  • 河南省住房和建设厅网站济南网络优化网址
  • asp做企业网站很好啊网站推广与优化方案
  • 丰镇市网站站内关键词排名优化软件
  • 网站开发人员没有按照设计开发成都百度推广电话号码是多少
  • 政府信息网站建设对策怎么做线上销售
  • 深圳专业网站建设公司排名北京seo顾问服务
  • 一下成都网站建设公司怎么免费建个人网站
  • 可以做锚文本链接的网站西安网络推广外包公司
  • 怎么做网络销售的网站湖南株洲疫情最新情况
  • 公司建网站几天可以网站浏览器
  • 影视网站怎么做app百度指数官网查询
  • 网站是谁做的代写
  • 阿里云静态网站托管百度指数网页版
  • 南澳做网站百度手机端排名如何优化
  • wordpress 中文标题 404网站的优化与推广分析
  • 摄影网站设计实现步骤自动推广工具
  • 做悬赏任务的网站自己如何制作一个小程序
  • 汕头选择免费网站优化每日新闻摘抄10一15字
  • 南京网站开发培训百度收录教程
  • 做黎川旅游网站的目的微信推广方法
  • 网站建设的快乐唐山seo排名优化
  • 更加精准高效的措施河源市seo点击排名软件价格
  • 营销网站制作流程seo刷排名工具
  • 网站设计 扁平化接广告赚钱的平台
  • 网站技术方案说明好看的html网页