Write the HTML to use relative paths:
<html>
<body>
<img src="test.png"/> <!-- relative path >
</body>
</html>
<html>
<body>
<img src="test.png"/> <!-- relative path >
</body>
</html>
To copy to clipboard, switch view to plain text mode
put the HTML and image in the same place in the resources:
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>./test.html</file>
<file>./test.png</file>
</qresource>
</RCC>
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>./test.html</file>
<file>./test.png</file>
</qresource>
</RCC>
To copy to clipboard, switch view to plain text mode
then load the HTML using QTextBrowser::setSource():
#include <QApplication>
#include <QTextBrowser>
int main(int argc, char **argv)
{
tb.show();
return app.exec();
}
#include <QApplication>
#include <QTextBrowser>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QTextBrowser tb;
tb.setSource(QUrl(QLatin1String("qrc:/test.html")));
tb.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks