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++
        }
    }

}


同样的道理,它在android上也有很好的实现



附件列表

QTQuick控件基础(2)的更多相关文章

  1. QTQuick控件基础(1)

    一.Item QtQuick所有的可视项目都继承自Item,它定义了可视化项目所有通用特性(x\y\width\height\anchors等)具体包括 1.作为容器 2.不透明性 没有设置opaci ...

  2. QTQuick控件基础(3)视图

    1.spliteview 2.stackview ApplicationWindow {visible: truewidth: 640height: 480MouseArea{anchors.fill ...

  3. 重新想象 Windows 8 Store Apps (17) - 控件基础: Measure, Arrange, GeneralTransform, VisualTree

    原文:重新想象 Windows 8 Store Apps (17) - 控件基础: Measure, Arrange, GeneralTransform, VisualTree [源码下载] 重新想象 ...

  4. 重新想象 Windows 8 Store Apps (16) - 控件基础: 依赖属性, 附加属性, 控件的继承关系, 路由事件和命中测试

    原文:重新想象 Windows 8 Store Apps (16) - 控件基础: 依赖属性, 附加属性, 控件的继承关系, 路由事件和命中测试 [源码下载] 重新想象 Windows 8 Store ...

  5. Delphi XE2 之 FireMonkey 入门(44) - 控件基础: TTreeView、TTreeViewItem

    Delphi XE2 之 FireMonkey 入门(44) - 控件基础: TTreeView.TTreeViewItem TScrollBox -> TCustomTreeView -> ...

  6. Delphi XE2 之 FireMonkey 入门(43) - 控件基础: TStringGrid、TGrid

    Delphi XE2 之 FireMonkey 入门(43) - 控件基础: TStringGrid.TGrid TStringGrid.TGrid 都是从 TCustomGrid 继承; 区别有:1 ...

  7. Delphi XE2 之 FireMonkey 入门(42) - 控件基础: TComboBox、TComboEdit

    Delphi XE2 之 FireMonkey 入门(42) - 控件基础: TComboBox.TComboEdit TListBox 有两个兄弟 TComboListBox.TComboEditL ...

  8. Delphi XE2 之 FireMonkey 入门(41) - 控件基础: TListBox

    Delphi XE2 之 FireMonkey 入门(41) - 控件基础: TListBox TScrollBox -> TCustomListBox -> TListBox; 其元素项 ...

  9. Delphi XE2 之 FireMonkey 入门(40) - 控件基础: TMemo

    Delphi XE2 之 FireMonkey 入门(40) - 控件基础: TMemo 值得注意的变化: 1.其父类 TScrollBox 的许多特性也很有用处, 如:   Memo1.UseSma ...

随机推荐

  1. 三种邻接表存图模板:vector邻接表、数组邻接表、链式前向星

    vector邻接表: ; struct Edge{ int u,v,w; Edge(int _u=0,int _v=0,int _w=0){u=_u,v=_v,w=_w;} }; vector< ...

  2. JSP学习_01

    JSP cookie是存储在客户机的文本文件,保存了大量的轨迹信息.通常有三个步骤可以识别回头客:1)服务器脚本发送一系列cookie到浏览器,如姓名.年龄.ID等2)浏览器在本地存储这些信息以备不时 ...

  3. 插入排序之python

    插入排序( Insert sort) 通过构建有序序列,对于未排序数据,在已排序序列中从后向前扫描,找到相应位置并插入: 由于不需要全部都比较完,所以排序速度优于冒泡和选择排序. #插入排序就像是斗地 ...

  4. Apple Pay的实现

    首先是搜到的大神写的全套知识点:http://www.jianshu.com/p/8d7b86f1d142 http://www.cnblogs.com/dashunzi/archive/2016/0 ...

  5. python3学习笔记(1)_string

    #python学习笔记 17/07/07 # !/usr/bin/evn python3 # -*- coding:utf-8 -*- #r"" 引号当中的字符串不转义 #练习 # ...

  6. Django中利用filter与simple_tag为前端自定义函数的实现方法

    转自:http://www.jb51.net/article/116303.htm 前言 Django的模板引擎提供了一般性的功能函数,通过前端可以实现多数的代码逻辑功能,这里称之为一般性,是因为它仅 ...

  7. QS Network---zoj1586最小生成树

    Description Sunny Cup 2003 - Preliminary Round April 20th, 12:00 - 17:00 Problem E: QS Network In th ...

  8. IDEA的快捷键和相关设置

      快捷键 Shift + Shift: 查找一切 Alt + /: 代码提示(需要修改) Ctrl + Alt + F12: 打开文件所在磁盘位置 Alt + F12: 打开终端 Alt + Ins ...

  9. hive-site.xml配置

    <?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-s ...

  10. WordPress跳过语言包加载提高效率

    WordPress 加载语言包是需要花费 0.1-0.5 秒不等的时间,所以如果 WordPress 前台可以不加载语言包,而主题中的一些文本直接写成中文,就可以加快网站的速度,并且又能保证后台的中文 ...