Index: sources/gui/GuiView.cpp =================================================================== diff -u -r689177edf29dee6f10bebfed42f6bbadeb7ce8a8 -rd26aff743bca7eceb609ce5b30cea7cbfa39748f --- sources/gui/GuiView.cpp (.../GuiView.cpp) (revision 689177edf29dee6f10bebfed42f6bbadeb7ce8a8) +++ sources/gui/GuiView.cpp (.../GuiView.cpp) (revision d26aff743bca7eceb609ce5b30cea7cbfa39748f) @@ -19,6 +19,8 @@ #include "DeviceController.h" #include "FileHandler.h" +#include "qrcodegen.h" + // namespace using namespace Gui; @@ -407,3 +409,17 @@ void GuiView::doQuitApplication() { emit didQuitApplication(); } + +/*! + * \brief doGenerateQRImage + * \details should be called with the given vText to update the qrImageSource property for an image source. + * \param vText - the given text for the QR Code + */ +void GuiView::doGenerateQRImage(const QString &vText) +{ + const uint border = 1; + qrcodegen::QrCode qr = qrcodegen::QrCode::encodeText(vText.toLatin1().constData(), qrcodegen::QrCode::Ecc::MEDIUM); + std::string svg = qrcodegen::QrCode::toSvgString(qr, border); + QString svgSource = QString("").fromStdString(svg); + qrImageSource(svgSource); +}