[osg-users] qt5 qml plugin
Roy Arents
osgforum at tevs.eu
Tue Nov 17 01:02:22 PST 2015
Hi,
I've tried some more, but still can't figure out what is going wrong with the update.
I see the same happening when I try to include the qml in the osgQtWidgets.cpp example. I've included the cpp code and the qml code below. Notice the qml filepath pointing to the qml file pasted in code below (attaching qml is not allowed) (you may need to change the absolute path.
I'm using Qt5.4.0 and tried both osg 3.2.1 and 3.4.0
Hopefully someone can help.
Thank you!
Cheers,
Roy
Code:
import QtQuick 2.0
Rectangle {
id: landingPage
objectName:"testQml"
width: 300
height: 300
color: "red"
Rectangle {
id: onotherRect
anchors.centerIn: parent
width: parent.width / 2
height: parent.height / 2
color: "yellow"
MouseArea {
id: testMouse
anchors.fill: parent
onClicked: {
console.log("Clicked testMouse");
landingPage.color = "blue"
onotherRect.color = "green"
}
}
}
Component.onCompleted: testTimer.start()
Timer {
id:testTimer
interval: 1000
repeat: true
onTriggered: {
console.log("testTimer triggered");
landingPage.color = landingPage.color == "red" ? landingPage.color = "orange" : landingPage.color = "red"
}
}
}
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65661#65661
Attachments:
http://forum.openscenegraph.org//files/osgqtwidgets_179.cpp
More information about the osg-users
mailing list