Hi,
I solved the problem in mainMenu by using :
MouseArea {
...
onClicked:{
switch(index) {
case 0:
stack.push(view11)
break;
case 1:
stack.push(view12)
break;
case 2:
stack.push(view13)
break;
case 3:
stack.push(view14)
break;
case 4:
stack.push(view15)
break;
}
}
MouseArea {
...
onClicked:{
switch(index) {
case 0:
stack.push(view11)
break;
case 1:
stack.push(view12)
break;
case 2:
stack.push(view13)
break;
case 3:
stack.push(view14)
break;
case 4:
stack.push(view15)
break;
}
}
To copy to clipboard, switch view to plain text mode
I have some problems in subMenu :
MouseArea {
...
onClicked:{
// The first element of mainMenu contains 4 elements of subMenu
if(menuModel.get(0)){
switch(index) {
case 0:
stack.push(view1)
break;
case 1:
stack.push(view2)
break;
case 2:
stack.push(view3)
break;
case 3:
stack.push(view4)
break;
}
}
// The 2nd element of mainMenu contains 2 elements of subMenu
if(menuModel.get(1)){
console.log(index)
switch(index) {
case 0:
stack.push(view5)
break;
case 1:
stack.push(view6)
break;
}
}
MouseArea {
...
onClicked:{
// The first element of mainMenu contains 4 elements of subMenu
if(menuModel.get(0)){
switch(index) {
case 0:
stack.push(view1)
break;
case 1:
stack.push(view2)
break;
case 2:
stack.push(view3)
break;
case 3:
stack.push(view4)
break;
}
}
// The 2nd element of mainMenu contains 2 elements of subMenu
if(menuModel.get(1)){
console.log(index)
switch(index) {
case 0:
stack.push(view5)
break;
case 1:
stack.push(view6)
break;
}
}
To copy to clipboard, switch view to plain text mode
When I clicked in 1st element [subMenu] of 1st element [mainMenu], next image 2.jpg --> load Page 5 however you should load Page 1, the same for 2nd element [subMenu] of 1st element [mainMenu] --> load Page 6 however you should load Page 2, because of expression in code above (e.g):
// The 2nd element of mainMenu contains 2 elements of subMenu
if(menuModel.get(1)){
console.log(index)
switch(index) {
case 0:
stack.push(view5)
break;
case 1:
stack.push(view6)
break;
// The 2nd element of mainMenu contains 2 elements of subMenu
if(menuModel.get(1)){
console.log(index)
switch(index) {
case 0:
stack.push(view5)
break;
case 1:
stack.push(view6)
break;
To copy to clipboard, switch view to plain text mode
I think that I did some thing wrong in if condition, any idea to solve this ???
Cheers,
Bookmarks