[quote author="sletta" date="1410458827"]
Could you please elaborate on which ones are not working properly?
[/quote]
Sorry, my fault. I take a look into the simple material example and it looks good. In my mind there was no types like lowp in the variables definitions but there are. Maybe in another example. If i found it i will report it and make a patch.
Finally I found the answer "here":http://www.codeproject.com/Articles/632795/QML-TreeModel-and-TreeView
We can append new data to child list using
@nestedModel.get(index).folders.append({"folderName": "Cam55})
nestedModel.get(index).folders.append({"folderName": "Cam66})@
I discovered the problem, the keyboard is responding to the "currentRow" which is not the same as the selected row. The solution is that when I call selection.select(0) I also have to set currentRow=0
I used the same xml. I'm able to get it through thumbnail. Just pasting here on what I did. It may help you.
===qt.xml=========
@<?xml version="1.0" encoding="utf-8"?>
<current>
<thumbnail url="http://pthinks.france24.com/en/files/imagecache/france24_ct_api_medium2/article/image/20140910 marina silva.jpg"/>
<source url="http://scd.france24.com/en/files/imagecache/france24_ct_api_medium2/article/image/20140910 marina silva.jpg">AFP | Marina Silva campaigns in the Rocinha favela in Rio de Janeiro on August 30</source>
</current>@
@XmlListModel {
id: xmlModel
source : "qt.xml"
query: "/current"
XmlRole { name: "ThumNail"; query: "thumbnail/@url/string()" }
XmlRole { name: "Source"; query: "source/@url/string()" }
Component.onCompleted: {
console.log("XML Model loaded")
}
}
ListView {
id : showCity
width: 180; height: 300
model: xmlModel
delegate: Text { text: ThumNail + ": " + Source }
}
@
In addition what dasRicardo said, it is not like QLabel. Label is item. MouseArea is typically defined for visible item. So MouseArea can be defined for Label and implement whatever the mouseArea event you would like to have.
Thanks,
That works, the funny thing I tried it, as I mentioned in my original post and you quoted it. But forgot to change the id of the item to be "window", and got really frustrated.
I tried the following which works
@
QPalette customPalette(app.palette());
customPalette.setColor(QPalette::ButtonText, QColor("red"));
customPalette.setColor(QPalette::WindowText,QColor("yellow"));
app.setPalette(customPalette);
@
and QML
@
Button {
text: "Qt"
}
Label {
text: "Hello world"
}
@
Here the color of the text changes as per the palette but neither QPalette::Window/QPalette::Background/QPalette::Base/QPalette::Button worked for background of button for eg.