76 lines
1.9 KiB
C++
76 lines
1.9 KiB
C++
#ifndef DLGQRCODE_H
|
|
#define DLGQRCODE_H
|
|
|
|
#include <QDialog>
|
|
#include <QTextEdit>
|
|
#include "QtQREnCode/qrencode.h"
|
|
#include "QGraphicsScene"
|
|
#include "QGraphicsPixmapItem"
|
|
#include "SysPara.h"
|
|
|
|
namespace Ui {
|
|
class dlgQrCode;
|
|
}
|
|
|
|
class dlgQrCode : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit dlgQrCode(QWidget *parent = 0);
|
|
~dlgQrCode();
|
|
//dlgQrCode(qrOption_t *qrOption);
|
|
|
|
int bcWidth,bcHeight;
|
|
unsigned char flagInsert:1;
|
|
unsigned char flagCount:1;
|
|
unsigned char AutoCount11:1;
|
|
unsigned char barCodeFlag:1; //明码标志
|
|
unsigned char NNNCC:5;
|
|
QString pictureName;
|
|
int QRCntNum;
|
|
void SetOption(qrOption_t *qrOption);
|
|
void GetOption(qrOption_t *qrOption);
|
|
void extSetText(QString text, bool flag = false);
|
|
QString TextToQRImg(qrOption_t *qrVar);
|
|
int getDat(SysPara * sysPara,int varNum);
|
|
unsigned long counter;
|
|
|
|
void setCntCheckBoxHide(bool hideEn);
|
|
QString getCounterText( int counter,int QRCntNum);
|
|
void MatrixEnCode(unsigned char *intext,int Size);
|
|
void bindSysPara(SysPara * sysPara);
|
|
|
|
void bindTxTEdit(QTextEdit *textEdit);
|
|
public slots:
|
|
void onTextChanged();
|
|
signals:
|
|
void onQRCodeCloseNow();
|
|
|
|
void sig_qrCodeClose(QString str);
|
|
private slots:
|
|
void onQRCodeAuto(bool);
|
|
void on_pushBtnPreView_pressed();
|
|
void on_pushBtnClose_pressed();
|
|
void on_pushBtnSave_pressed();
|
|
void onComboBoxType(int);
|
|
void on_comboBox_QRCodeLevel_currentIndexChanged(int index);
|
|
|
|
private:
|
|
void ShowQRCode(QImage *img);
|
|
QGraphicsScene *scene;//声明scene
|
|
QGraphicsPixmapItem *item;//声明item
|
|
qrOption_t *qrOption;
|
|
bool AutoRefresh;
|
|
Ui::dlgQrCode *ui;
|
|
SysPara * sysPara;
|
|
QTextEdit* m_textEdit = nullptr;
|
|
|
|
bool editFlag = false;
|
|
private:
|
|
void insertQRCodeToEdit(QString codeName,int width,int height);
|
|
void printImage();
|
|
};
|
|
|
|
#endif // DLGQRCODE_H
|