Results 1 to 2 of 2

Thread: Displaying picture included with html code

  1. #1
    Join Date
    Nov 2006
    Posts
    72
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Displaying picture included with html code

    This is html code which I use in my QLabel text field to include picture:
    [html]
    <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>[/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?
    Last edited by wysota; 28th November 2006 at 07:56. Reason: Changed [code] into [html]

  2. #2
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Displaying picture included with html code

    Quote Originally Posted by Djony View Post
    This is html code which I use in my QLabel text field to include picture:
    Qt Code:
    1. <meta name="qrichtext" content="1" />
    2. <CENTER>< img src="Micronas-Logo-Transparent.PNG" ></CENTER>
    3. <CENTER>Integrated Test Environment</CENTER>
    4. </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....:
    Qt Code:
    1. /* qt4.2 QResource to load image src=":/pic/name.xxx" */
    2. void Base_Function::RegisterImage( QString infile )
    3. {
    4. QResource newfileappender; /* infile is absolutePath */
    5. bool makehits;
    6. makehits = newfileappender.registerResource(infile, ":/pic/"); /* /pic/ */
    7. if (makehits) {
    8. qDebug() << "### register true " << infile;
    9. } else {
    10. qDebug() << "### register false " << infile;
    11. }
    12. }
    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??

Similar Threads

  1. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 22:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.