Bonjour,

J'ai une combo dans un composant qml tel que ci-après :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
ComboBox {
                id:comboType
                width:200
                height:30
                x:100
                y:85
                property bool error : false
                model: ListModel {
                    id:list
                    ListElement { itemid:0; text:"Pause de 15m" }
                    ListElement { itemid:1; text: "Pause Déjeuné" }
                }
                style: ComboBoxStyle {
                        id: comboBox
                        background: Rectangle {
                            id: rectCategory
                            radius: 5
                            border.width: 2
                            //border.color: control.error?"#ff0000":"#000000"
                            color: "#fff"
 
                            /*Image {
                                source: "pics/corner.png"
                                anchors.bottom: parent.bottom
                                anchors.right: parent.right
                                anchors.bottomMargin: 5
                                anchors.rightMargin: 5
                            }*/
                            /*SequentialAnimation on border.color {
                                id: animateColor
                                running: false
                                    ColorAnimation { to: "yellow"; duration: 5000 }
                                    ColorAnimation { to: "blue"; duration: 5000 }
                                }
 
                            function popupErrorMessage(){
                                animateColor.start();
                            }*/
                        }
                        label: Text {
                            verticalAlignment: Text.AlignVCenter
                            horizontalAlignment: Text.AlignHCenter
                            font.pointSize: 15
                            font.family: "Courier"
                            font.capitalization: Font.SmallCaps
                            color: "black"
                            text: control.currentText
                        }
                        function test1(){
                            console.log("1o");
                        }
 
                    }
J'aimerai faire une animation sur la border.color de ma comboboxstyle de puis un bouton se trouve au même niveau que la combox. Cependant si j'appel mon annimation par son id depuis le bouton par un animateColor.start() rien ne se passe.

Comment sont gérer les id dans qml, peut on appelle tout composant de n'importe ou ou sont ils limité dans leurs portés ?

Cordialement,