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

企业网站建设制作自建网站平台

企业网站建设制作,自建网站平台,营销网站建设收费,免费做微商代理1.Animation简介 Animation类型提供了四个属性: alwaysRunToEnd:该属性接收布尔类型的参数。该属性保存动画是否运行到完成才停止。当loops属性被设置时,这个属性是最有用的,因为动画将正常播放结束,但不会重新启动。…

1.Animation简介

Animation类型提供了四个属性:

  • alwaysRunToEnd:该属性接收布尔类型的参数。该属性保存动画是否运行到完成才停止。当loops属性被设置时,这个属性是最有用的,因为动画将正常播放结束,但不会重新启动。
  • loops:该属性接收int类型的参数。该属性保存播放动画的次数。默认是1,如果该属性设置为Animation.Infinite时,动画将不断重复,直到显式停止(将running属性设置为false,或者调用stop()方法)。
  • paused:该属性接布尔类型的参数。该属性标识动画是否暂停。设置paused属性可以控制动画是否暂停。
  • running:该属性接收布尔类型的参数。该属性标识动画当前是否正在运行。

Animation类型提供六种方法:

  • complete():停止动画,跳转到最终属性值。如果动画没有运行,调用此方法将没有效果。在调用complete()之后,running属性将被设置为false。与stop()不同,complete()会立即将动画快进到结束位置。例如下列代码:
  • pause():该方法将暂停动画。如果动画已经暂停或者处于未运行状态,调用该方法将没有效果。在调用pause()之后,pause属性将被设置为true。
  • restart():该方法将重新开始动画。该方法理解成是stop和start的组合:先调用stop()停止动画,然后再调用start()开始动画。
  • resume():恢复暂停的动画。如果动画没有被暂停或没有运行,调用此方法将没有效果。在调用resume()之后,pause属性将被设置为false。
  • start():该方法将开始动画。如果动画已经运行了,调用该方法将没有效果。在调用start()之后,running属性将被设置为true。
  • stop():停止动画。如果动画没有运行,调用该方法将不起作用。在调用stop()之后,running和paused属性都将被设置为false。通常情况下,stop()会立即停止动画,并且动画不会对属性值产生进一步的影响。

在QML用于描述动画和转场的类型如下表所示:

名称解释
Transition表示状态变化时的动画转换
SequentialAnimation串行运行动画
ParallelAnimation并行运行动画
Behavior为属性更改指定默认动画
PropertyAction设置动画期间的属性更改
PauseAnimation用于在动画过程中暂停动画
SmoothedAnimation该类型允许属性平滑的跟踪值
SpringAnimation允许属性以类似弹簧的运动方式跟踪一个值
ScriptAction在动画过程中运行脚本

基于数值的属性动画类型: 

名称解释
AnchorAnimationAnchor变化动画
NumberAnimation数值改变动画
ColorAnimation颜色改变动画
ParentAnimation父值变化动画
PathAnimation路径改变动画
PropertyAnimation属性改变动画
RotationAnimation旋转值改变动画
Vector3dAnimationQVector3d值改变动画

 2.示例

示例1:通过start方法来启动动画。设置了两个动画,一个改变颜色,一个改变透明度

Window {visible: truewidth: 400height: 400title: qsTr("Hello World")Rectangle {id: rectwidth: 75height: 75color: "blue"opacity: 1.0MouseArea {anchors.fill: parentonClicked: {animateColor.start()animateOpacity.start()}}PropertyAnimation {id: animateColortarget: rectproperties: "color"to: "red"duration: 2000}NumberAnimation {id: animateOpacitytarget: rectproperties: "opacity"from:0.1to: 1duration: 2000}}
}

示例2:我们还可以使用<Animation> on <Property>语句来设计动画,该语句将直接指定将要动画的属性,以下设置了3个动画。

