PDA

View Full Version : Displaying picture included with html code



Djony
27th November 2006, 13:29
This is html code which I use in my QLabel text field to include picture:


<html>
<head>
<meta name="qrichtext" content="1" />
</head><body style=" white-space: pre-wrap; font-family:MS Shell Dlg 2; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">

<p align=center style="color: dimgray; " margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
<span style=" font-size:80pt;">
Evaluator
</span>
</p>
<br>
<br>
<br>

<p style="color: grey; " margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
<span style=" font-size:20pt;">
<CENTER>< img src="Micronas-Logo-Transparent.PNG" ></CENTER>
<CENTER>Integrated Test Environment</CENTER>
</span>
</p>


</body>
</html>
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?

patrik08
27th November 2006, 17:15
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>
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-programming-2/t-qt4-qtextbrowser-and-image-size-win-1505.html/?highlight=loadResource

http://doc.trolltech.com/4.1/qtextbrowser.html#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;
}
}



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??