[PyQt] QLabel with scaled contents pixmap not updated after painting

Maurizio Berti maurizio.berti at gmail.com
Tue Nov 26 13:51:45 GMT 2019


Il giorno mar 26 nov 2019 alle ore 14:00 Florian Bruhin <me at the-compiler.org>
ha scritto:
> I can reproduce with Qt 5.14, but I don't think it necessarily is a Qt
bug.
>
> Looking at the code, turning on scaledContents resizes the underlying
pixmap
> once and then caches it:
>
>
https://github.com/qt/qtbase/blob/v5.14.0-beta3/src/widgets/widgets/qlabel.cpp#L1092-L1104

Oh, I see.

> What's your actual usecase? You could probably either modify/redisplay the
> pixmap, or perhaps have a widget with a transparent background over the
QLabel
> instead.

I don't really need it right now, I just stumbled upon it from this
question:
https://stackoverflow.com/q/59047167/2001654

I can understand the behavior (and the necessity for caching), and the fact
that
technically it's not a bug, but still looks a bit consistent and might be
useful
to notify the team (possibly by adding a note in the docs).

Thank you,
Maurizio
-- 
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20191126/9bc15446/attachment.html>


More information about the PyQt mailing list