30 lines
1.1 KiB
QML
30 lines
1.1 KiB
QML
import QtQuick 2.0
|
|
import QtQuick.Controls 1.2
|
|
|
|
Item {
|
|
ComboBox{
|
|
id: selectionTypeCombo
|
|
width: 150
|
|
model: ["album", "type","filename"]
|
|
onCurrentIndexChanged:{
|
|
var login=Service.readActiveConfig(db);
|
|
if (currentText!==""){
|
|
photogroupModel.clear();
|
|
Service.readData(db, "imageData",function(filter){
|
|
for (var j=0;j<filter.length;j++){
|
|
Service.readField("data",db,"imageData",function(obj){
|
|
// obj.sort(function(obj1,obj2){return obj1.data-obj2.data});
|
|
if (obj) {
|
|
for (var k=0;k<obj.length;k++){
|
|
print("Photomodel:"+obj[k].location+obj[k].filename);
|
|
photoModel.append({imageString: obj[k].location+obj[k].filename,photoDescription:obj[k].filename})
|
|
};
|
|
}
|
|
if (obj[0]) {photogroupModel.append({photoDescription: filter[j]})};
|
|
},currentText,filter[j]);
|
|
}},"username",login.username)
|
|
}
|
|
}
|
|
}
|
|
}
|