タブにダイアログまたはポップアップを表示しようとすると、このエラーが発生します。理由がわかりません。私が作成した他のアプリでは動作しますが、それらの違いはわかりません。
私は何を間違っていますか?
まったく同じ問題があるサンプルコードを作成しました:
import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.ListItems 0.1 as ListItem
import Ubuntu.Components.Popups 0.1
MainView {
// objectName for functional testing purposes (autopilot-qt5)
objectName: "mainView"
// Note! applicationName needs to match the .desktop filename
applicationName: "testar"
/*
This property enables the application to change orientation
when the device is rotated. The default is 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 from right to left to 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 something 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 from bottom to up to reveal the toolbar.")
}
}
}
}
}
}