[PyQt] retrieving images(blob) from sqlite db

Ali M adeadmarshal at gmail.com
Sat Aug 24 10:38:02 BST 2019


I've created a sqlite db with a blob field and put images in it. how can i
retrieve the images and show them in a qtextbrowser? i want to get the
images with a for loop something like the below code but i don't know how.

def readImage(self):
        cur = self.db.cursor()
        rows = cur.execute("select cover from covers")
        pm = QPixmap()
        for row in rows:
                pic = self.ui.label.setPixmap(QPixmap("row.jpg"))
                self.ui.textBrowser.insertFromMimeData(pic)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20190824/dc965b42/attachment.html>


More information about the PyQt mailing list