Results 1 to 20 of 25

Thread: Getting an image from mysql database (as BLOB field) through subclassed QSqlQueryMode

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #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: Getting an image from mysql database (as BLOB field) through subclassed QSqlQuery

    Your model needs to return some string id for each image when its data() method is called by the view.
    The view's delegate then needs to use that id to construct an "image://" URL.
    Your image provider then needs to convert the BLOB data for that id to a QImage.

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    MarkoSan (14th August 2015)

Similar Threads

  1. Replies: 4
    Last Post: 16th June 2011, 14:49
  2. Read BLOB from MySQL database
    By zero-n in forum Newbie
    Replies: 3
    Last Post: 22nd May 2011, 19:59
  3. How to update BLOB field in a SQLite database ?
    By aircraftstories in forum Qt Programming
    Replies: 6
    Last Post: 8th April 2011, 20:45
  4. Replies: 2
    Last Post: 17th February 2010, 14:32
  5. Replies: 1
    Last Post: 14th September 2009, 08:48

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.