2023-08-14 18:10:37 +08:00
|
|
|
#ifndef QRCODE_H
|
|
|
|
#define QRCODE_H
|
2023-08-08 15:44:10 +08:00
|
|
|
|
|
|
|
#include <QQuickItem>
|
|
|
|
#include <QQuickPaintedItem>
|
|
|
|
#include <QPainter>
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
2023-08-14 18:10:37 +08:00
|
|
|
class QRCode : public QQuickPaintedItem
|
2023-08-08 15:44:10 +08:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY_AUTO(QString,text)
|
|
|
|
Q_PROPERTY_AUTO(QColor,color)
|
2023-08-14 18:10:37 +08:00
|
|
|
Q_PROPERTY_AUTO(QColor,bgColor)
|
2023-08-08 15:44:10 +08:00
|
|
|
Q_PROPERTY_AUTO(int,size);
|
2023-08-14 18:10:37 +08:00
|
|
|
QML_NAMED_ELEMENT(QRCode)
|
2023-08-08 15:44:10 +08:00
|
|
|
public:
|
2023-08-14 18:10:37 +08:00
|
|
|
explicit QRCode(QQuickItem *parent = nullptr);
|
2023-08-08 15:44:10 +08:00
|
|
|
void paint(QPainter* painter) override;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2023-08-14 18:10:37 +08:00
|
|
|
#endif // QRCODE_H
|