zl程序教程

您现在的位置是:首页 >  工具

当前栏目

Qt Quick 简单教程 - 1 (代码备忘)

Qt教程代码 简单 Quick 备忘
2023-09-11 14:20:10 时间

 

 

qmlscene 未安装


 

 由于出现上面的情况,我开始转战Windows 下学习,昨天安装好了Qt Sdk了,哟吼吼吼。

 

mail.qml内容:

import QtQuick 2.3
import QtQuick.Controls 1.2

Rectangle {

    width : 480 ;
    height : 320 ;
    color : "#121212" ;

    BusyIndicator {
       id : busier ;
       running : true ;
       anchors.centerIn : parent;
       z : 2;
    }

    Label {
      id : stateLabel ;
      visible: false ;
      anchors.centerIn : parent ;
      z : 3;
    }

    Image {
        id : imageViewer
        asynchronous : true ; //设置为异步处理图片
        cache : false ;
        anchors.fill: parent ;
        fillMode : Image.PreserveAspectFit ; //设置为等比例缩放图片
        onStatusChanged: {
            if(imageViewer.status == Image.Loading){
                busier.running = true ;
                stateLabel.visible = false;
            }else if(imageViewer.status == Image.Ready){
                busier.running = false;
            }else if(imageViewer.status == Image.Error){
                busier.running = false ;
                stateLabel.visible = true;
                stateLabel.text = "加载错误";
            }
        }
    }

    Component.onCompleted: {
        imageViewer.source = "http://images.cnblogs.com/cnblogs_com/fsong/645862/o_127433828_14224836552791n.jpg";
    }
}

 

出现的错误差不多,那么继续下节课学习啦:http://blog.csdn.net/foruok/article/details/30028711