Class WQrCode

Direct Known Subclasses:
TotpQrCode

public class WQrCode extends WPaintedWidget
A widget representing a QR code.

This widget allows to generate QR code from a string.

If you wish to alter the look of the QR code (to add a logo in the middle for instance), you can override paintEvent. However, you will still need to call the paintEvent() to generate the QR code itself.

The content that is encoded is taken as-is. If the purpose of your QR code requires special formatting, the formatted string needs to be supplied to the constructor.

By default, the generated QR code will use the lowest possible error correction, and a square size of 5 pixels.

Usage example:


 String website = "https://webtoolkit.eu";
 WApplication app = WApplication.getInstance();
 app.getRoot().addWidget(new WQrCode(website));