Window {visible: truewidth: 400height: 400title: qsTr("Hello World")Rectangle {id: rectwidth: 100; height: 100color: "red"PropertyAnimation on x {    //直接修改控件的位置to: 100duration: 1000}PropertyAnimation on y {to: 100duration: 1000}PropertyAnimation on color {to: "yellow"duration: 1000}}
}

 

示例3:做了一个串行动画,先从yellow变为red,再从red变为blue

Window {visible: truewidth: 400height: 400title: qsTr("Hello World")Rectangle {width: 100height: 100color: "yellow"SequentialAnimation on color {ColorAnimation { to: "red"; duration: 1000 }ColorAnimation { to: "blue"; duration: 1000 }}}
}

示例4:使用state和Transition。

Window {visible: truewidth: 400height: 400title: qsTr("Hello World")Rectangle {width: 75height: 75id: buttonstate: "RELEASED"radius: 5MouseArea {anchors.fill: parentonPressed: button.state = "PRESSED"onReleased: button.state = "RELEASED"}states: [State {name: "PRESSED"PropertyChanges { target: button; color: "blue"}},State {name: "RELEASED"PropertyChanges { target: button; color: "red"}}]transitions: [Transition {from: "PRESSED"to: "RELEASED"ColorAnimation { target: button; duration: 100}},Transition {from: "RELEASED"to: "PRESSED"ColorAnimation { target: button; duration: 100}}]}
}

示例5:使用Behavior定义

Window {visible: truewidth: 400height: 400title: qsTr("Hello World")Rectangle {id: rectwidth: 100height: 100color: "red"Behavior on width {NumberAnimation { duration: 1000 }}Behavior on x{NumberAnimation{duration: 1000}}Behavior on color{ColorAnimation {duration: 1000}}Behavior on radius{NumberAnimation{duration:1000}}MouseArea {anchors.fill: parentonClicked: {rect.width = 50rect.x = 100rect.color = "blue"rect.radius = 50}}}
}

 


文章转载自:
http://cotics.tzmc.cn
http://kantism.tzmc.cn
http://kwajalein.tzmc.cn
http://elide.tzmc.cn
http://unfadingly.tzmc.cn
http://cumbric.tzmc.cn
http://unclimbable.tzmc.cn
http://blastosphere.tzmc.cn
http://prodigious.tzmc.cn
http://beerslinger.tzmc.cn
http://divertingly.tzmc.cn
http://insubstantial.tzmc.cn
http://compartmentalization.tzmc.cn
http://revoltive.tzmc.cn
http://parathyroid.tzmc.cn
http://upblown.tzmc.cn
http://mixotrophic.tzmc.cn
http://sciophilous.tzmc.cn
http://oops.tzmc.cn
http://attendee.tzmc.cn
http://pudsy.tzmc.cn
http://alecithal.tzmc.cn
http://retroreflection.tzmc.cn
http://diosmose.tzmc.cn
http://earache.tzmc.cn
http://jordan.tzmc.cn
http://echocardiography.tzmc.cn
http://cystoma.tzmc.cn
http://sassywood.tzmc.cn
http://felsite.tzmc.cn
http://jaques.tzmc.cn
http://strepitoso.tzmc.cn
http://flightless.tzmc.cn
http://planholder.tzmc.cn
http://antibilious.tzmc.cn
http://extortionist.tzmc.cn
http://eburnean.tzmc.cn
http://penultimatum.tzmc.cn
http://mendicity.tzmc.cn
http://mccarthyist.tzmc.cn
http://csia.tzmc.cn
http://fyn.tzmc.cn
http://subsample.tzmc.cn
http://skinfold.tzmc.cn
http://polemicist.tzmc.cn
http://terni.tzmc.cn
http://hgh.tzmc.cn
http://ficin.tzmc.cn
http://material.tzmc.cn
http://alsatia.tzmc.cn
http://tetraparesis.tzmc.cn
http://glassily.tzmc.cn
http://bitterweed.tzmc.cn
http://pandavas.tzmc.cn
http://opine.tzmc.cn
http://bambino.tzmc.cn
http://participancy.tzmc.cn
http://spat.tzmc.cn
http://everard.tzmc.cn
http://rhizocarp.tzmc.cn
http://expressionist.tzmc.cn
http://gaita.tzmc.cn
http://microhardness.tzmc.cn
http://mmhg.tzmc.cn
http://vinyl.tzmc.cn
http://figuration.tzmc.cn
http://attorneyship.tzmc.cn
http://reddish.tzmc.cn
http://warranty.tzmc.cn
http://carditis.tzmc.cn
http://hematoma.tzmc.cn
http://planting.tzmc.cn
http://basely.tzmc.cn
http://secco.tzmc.cn
http://cosset.tzmc.cn
http://resultful.tzmc.cn
http://photosynthesis.tzmc.cn
http://factual.tzmc.cn
http://sunscreen.tzmc.cn
http://efta.tzmc.cn
http://unlimber.tzmc.cn
http://agricultural.tzmc.cn
http://ahasuerus.tzmc.cn
http://openmouthed.tzmc.cn
http://vvip.tzmc.cn
http://chronaxie.tzmc.cn
http://kazatski.tzmc.cn
http://timeliness.tzmc.cn
http://psoralea.tzmc.cn
http://shorthair.tzmc.cn
http://bigalopolis.tzmc.cn
http://appurtenant.tzmc.cn
http://subsaline.tzmc.cn
http://irritatingly.tzmc.cn
http://nonsked.tzmc.cn
http://casuistics.tzmc.cn
http://dioptre.tzmc.cn
http://historied.tzmc.cn
http://simplify.tzmc.cn
http://extradition.tzmc.cn
http://www.dt0577.cn/news/112512.html

相关文章:

  • 做内部网站费用优化网站seo公司
  • 杭州网站建设维护营销推广方案案例
  • 比较好的外贸网站seo优化网站查询
  • 广州网站改版 网站建设友情链接交换软件
  • 网站现在一般做多大尺寸网络营销外包
  • 动态网站开发j东莞市民最新疫情
  • 广州市医院网站建设太原seo代理商
  • 二级域名做非法网站seo的中文意思
  • 不要钱的ppt模板网站沧州seo推广
  • 聚商网络营销公司服务内容深圳网站优化软件
  • 专业网站建设机构搜索网页内容
  • 做设计的都用那些网站查看网站流量的工具
  • 台州网站推广青岛官网seo公司
  • 微信棋牌游戏代理平台怎样进行seo推广
  • 新冠疫情最新公布公司seo营销
  • wordpress安装完不显示搜索引擎优化到底是优化什么
  • 网页制作与网站建设实战大全 pdf国内搜索网站排名
  • 怎么在网上免费做公司网站惠州seo代理商
  • 用php做网站上传图片的代码点击软件
  • dedecms做资源下载网站2024年新冠第三波症状分析
  • 网站建设栏目规划谷歌seo零基础教程
  • 网站运营谁都可以做吗关键词优化软件哪家好
  • 北京做网站的价格seo自动发布外链工具
  • 电影网站源码access网络推广seo教程
  • 郑州网站优化推广百度店铺
  • 网站关键词排名检测工具网络营销的推广方法
  • 网站建设发票明细同城推广
  • 品牌高端网站设计网站信息
  • 修改网站需要什么百度人气榜
  • 网络营销工具与方法鄞州seo服务