PDA

View Full Version : why not works my mouseArea



kickoune
11th March 2016, 11:20
AnalogGauge.qml


import QtQuick 2.0
import QtQuick.Extras 1.4
import QtQuick.Controls.Styles 1.4

Item {
id:itemParent
property real valueIn: 888888//valeur brut du protocole
property int valprecision:1
property var objChamps
property int valminValue
property int valmaxValue
property int valangleMin:-120
property int valangleMax:120
property real vallabelStepSize
property real valtickmarkStepSize
property real valminorTickmarkCount
property real valstepToMoveNeedle


Rectangle{
anchors.fill:parent
color:"red"

MouseArea{
acceptedButtons: Qt.LeftButton | Qt.RightButton
anchors.fill:parent
onClicked: console.log("test")
}
}
}



AnalogGauge{
objectName: "AFR"
width:180
height:180
valminValue: 12
valmaxValue: 18
valstepToMoveNeedle:0.1
vallabelStepSize:1
valtickmarkStepSize:0.5
valminorTickmarkCount:4
valangleMin: -90
valangleMax: 90
objChamps:appli.getChamps(1,3)
}



hello! my mouseArea not works, i don't understand, but rectangle is really "red"
please help me.

thank's

anda_skoa
11th March 2016, 12:11
If you run AnalogGauge.qml in qmlscene, does it work?
Because I've just copied the code for it to a file and it did work.

Cheers,
_

kickoune
11th March 2016, 13:42
if the item is dragable but is create in grid/ row....
in this case, Mouse Area not work's, clicked not work's....


it's work's, i don't understand what is happening.

anda_skoa
11th March 2016, 13:51
Well, if you have code that does not work, wouldn't it be a good idea to post that instead of or additional to code that works?

Cheers,
_