actons does not show in MainView
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-ui-toolkit (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I created a very simple MainView app, and I got an action in the MainView. The actions do not show up:
import QtQuick 2.0
import Ubuntu.Components 1.1
/*!
\brief MainView with a Label and Button elements.
*/
MainView {
// objectName for functional testing purposes (autopilot-qt5)
objectName: "mainView"
// Note! applicationName needs to match the "name" field of the click manifest
application
/*
This property enables the application to change orientation
when the device is rotated. The default is false.
*/
//automatic
// Removes the old toolbar and enables new features of the new header.
useDeprecat
width: units.gu(60)
height: units.gu(85)
actions: [
Action {
// iconSource: Qt.resolvedUrl(
}
}
]
Page {
title: i18n.tr(
Label {
text: "this is the label"
}
}
}
Thanks & best regards,
XiaoGuo
I think you misunderstood the API (or wrongly guessed its purpose). MainView.actions is a list of actions globally available in the app, originally incepted for the HUD. If you want actions to show in the header, you actually need to use Page.head.actions.