
Originally Posted by
Djony
This is html code which I use in my QLabel text field to include picture:
<meta name="qrichtext" content="1" />
<CENTER>< img src="Micronas-Logo-Transparent.PNG" ></CENTER>
<CENTER>Integrated Test Environment</CENTER>
</html>
<meta name="qrichtext" content="1" />
<CENTER>< img src="Micronas-Logo-Transparent.PNG" ></CENTER>
<CENTER>Integrated Test Environment</CENTER>
</html>
To copy to clipboard, switch view to plain text mode
Now, I can't get this picture to show when I am running application, and I assume the problem is resource file. What do I need to type in my .qrc file to get my application to show picture included in this html code. Is there any tool to generate .qrc file or it should be made manually?
I like to know the same hack how this can load image....!!
i read this....
http://www.qtcentre.org/forum/f-qt-p...t=loadResource
http://doc.trolltech.com/4.1/qtextbr...l#loadResource
i test this only return false....:
/* qt4.2 QResource to load image src=":/pic/name.xxx" */
void Base_Function
::RegisterImage( QString infile
) {
QResource newfileappender;
/* infile is absolutePath */ bool makehits;
makehits = newfileappender.registerResource(infile, ":/pic/"); /* /pic/ */
if (makehits) {
qDebug() << "### register true " << infile;
} else {
qDebug() << "### register false " << infile;
}
}
/* qt4.2 QResource to load image src=":/pic/name.xxx" */
void Base_Function::RegisterImage( QString infile )
{
QResource newfileappender; /* infile is absolutePath */
bool makehits;
makehits = newfileappender.registerResource(infile, ":/pic/"); /* /pic/ */
if (makehits) {
qDebug() << "### register true " << infile;
} else {
qDebug() << "### register false " << infile;
}
}
To copy to clipboard, switch view to plain text mode
I think image is only possibel to load from resource file .... i tested absolute file path and not running!!
only loaded image (resource) can display OR how??
Bookmarks