QtQuick 1.1 Vs Qtquick 2.0: Evolutions
-
Hi, I am starting develloping some Windows7 application and we are still looking for using QtQuick 2. 0But I noted several example which do not work anymore on 2.0, So I would like some inputs maybe I am missing few things. I just use QML for the moment. So if someone as some advice about those, I would be gratefull.
Hereafter are the 2 example in both version.
Thanks a lot.Display Html page :QT Creator 2.6.0 , Qt 4.8 QtQuick 1.1: Works correctly: Display the Html File
@import QtQuick 1.1
import QtWebKit 1.0Rectangle {
width: 800
height: 600
color:"grey"
//WebBrowser Definition
Flickable{
anchors.fill: parent
WebView {
id:iWebViewBackground
anchors.fill: parent
anchors.margins:10url: "D:/SDCN/html/test.htm" //smooth: true } }
}@
Display Html page :QT Creator 2.6.0 , Qt 5.0.0b2 QtQuick 2.0: Does not work, just a white rectangle
@import QtQuick 1.1
import QtWebKit 1.0Rectangle {
width: 800
height: 600
color:"grey"
//WebBrowser Definition
Flickable{
anchors.fill: parent
WebView {
id:iWebViewBackground
anchors.fill: parent
anchors.margins:10url: "D:/SDCN/html/test.htm" //smooth: true } }
}@
"pinchproperties.qml" Test File provided with Qt5.0.0b2page :QT Creator 2.6.0 , Qt 4.8 QtQuick 1.1: Works correctly: Can manipulatethe square
@import QtQuick 1.1
Rectangle {
id: whiteRect
property variant center
property real scale
property int pointCount: 0
property bool pinchActive: false
width: 600; height: 600
color: "white"
Rectangle {
id: blackRect
objectName: "blackrect"
color: "black"
y: 100
x: 100
width: 200
height: 200
opacity: (whiteRect.width-blackRect.x+whiteRect.height-blackRect.y-199)/200
Text { text: blackRect.opacity}
PinchArea {
id: pincharea
objectName: "pincharea"
anchors.fill: parent
pinch.target: blackRect
pinch.dragAxis: Drag.XandYAxis
pinch.minimumX: 0
pinch.maximumX: whiteRect.width-blackRect.width
pinch.minimumY: 0
pinch.maximumY: whiteRect.height-blackRect.height
pinch.minimumScale: 1.0
pinch.maximumScale: 2.0
pinch.minimumRotation: -90.0
pinch.maximumRotation: 90.0
onPinchStarted: {
/whiteRect.center = pinch.center;
whiteRect.scale = pinch.scale;
whiteRect.pointCount = pinch.pointCount;
whiteRect.pinchActive = true;/
console.log("PinchStarted");} onPinchUpdated: { /*whiteRect.center = pinch.center; whiteRect.scale = pinch.scale; whiteRect.pointCount = pinch.pointCount;*/ console.log("PinchUpdated",whiteRect.pointCount); } onPinchFinished: { /* whiteRect.center = pinch.center whiteRect.scale = pinch.scale whiteRect.pointCount = pinch.pointCount; whiteRect.pinchActive = false;*/ console.log("PinchFinished") } } }
}@
"pinchproperties.qml" Test File provided with Qt5.0.0b2 :QT Creator 2.6.0 , Qt 5.0.0b2 QtQuick 2.0: Does not work: Cannot manipulate anything
@import QtQuick 2.0
...
...
..@ -
Hi,
I'm not sure about the WebView element - that comes from WebKit and I don't know what the current status of that is.
Regarding the pinch area stuff... well, your example is not very minimal, but certainly pinch area works in QtQuick2. The API may have changed slightly, so make sure that the parser isn't complaining of any errors. If there are no errors, and you can't get pinch interaction to work still, please try MouseArea and Flickable and see if any touch interaction works at all - if not, it may be a lower level issue.
Cheers,
Chris.