SUMMARY By scanning with webcam, a qr code of a paper ticket or a ticket displayed on the monitor, by reading a qr code when displaying a pdf of a ticket with okular, get the same dialog window as we get in kmail when displaying a ticket mail. Thanks
Created attachment 148403 [details] dialog window
At least directly scanning QR codes is being worked on already: https://volkerkrause.eu/2022/04/02/kde-itinerary-february-march-2022.html Most tickets have fewer details in the barcode than the full document though, due to the severely constrained space in there.
I speak about the pdf of a ticket because if you buy a ticket at sncf-connect.com then you can receive a confirmation mail and from your SNCf account you can download the pdf ticket If you think reading all the pdf and not only the qr code is better then i agree with you.
About the PDF, I think about some sort of okular plugin as the kmail plugin.
about scanning a qr code i think about a korganizer plugin.
I need to check whether Okular has a plugin interface for something like that at all yet, the extractor side of this should be straightforward (it has already been demonstrated for the PDF viewer integrated in web browsers: https://blog.broulik.de/2020/02/plasma-browser-integration-itinerary-integration/). For the barcode scanning, once we have the general infrastructure for that, there's indeed multiple ways we can integrate that. Qrca (the Plasma Mobile barcode scanner) for example already recognizes some ticket codes, but could offer more alternatives to deal with them, like directly adding a calendar entry as you suggest. Triggering a scan directly from within the calendar is also a possibility then.