2019独角兽企业重金招聘Python工程师标准>>>

controls

import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4Rectangle {color: "green"Button {id:buttontext: qsTr("Second page")anchors.centerIn: parentproperty string url: "qrc:/bg.png"style: ButtonStyle {id:button_stylebackground: Image {id: button_imagesource: button.url}}MouseArea{anchors.fill: parentonPressed: {parent.state = "focus"}onExited: parent.state = "namol"}states: [State {name: "focus"PropertyChanges {target: buttonurl:"qrc:/on.png"}},State {name: "namol"PropertyChanges {target: buttonurl:"qrc:/bg.png"}}]}
}

controls2

import QtQuick 2.7
import QtQuick.Controls 2.0Rectangle {color: "green"Button {id:buttontext: qsTr("Second page")anchors.centerIn: parentproperty string url: "qrc:/bg.png"contentItem: Text {text: button.textfont: button.fontcolor: "black"horizontalAlignment: Text.AlignHCenterverticalAlignment: Text.AlignVCenterelide: Text.ElideRight}background: Image {id: button_imagesource: button.url}MouseArea{anchors.fill: parentonPressed: {parent.state = "focus"}onExited: parent.state = "namol"}states: [State {name: "focus"PropertyChanges {target: buttonurl:"qrc:/on.png"}},State {name: "namol"PropertyChanges {target: buttonurl:"qrc:/bg.png"}}]}}

转载于:https://my.oschina.net/assange/blog/731553

QtQuick controls和controls2 自定义样式相关推荐

  1. QML QtQuick.Controls 2 ScrollBar滚动条样式自定义

    测试版本:Qt5.12及Qt5.15 ,参考Qt源码及文档示例 代码链接:https://github.com/gongjianbo/QmlComponentStyle.git 自定义样式与默认样式的 ...

  2. QtQuick.Controls 2与 QtQuick.Controls的区别和使用

    混合使用 直接在代码中同时调用QtQuick.Controls 2模块和QtQuick.Controls 模块会出错,因为只能识别到一个版本的控件,会出现无法识别QtQuick.Controls 2的 ...

  3. QML 自定义控件Button,采用QtQuick.Controls 1.0和2.0两版本实现

    在开发QtQuick项目时,对于界面上的控件Controls往往会重复使用,单个界面上会有多个同样的Controls.在调用系统Controls库时,往往一些属性,如字体.样式.大小等需要多次去编写, ...

  4. DataGrid中页导航栏的自定义样式

    我们可以利用DataGrid的ItemCreat()方法来实现DataGrid中页脚(Foot)和页导航栏的自定义样式.ItemCreat,顾名思义,就是在数据项创建时发生的事件,对于DataGrid ...

  5. windows phone (12) 小试自定义样式

    windows phone (12) 小试自定义样式 原文:windows phone (12) 小试自定义样式 样式在BS开发中经常用到,在wp中系统也提供了解决办法,就是对设置的样式的一种资源共享 ...

  6. H5 audio 音频标签自定义样式修改以及添加播放控制事件

    20181023 更新 原来的代码拖动进度点只写了mouse事件,手机端的话应该是touch事件.所以出现了有朋友说的移动端无法拖动进度条的问题.现在更新的代码已经加上touch事件,即无论是手机模式 ...

  7. QML之在QtQuick.Controls 2项目中使用QtQuick.Controls模块中的控件

    区别 下面的笔记中将QtQuick.Controls 2简称为qml2,QtQuick.Controls简称为qml1. 最直观的的区别就是qml2的控件及界面风格更加美观,qml2提供了一套谷歌风格 ...

  8. qt qml virtrulKeyBoard custom style 虚拟键盘自定义样式方法

    今天我把纠结了好几天的qml自带的虚拟键盘自定义样式的功能实现了,成功修改键盘的样式颜色. 首先把官网的文档先复制一下, 后面会写我自己的实际操作方法, 英文水平真的很重要!!! Keyboard S ...

  9. android进度条竖条,音频(audio)自定义样式以及控制操作面板

    简介 audio为html5中的新属性.定义声音,比如音乐或者其他的音频流.在ie8(包括)以及更早的版本并不支持. 我的自以为 一直以为自定义样式,就要添加相应的控制js代码,所以是望而却步.此次项 ...

最新文章

  1. 史上最全的ubuntu16.04安装nvidia驱动+cuda9.0+cuDnn7.0
  2. nginx官方模块之http_sub_status_module
  3. 【css】文字溢出,显示省略符号(...)
  4. LeetCode 11盛水最多的容器
  5. 常见的Java开发框架有哪些?
  6. 物联卡与sim卡有什么差别性的不同
  7. 让 list-style-image 图片垂直居中
  8. OUTEROS常用命令
  9. linux搭建邮件服务器
  10. mt6573集成MCP nandflash的详细方法
  11. 从0到1,构建商业分析模型
  12. C2-关于VCF文件合并的几种方法
  13. 2021中国开源年报发布!一篇报告带你读懂中国开源的2021~
  14. gitbook 转换 pdf
  15. 2.css字体 文本属性
  16. 3d卷积神经网络应用,神经网络仿真软件
  17. css如何设置滚动条,设置滚动条需要用到的参数
  18. linux xmapp的安装
  19. Mathcad使用数学表达式
  20. 对朝九晚五的热情到底能持续多久?

热门文章

  1. Java对象的序列化
  2. springboot2——MyBatis入门
  3. 数组精选题目三连(6)
  4. 机器学习中的聚类方法总结
  5. 使用Python作为计算器
  6. sqlite_orm sync_schema源码即翻译
  7. codeforces 118A-C语言解题报告
  8. 随想录(程序员和收入)
  9. 使用Cygwin实现vlc 1.0.5的wince移植
  10. 解决 java.lang.IllegalArgumentException: Repository interface must not be null on initialization!