Use an Instantiator:

Example copied from a random project

https://gist.github.com/anonymous/2f803e7b49760b509d6a23c43901f52e





On 8/28/17, 6:28 PM, "Interest on behalf of Murphy, Sean" 
<interest-bounces+andrew=dkai...@qt-project.org on behalf of 
smur...@walbro.com> wrote:

    I'd think this is a pretty easy thing to do, but I'm struggling to find an 
example that shows it. In my QML, I have a button. When the button is clicked, 
a popup menu should open. That part I have working, what I'm struggling with is 
I need to be able to dynamically populate the popup menu from the C++ side, and 
then get which menu item was clicked on back to the C++ side. 
    
    I'm struggling to find just a simple example of how to do this. Does anyone 
have a quick link to something like that?
    
    Sean
    _______________________________________________
    Interest mailing list
    Interest@qt-project.org
    http://lists.qt-project.org/mailman/listinfo/interest
    

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to