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


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

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


    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}',


    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?





    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