Qt Code:
  1. void WaypointItem::cambiarPrevio(){
  2. QString texto(m_texto);
  3.  
  4. texto=texto.replace("%WAYPOINT%", m_waypoint!="" ? m_waypoint : " -- VACIO -- ");
  5. texto=texto.replace("%DISTANCIA%", QString("%1 metros").arg(m_distancia));
  6. texto=texto.replace("%TIEMPO%", QString("%1 minutos").arg(m_tiempo));
  7. texto=texto.replace("%IMAGEN1%", "imagen1.png");
  8. texto=texto.replace("%IMAGEN2%", "imagen2.png");
  9. QPixmap imagen1;
  10. imagen1.loadFromData(m_imagen1);
  11. doc->addResource(QTextDocument::ImageResource, QUrl("imagen1.png"), imagen1);
  12. QPixmap imagen2;
  13. imagen2.loadFromData(m_imagen1);
  14. doc->addResource(QTextDocument::ImageResource, QUrl("imagen2.png"), imagen1);
  15.  
  16. doc->setHtml(texto);
  17. setDocument(doc);
  18. }
To copy to clipboard, switch view to plain text mode 

It appears to work perfect.

Thank's