Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am finding it difficult to display retrieved photo varbinary data as a photo (an image). I have a qtablewidget where the retrieved data are stored. The varbinary data gets displayed there. I am coding in Python, managing my database with Microsoft SQL, pyodbc

I have a qformLayout below it where I append the data of the qTablewidget to. Now in the qformlayout, I want the photo to display, not the varbinary text. How do I go about it?

NOTE: I successfully retrieved my all the records and append them in their respective form cell when highlighted, my challenge is displaying the retrieved varbinary data as an image, not byte

What I have tried:

Here are some of the codes I have tried:

itemList.append(self.passlb)

for row in rows:
    for col in range(self.tab.columnCount()):
        itemArray = self.tab.item(row, col)
        text = "" if itemArray is None else itemArray.text()

         if (col == 14):
            itemList[12].open('rb')


passlb = the passport photograph label i.e QLabel("Passport photo")
in my database table, the passport is in column 14, in my qformlayout, the passport is appended in row 12
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900