QTQuick控件基础(2)
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Window 2.1
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
menuBar: MenuBar{
Menu{
title: qsTr("File")
MenuItem{
text: qsTr("EXIT")
onTriggered: Qt.quit()
}
}
}
Column{
spacing: 10
//button
Button{
x:10;y:10;width: 140
text:qsTr("Button with menu")
menu:Menu{
MenuItem{text:qsTr("Item1")}
MenuItem{text:qsTr("Item2")}
}
}
//radiobutton
ExclusiveGroup{id:group}
RadioButton{
text:qsTr("from top")
exclusiveGroup: group
checked: true
}
RadioButton{
text:qsTr("from cursor")
exclusiveGroup: group
}
//switch
Switch{checked: true}
Switch{checked: false}
//combobox
ComboBox{
id:editableCombo
editable: true
model: ListModel{
id:model
ListElement{ text:"Banana";color:"Yellow"}
ListElement{ text:"Apple";color:"Green"}
ListElement{ text:"Cocont";color:"Brown"}
}
onAccepted: {
if(editableCombo.find(currentText) === -1){
model.append({text:editText})
currentIndex = editableCombo.find(editText)
}
}
}
//spinbox
SpinBox{
minimumValue: -5;maximumValue: 10
prefix: "today";suffix: "degree"
decimals: 1;stepSize: 1
}
//TextField
TextField{
width: 200
placeholderText: "写字写字"
echoMode: TextInput.PasswordEchoOnEdit
}
TextField{width: 200}
//TextArea
TextArea{
width: 240
textFormat: TextEdit.RichText
font.pointSize: 13
text: "<b>Hello</b><i>world!</i>"
}
TextArea{
width: 240
textFormat: TextEdit.PlainText
font.pointSize: 13
text: "<b>Hello</b><i>world!</i>"
}
//BusyIndicator
BusyIndicator{
running: true
}
//ProgressBar
ProgressBar{
id:progressBar
minimumValue: 0
maximumValue: 100
}
Timer{
interval: 100
running: true
repeat: true
onTriggered: progressBar.value++
}
}
}
附件列表
QTQuick控件基础(2)的更多相关文章
- QTQuick控件基础(1)
一.Item QtQuick所有的可视项目都继承自Item,它定义了可视化项目所有通用特性(x\y\width\height\anchors等)具体包括 1.作为容器 2.不透明性 没有设置opaci ...
- QTQuick控件基础(3)视图
1.spliteview 2.stackview ApplicationWindow {visible: truewidth: 640height: 480MouseArea{anchors.fill ...
- 重新想象 Windows 8 Store Apps (17) - 控件基础: Measure, Arrange, GeneralTransform, VisualTree
原文:重新想象 Windows 8 Store Apps (17) - 控件基础: Measure, Arrange, GeneralTransform, VisualTree [源码下载] 重新想象 ...
- 重新想象 Windows 8 Store Apps (16) - 控件基础: 依赖属性, 附加属性, 控件的继承关系, 路由事件和命中测试
原文:重新想象 Windows 8 Store Apps (16) - 控件基础: 依赖属性, 附加属性, 控件的继承关系, 路由事件和命中测试 [源码下载] 重新想象 Windows 8 Store ...
- Delphi XE2 之 FireMonkey 入门(44) - 控件基础: TTreeView、TTreeViewItem
Delphi XE2 之 FireMonkey 入门(44) - 控件基础: TTreeView.TTreeViewItem TScrollBox -> TCustomTreeView -> ...
- Delphi XE2 之 FireMonkey 入门(43) - 控件基础: TStringGrid、TGrid
Delphi XE2 之 FireMonkey 入门(43) - 控件基础: TStringGrid.TGrid TStringGrid.TGrid 都是从 TCustomGrid 继承; 区别有:1 ...
- Delphi XE2 之 FireMonkey 入门(42) - 控件基础: TComboBox、TComboEdit
Delphi XE2 之 FireMonkey 入门(42) - 控件基础: TComboBox.TComboEdit TListBox 有两个兄弟 TComboListBox.TComboEditL ...
- Delphi XE2 之 FireMonkey 入门(41) - 控件基础: TListBox
Delphi XE2 之 FireMonkey 入门(41) - 控件基础: TListBox TScrollBox -> TCustomListBox -> TListBox; 其元素项 ...
- Delphi XE2 之 FireMonkey 入门(40) - 控件基础: TMemo
Delphi XE2 之 FireMonkey 入门(40) - 控件基础: TMemo 值得注意的变化: 1.其父类 TScrollBox 的许多特性也很有用处, 如: Memo1.UseSma ...
随机推荐
- threading.Condition()
threading — Thread-based parallelism — Python 3.7.2 documentation https://docs.python.org/3/library/ ...
- JQUERY中各个ajax函数
1.$(selecter).load() --- load() 方法从服务器加载数据,并把返回的数据放入被选元素中 2.$.get(url,callback()) 3.$.post(url,d ...
- 学习计划 mysql 主从复制
网上资料繁多,需要跳多少坑才能实现,跳跳就知道了. -- 主从复制 如题:主数据库进行的操作,从数据库进行备份. -- 原理 有关于这方面的原理网上也是一搜一大片,去看看吧.肯定没错. 这里简单说一下 ...
- 用 Python 替代 Bash 脚本(转)
add by zhj: 其实作者是想说用Python来做那些Bash实现起来比较麻烦的部分,即将Bash与Python结合使用. 英文原文:http://www.linuxjournal.com/co ...
- 【代码备份】ZJ10086测试环境成功代码备份
vuser_init(){ lr_start_transaction("login"); web_url("101.132.17.138", ...
- FineReport实现java报表权限使用的效果图
Java报表-多级权限配置说明 Java报表-联合填报 Java报表-模板内容权限控制 Java报表-权限细粒度控制
- Vue 命令
vue是数据渲染使用:axios,官网:https://www.kancloud.cn/yunye/axios/234845 || https://www.npmjs.com/search? ...
- Selenium之Css Selector使用方法
什么是Css Selector? Css Selector定位实际就是HTML的Css选择器的标签定位 工具 Css Selector的练习建议使用火狐浏览器,下载插件,FireFinder.Fire ...
- PAT 1026 Table Tennis[比较难]
1026 Table Tennis (30)(30 分) A table tennis club has N tables available to the public. The tables ar ...
- 主成分分析(PCA)算法,K-L变换 角度
主成分分析(PCA)是多元统计分析中用来分析数据的一种方法,它是用一种较少数 量的特征对样本进行描述以达到降低特征空间维数的方法,它的本质实际上是K-L变换.PCA方法最著名的应用应该是在人脸识别中特 ...