|
CenGen - Генератор ценников
1.1
|
00001 #ifndef BARCODE_H 00002 #define BARCODE_H 00003 #include <QGraphicsScene> 00004 #include <QList> 00005 #include <QFont> 00006 #include "imagebox.h" 00007 00008 00009 class Barcode : public ImageBox { 00010 00011 private: 00012 QList<bool> lines; //95 штрихов 00013 QString barcode; //содержит текстовую строку-штрихкод 00014 //int font; //штрифт для нанесения цифр внизу штрихкода 00015 QFont font; 00016 bool renderNumbers; //если 1 - будут рисоваться цифры внизу штрих-кода 00017 float textOtstup; //отступ цифр от линий штрих-кода 00018 float lineAddition; //удлинение линий служебных штрихов 00019 QGraphicsItemGroup *items; //собираем все элементы штрих-кода в группу 00020 00021 public: 00022 Barcode(QString text = "0000000000000"); 00023 ~Barcode(); 00024 QString found_lost_digit(QString text); 00025 00026 public slots: 00027 void update(QString text = "0000000000000"); 00028 bool is_valid(); 00029 bool setText(QString barcode); 00030 QList<bool> TextToBit(); 00031 QGraphicsItemGroup *render (QGraphicsScene * scene, QRectF* rect); 00032 QString getText(); 00033 void setFont(QFont font); 00034 void setTextOtstup (int otstup); 00035 void setLineAddition (int addition); 00036 void setRenderDigits(bool param); 00037 00038 00039 00040 private slots: 00041 QString GCode(QString text); 00042 QString RCode(QString text); 00043 int correctSymbol(QChar symbol); 00044 00045 }; 00046 00047 #endif // BARCODE_H