Results 1 to 2 of 2

Thread: Building a richtext string with mixed text and image;

  1. #1
    Join Date
    Apr 2014
    Posts
    125
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Question Building a richtext string with mixed text and image;

    Hello

    I want to display a text followed by an image on my popup dialog. I don't want to create a qml item for that. I'm told that html richtext textFormat allows to build such strings.

    Any help on this will be very much appreciated.

    Thanks

    Mut

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Building a richtext string with mixed text and image;

    The img tag has a src attribute.
    Pass the URL for the image file or resource.
    If you only have the image data in memory, you can use a "data:" URI, see http://stackoverflow.com/questions/6...object-in-html

    But usually just having a Text and Image element anchored together is way easier.

    Cheers,
    _

Similar Threads

  1. Qt Designer String id instead of text
    By RolandHughes in forum Qt Tools
    Replies: 1
    Last Post: 23rd February 2014, 17:34
  2. Replies: 0
    Last Post: 13th April 2012, 14:45
  3. QString is a richText or plain text
    By SamSong in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2009, 01:19
  4. QTableWidgetItems, String + Image
    By shooogun in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2008, 05:53
  5. Create pixmap image from string
    By Morea in forum Qt Programming
    Replies: 5
    Last Post: 17th November 2006, 17:38

Tags for this Thread

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.