[Interest] Dynamic QML menu from C++ data?

Andrew Ialacci andrew at dkai.dk
Mon Aug 28 18:30:28 CEST 2017

Use an Instantiator:

Example copied from a random project


On 8/28/17, 6:28 PM, "Interest on behalf of Murphy, Sean" <interest-bounces+andrew=dkai.dk at qt-project.org on behalf of smurphy at 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?
    Interest mailing list
    Interest at qt-project.org

More information about the Interest mailing list