QTQuick控件基础(2)

简介: import QtQuick 2.2import QtQuick.Controls 1.2import QtQuick.Window 2.1ApplicationWindow {    visible: true    width: 640    height: 480    title: qsTr...
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++
        }
    }


}

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







附件列表

 

目前方向:图像拼接融合、图像识别 联系方式:jsxyhelu@foxmail.com
目录
相关文章
|
10月前
|
前端开发 算法 JavaScript
从基础到进阶:实现div控件的拖拽和缩放功能
从基础到进阶:实现div控件的拖拽和缩放功能
141 0
|
7月前
|
开发框架 前端开发 JavaScript
WPF应用开发之控件动态内容展示
WPF应用开发之控件动态内容展示
|
10月前
|
移动开发
【实用】一组原创原生样式的基础控件、UI组件样式(偏向移动端H5页面的样式)
【实用】一组原创原生样式的基础控件、UI组件样式(偏向移动端H5页面的样式)
【实用】一组原创原生样式的基础控件、UI组件样式(偏向移动端H5页面的样式)
|
7月前
|
开发框架 缓存 前端开发
使用扩展函数方式,在Winform界面中快捷的绑定树形列表TreeList控件和TreeListLookUpEdit控件
使用扩展函数方式,在Winform界面中快捷的绑定树形列表TreeList控件和TreeListLookUpEdit控件
|
10月前
|
数据可视化 前端开发
web前端-Echarts-5.3高级可视化和图表组合布局
web前端-Echarts-5.3高级可视化和图表组合布局
|
10月前
使用ListView控件展示数据
使用ListView控件展示数据
|
Android开发 Windows
weditor, 布局分析, 查看控件信息
weditor, 布局分析, 查看控件信息
540 0
一个控件几行代码实现换肤(可支持菜单)
这是从vbAccelerator(http://vbaccelerator.com)的皮肤程序修改而来,把DLL方式修改为OCX,并且修改为仅通过几行指令,即可完成皮肤加载。
523 0
|
存储 SQL 测试技术
【实现】表单控件的UI布局,实现方式
 一、先说一下表单控件要实现的功能吧。        1、绘制UI,包括表格(Table)的绘制,也就是TR 、TD,TR是多少行,TD是有多少列;包括子控件的控件,TextBox、DropDownList、CheckBoxList等控件的加载、描述(宽度、最大字符数、填充item)等。
1528 0
|
SQL
【实现】表单控件里的子控件的变化。
     前情回顾: 【实现】表单控件的UI布局,实现方式         上一篇说的是表单布局上的变化,也就是通过TR、TD的设置,实现了多行多列的效果。那么格子画好了,我们 可以往里面放控件了。
899 0