D10433: Add QML support for Prison
Volker Krause
noreply at phabricator.kde.org
Sun Feb 11 08:48:35 UTC 2018
vkrause added inline comments.
INLINE COMMENTS
> davidedmundson wrote in barcodequickitem.cpp:37
> Is createBarcode a heavy function? It sounds like it could be.
>
> If so I'd recommend using QQmlParserStatus so you don't generate it 4 times on startup as each property gets set.
Right, that's cleaner, I'll fix that.
> davidedmundson wrote in barcodequickitem.cpp:113
> you have the actual up-to-date item size from inside paint. Would that be better than minimumSize?
>
> Please also change to
>
> img = m_barcode->toImage(size * qApp->devicePixelRatio());
> img.setDevicePixelRatio(qApp->devicePixelRatio());
>
> for high DPI support.
I don't think any of this makes a visual difference here, as the image is ultimately just a black/white pattern that is scaled with nearest neighbor scaling anyway, we'd just be moving that scaling around a bit. Results look sharp here at 1x/1.5x/2x scaling and are detected correctly by the barcode scanner.
> davidedmundson wrote in barcodequickitem.cpp:131
> You're doing this in the paint, do you need to do this here?
That's an issue with Prison, you only get a valid minimum size after one call to toImage(). I'll add a comment about that.
REPOSITORY
R280 Prison
REVISION DETAIL
https://phabricator.kde.org/D10433
To: vkrause, #frameworks, svuorela
Cc: davidedmundson, michaelh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180211/106e916b/attachment.html>
More information about the Kde-frameworks-devel
mailing list