summaryrefstree
path: root/usr/bin/qml/com/neusoft/auto/widgets/HMILoading.qml
blob: f5fce323657b31647fee97a2d4186ae56afcfc01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
*   Copyright (C) 2016 by myf
*   Author : mengyufeng   <yufeng.meng@newtouch.cn>
*
*/


import QtQuick 2.0

Image
{
    id: loading
    property alias timer: loadingTimer
    property int loadImg: 1
    property string bgImageStyle: systemCtrl.style
    //ADD DESIGN 2017/1/10 liduo begin
    width:60
    height:60
    //ADD DESIGN 2017/1/10 liduo end
    
    //ADD By qu-shh for auto display off start
    property bool display_flag:false
    //ADD By qu-shh for auto display off end

    onVisibleChanged:
    {

        if(visible)
        {
            loadingStart();
//ADD By qu-shh for auto display off start
            if(!display_flag)
            {
                systemCtrl.auto_Displayoff_Shield()
                display_flag = true
            }
//ADD By qu-shh for auto display off end
        }
        else
        {
            loadingStop();
//ADD By qu-shh for auto display off start
            if(display_flag)
            {
                systemCtrl.auto_Displayoff_Unshield()
                display_flag = false
            } 
//ADD By qu-shh for auto display off end
        }
    }
    //FOD design 2017/01/11 liduo begin
    source:"qrc:MATERIAL/MATERIAL_LOADING_60_"+loadImg+bgImageStyle
    //FOD design 2017/01/11 liduo end

    Timer{
        id: loadingTimer
        interval: 100
        repeat: true
        triggeredOnStart: true
        onTriggered: {
            loading.loadImg = loading.loadImg == 10 ? 1 : (loading.loadImg + 1)
        }
    }
    function loadingStart()
    {

        loadingTimer.start()

    }
    function loadingStop()
    {
        loadingTimer.stop()

    }
}