1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/src/misc/qrwidget.h

26 lines
462 B
C
Raw Normal View History

2015-03-07 20:40:45 +08:00
#ifndef QRWIDGET_H
#define QRWIDGET_H
// https://stackoverflow.com/questions/21400254/how-to-draw-a-qr-code-with-qt-in-native-c-c
#include <QWidget>
class QRWidget : public QWidget
{
Q_OBJECT
2015-03-07 20:40:45 +08:00
public:
explicit QRWidget(QWidget *parent = 0);
void setQRData(const QString& data);
QImage* getImage();
bool saveImage(QString path);
2015-03-07 20:40:45 +08:00
private:
QString data;
void paintImage();
QImage* image;
2015-03-07 20:40:45 +08:00
QSize size;
};
#endif // QRWIDGET_H