Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › Qt.createQmlObject with variable parameters

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24308

    Edward

    Hi Guys,

     

    I’ve been working with a combination of ImagePicker and Qt.createQmlObject to add a moveable/resizeable image onto a canvas, all works perfectly when i import a set image source, however where the image source each time is coming from the ImagePicker.selection string it would be dynamic in proper use.

    Below is a basic adapt of the code removing all the other settings, and the “<THIS>” is where I need help.

     

    var newObject = Qt.createQmlObject('import QtQuick 2.0; AppImage { source: "<THIS>"   ;width: 200; height: 200}',
                                       parentItem,
                                       "dynamicSnippet1");

     

    I have tried editing the like to be more like:

    `AppImage { source: ‘ + imagePathVar + ‘  ….  }

     

    I only receive errors, I have also replaced the source with the variable name (imagePathVar) however it consistently returns undefined or errors, any ideas?

     

    Thanks

    #24310

    Edward

    Hi Guys,

     

    Again – solved this with a simple ‘toString()’ when obtaining my source from the selected image!

     

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded