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 ...
随机推荐
- codeforces 892 - A/B/C
题目链接:https://cn.vjudge.net/problem/CodeForces-892A Jafar has n cans of cola. Each can is described b ...
- oracle union 用法
[sql] view plaincopyprint?众所周知的几个结果集集合操作命令,今天详细地测试了一下,发现一些问题,记录备考. 假设我们有一个表Student,包括以下字段与数据: drop t ...
- UOJ #146. 【NOIP2015】信息传递 连通分量 tarjan模板题
http://uoj.ac/problem/146 题解:强连通分量 tarjan模板题.同时试了一下codeblock #include<bits/stdc++.h> using nam ...
- SCRAM
RFC 5802 - Salted Challenge Response Authentication Mechanism (SCRAM) SASL and GSS-API Mechanisms ht ...
- window10 telnet的启用
(1) window+R打开运行窗口,输入control,如图: (2) 点击类别改成大图标: 如图所示: 然后点击程序和功能. (3) 然后依次点击:启用或者关闭windows功能->teln ...
- vue 中 命名视图的用法
今天主要记录 vue中命名视图的用法 先奉上官网网址:https://router.vuejs.org/zh/guide/essentials/named-views.html 一般情况下,一个页面 ...
- mysql 记录的增删改查
MySQL数据操作: DML ======================================================== 在MySQL管理软件中,可以通过SQL语句中的DML语言 ...
- JAVA包装类介绍(一)(包装类、基本类型数据)
1. 包装类把基本类型数据转换为对象 1.1每个基本类型在java.lang包中都有一个相应的包装类 2.包装类有何作用 2.1 提供了一系列实用的方法 2.2集合不允许存放基本数据类型 ...
- C#基础笔记(第十天)
C#基础笔记(第十天) 1.字段.属性.方法.构造函数字段:存储数据属性:保护字段,对字段的取值和设值进行限定方法:描述对象的行为构造函数:初始化对象(给对象的每个属性依次的赋值)类中成员,如果不加访 ...
- AngularJS 表达式 对象和数组
AngularJS 使用 表达式 把数据绑定到 HTML. AngularJS 表达式 AngularJS 表达式写在双大括号内:{{ expression }}. AngularJS 表达式把数据绑 ...