Image Inside Text as Html format



  • How to insert Image in QML inside the Text from javascript?
    Ex:
    Text{
    id: aaa
    }

    onCompleted:{
    aaa.text = "Hellello" + <img src="../Images/1.png">
    }
    I knew this is definitely possible.But i am not able to run successfully.Can anyone help me on this?


  • Moderators

    Put it inside quotes and escape the double quotes inside the img tag.
    "Hellello" + "<img src=\"../Images/1.png\">"
    And make sure the path is correct too.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.