01-09-2013 06:26 AM
Hi I want to create action item of a page dynamically using QML
How to do that?
Any example or link that explain this?
Thanks
Solved! Go to Solution.
01-09-2013 06:30 AM
I'm afraid that's only possible in C++.
01-10-2013 08:54 AM
Sure you can create an ActionItem dynamically.
Page {
id: page
Container {
Button {
text: "Create Action"
onClicked: {
var item = actionTemplate.createObject();
item.title = "New Action";
page.addAction(item, ActionBarPlacement.OnBar);
}
}
}
attachedObjects: [
ComponentDefinition {
id: actionTemplate
ActionItem {
title: 'default'
onTriggered: {
print('dynamic action item created');
}
}
}
]
}
01-10-2013 11:08 AM
Thanks peter for your answer,
I'm create it using c++ though
from another thread: I got the answer