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


}

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







附件列表

 

目前方向:图像拼接融合、图像识别 联系方式:jsxyhelu@foxmail.com
优秀的个人博客,低调大师

微信关注我们

原文链接:https://yq.aliyun.com/articles/649420

转载内容版权归作者及来源网站所有!

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

相关文章

发表评论

资源下载

更多资源
优质分享Android(本站安卓app)

优质分享Android(本站安卓app)

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

Apache Tomcat7、8、9(Java Web服务器)

Apache Tomcat7、8、9(Java Web服务器)

Tomcat是Apache 软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目,由Apache、Sun 和其他一些公司及个人共同开发而成。因为Tomcat 技术先进、性能稳定,而且免费,因而深受Java 爱好者的喜爱并得到了部分软件开发商的认可,成为目前比较流行的Web 应用服务器。

Eclipse(集成开发环境)

Eclipse(集成开发环境)

Eclipse 是一个开放源代码的、基于Java的可扩展开发平台。就其本身而言,它只是一个框架和一组服务,用于通过插件组件构建开发环境。幸运的是,Eclipse 附带了一个标准的插件集,包括Java开发工具(Java Development Kit,JDK)。

Sublime Text 一个代码编辑器

Sublime Text 一个代码编辑器

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。