2017-02-16 33 views
1

有一個用QML編寫的實時通信工具,該消息以html格式傳輸。如何獲得豐富文本中點擊的圖像?

simple code: 

Rectangle{ 
    width:300 
    height: 300 

    Rectangle{ // simple bubble 

     anchors.centerIn: parent 
     width: parent.width-100 
     height: parent.height-100 
     color:"#f0f0f0" 
     radius: 10 

     TextEdit { //simple message show 

      anchors.fill: parent 
      readOnly: true 
      selectByMouse: true 
      clip: true 
      text: "<!DOCTYPE html> 
        <html> 
        <head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head> 
         <body style=\"font-family:Geneva,Helvetica,Arial,sans-serif; font-size: 12px;\"> 
          this is an image: 
          <img alt=\"\" src=\"file:/local/image.png\" /> 
         </body> 
        </html> 
       " 
      textFormat: Text.RichText 
     } 
    } 
} 

我的問題是如何從一個BubbleChatWidget獲得點擊的形象?

喜歡: click action

類似的問題:here

當我引用電報(網絡),我發現,電報的消息不會有文字和圖片一起。 link

回答