S
S
Sasha Tsikhun2021-06-20 16:15:28
Python
Sasha Tsikhun, 2021-06-20 16:15:28

Display photo from database in table widget?

How can I get a photo from the Database instead?
60cf3e83b4b8c138869742.jpeg
Tell me, please, how to do this, or what to read?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
acwartz, 2021-06-21
@acwartz

b - binary. Upload to the stream, and then to the container for displaying pictures.

qp = QPixmap()
qp.loadFromData(my_bytes)

where my_bytes is the binary data of the Photo field.
Instead of photo, store a link (integer) to the Photos table where the BLOB with the data will be placed, it will be faster to work with the table, and you can display the picture when it is really needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question