PDA

View Full Version : Impossible Qt quick application from Ray Rischpater's book



sylas
29th November 2016, 07:27
Hi all. At first no quick application possible. You told me to install qtdeclarative5-dev and qml-module-qtqick2. I did that. I have now Qtquick but I have a problem with my first code. Look please at line 9. Here is the code:


import QtQuick 2.5
import QtQuick.Window 2.2

Window {
visible: true
width: 360
height: 360

MouseArea {
anchors.fill: parent
onCliqued: {//Cannot assign to non-existent property "onCliqued"
Qt.quit();
}
}

Text {
id: text
text: qsTr("Hello World")
anchors.centerIn: parent
}

Rectangle {
id: rectangle1
x: 135
y: 50
width: 100
height: 100
color: "#ffff22"

MouseArea {
id: mouseArea1
anchors.fill: parent
onClicked: text.text = qsTr("Hi there ! ")
}
}
}

I dont find how to tag the above code. Sorry. Look please at the commented line. Thanks

anda_skoa
29th November 2016, 12:27
MouseArea has no signal named "cliqued" so there is no signal handler "onCliqued"

I would have assumed that you wanted to handle the "clicked" signal, but you do that later on so I am not sure which signal you are looking for here.

Cheers,
_

sylas
29th November 2016, 18:23
I deleted all about first MouseArea, and now everything is OK. Thank you very much. But how is it possible there is such a big error in the book ?? The error is on page 19 of the book "Application Development with Qt Creator. Second Edition".