D10433: Add QML support for Prison

Volker Krause noreply at phabricator.kde.org
Mon Feb 19 13:37:18 UTC 2018


vkrause added a comment.


  The interface for outputting barcodes is currently QImage. The problem is that QtQuick cannot directly consume a QImage without custom glue code (image provider, custom item, etc), unlike e.g. a QLabel. Using an image provider would allow standard Image elements to consume the barcode, I decided against that approach though as the "API" in that case is an URL, ie. you'd need to encode the content, the type and any other parameter inside a single URL. This might be conceptually cleaner, but as an "API" it is just plain ugly.
  
  Supporting custom AbstractBarcode subclasses is indeed something I haven't thought about. It would probably require you to obtain an instance somehow and pass that into the Barcode element as an opaque handle as far as QML is concerned. This would need an additional property on the Barcode element, not a big deal I think. I'm reluctant to add this blindly now though, given I have no actual test-case for this.
  
  Therefore, for me the choice here is mostly about where to put the necessary glue code, with the alternative being my application (I don't think a tier2 KF5PrisonQuick makes sense for this). With Plasma apparently having similar needs sharing this somewhere seems sensible though.

REPOSITORY
  R280 Prison

REVISION DETAIL
  https://phabricator.kde.org/D10433

To: vkrause, #frameworks, svuorela
Cc: broulik, davidedmundson, michaelh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180219/cb88b3e6/attachment.html>


More information about the Kde-frameworks-devel mailing list