qt - Error: Cannot assign QObject* to QQuickItem* -


i error when try show either dialog or popup in tab. don't understand why. in other apps i've made, works, cannot see difference between them.

what doing wrong?

i made example code has exact same issue:

import qtquick 2.0 import ubuntu.components 0.1 import ubuntu.components.listitems 0.1 listitem import ubuntu.components.popups 0.1 mainview { // objectname functional testing purposes (autopilot-qt5) objectname: "mainview"  // note! applicationname needs match .desktop filename  applicationname: "testar"  /*   property enables application change orientation   when device rotated. default false. */ automaticorientation: true  width: units.gu(50) height: units.gu(75)  tabs {     id: tabs      // first tab begins here     tab {         objectname: "tab1"          title: i18n.tr("hello..")          // tab content begins here         page: page {             column {                 width: parent.width                 listitem.standard {                     text: i18n.tr("swipe right left change tab.")                 }             }             // coordinates popover             component {                     id: popovercomponent                      popover {                         id: popover                         column {                             id: containerlayout                             anchors {                                 left: parent.left                                 top: parent.top                                 right: parent.right                             }                             listitem.header { text: "standard list items" }                             listitem.standard { text: "do something" }                             listitem.standard { text: "do else" }                             listitem.header { text: "buttons" }                             listitem.singlecontrol {                                 highlightwhenpressed: false                                 control: button {                                     text: "do nothing"                                     anchors {                                         fill: parent                                         margins: units.gu(1)                                     }                                 }                             }                             listitem.singlecontrol {                                 highlightwhenpressed: false                                 control: button {                                     text: "close"                                     anchors {                                         fill: parent                                         margins: units.gu(1)                                     }                                     onclicked: popuputils.close(popover)                                 }                             }                         }                     }                 }              tools: toolbaractions {                 // show spawn again                 action {                     objectname: "action1"                     id: action1                      iconsource: qt.resolvedurl("toolbaricon.png")                     text: i18n.tr("reload")                      ontriggered: {                         console.debug('debug: reload data')                         popuputils.open(popovercomponent, action1)                     }                 }         }         }     }      // second tab begins here     tab {         objectname: "tab2"          title: i18n.tr("..toolbar!")         page: page {             tools: toolbaractions {                 action {                     objectname: "action"                      iconsource: qt.resolvedurl("toolbaricon.png")                     text: i18n.tr("tap me!")                      ontriggered: {                         label.text = i18n.tr("toolbar tapped")                     }                 }             }              column {                 anchors.centerin: parent                 label {                     id: label                     objectname: "label"                      text: i18n.tr("swipe bottom reveal toolbar.")                 }             }         }     } } 

}

i got working! thing tried show dialog, or whatever, clicking on toolbar - else other stuff in actual window.

so changed id in toolbar ontriggered, item in window, in case webview id: owmap. old id 1 2 rows , commented out.

now works!

                // change coordinates                 action {                     id: coordinateaction                     objectname: "action2"                      iconsource: qt.resolvedurl("toolbaricon.png")                     text: i18n.tr("coordinates")                      ontriggered: {                         //popuputils.open(dialog, coordinateaction)                         popuputils.open(coodialog, owmap)                         console.debug('debug: change coordinates pressed')                     }                 } 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -