0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-04-05 17:03:46 +03:00

Some changes

This commit is contained in:
Sanych 2023-11-14 11:37:14 +03:00
parent 85ec78dd3d
commit 8dd7540a8b
5 changed files with 36 additions and 3 deletions

View File

@ -49,7 +49,7 @@ BarcodeItem::BarcodeItem(QObject* owner,QGraphicsItem* parent)
: ContentItemDesignIntf(xmlTag,owner,parent),m_designTestValue("1"), m_barcodeType(CODE128), : ContentItemDesignIntf(xmlTag,owner,parent),m_designTestValue("1"), m_barcodeType(CODE128),
m_foregroundColor(Qt::black), m_backgroundColor(Qt::white), m_whitespace(10), m_angle(Angle0), m_foregroundColor(Qt::black), m_backgroundColor(Qt::white), m_whitespace(10), m_angle(Angle0),
m_barcodeWidth(0), m_securityLevel(0), m_pdf417CodeWords(928), m_inputMode(UNICODE_INPUT_MODE), m_barcodeWidth(0), m_securityLevel(0), m_pdf417CodeWords(928), m_inputMode(UNICODE_INPUT_MODE),
m_hideText(false), m_option3(0), m_hideIfEmpty(false) m_escapeMode(false), m_hideText(false), m_option3(0), m_hideIfEmpty(false)
{} {}
BarcodeItem::~BarcodeItem() BarcodeItem::~BarcodeItem()
@ -66,7 +66,10 @@ void BarcodeItem::paint(QPainter *ppainter, const QStyleOptionGraphicsItem *opti
Zint::QZint bc; Zint::QZint bc;
if (itemMode() & DesignMode) bc.setText(m_designTestValue); if (itemMode() & DesignMode) bc.setText(m_designTestValue);
else bc.setText(m_content); else bc.setText(m_content);
bc.setInputMode(m_inputMode); if(m_escapeMode)
bc.setInputMode(m_inputMode | ESCAPE_MODE);
else
bc.setInputMode(m_inputMode);
bc.setSymbol(m_barcodeType); bc.setSymbol(m_barcodeType);
bc.setWhitespace(m_whitespace); bc.setWhitespace(m_whitespace);
bc.setFgColor(m_foregroundColor); bc.setFgColor(m_foregroundColor);
@ -282,6 +285,23 @@ void BarcodeItem::setInputMode(const InputMode &inputMode)
} }
} }
bool LimeReport::BarcodeItem::escapeMode() const
{
return m_escapeMode;
}
void LimeReport::BarcodeItem::setEscapeMode(bool escapeMode)
{
if (m_escapeMode != escapeMode){
bool oldValue = m_escapeMode;
m_escapeMode = escapeMode;
if (!isLoading()){
update();
notify("escapeMode",oldValue,escapeMode);
}
}
}
bool BarcodeItem::hideText() const bool BarcodeItem::hideText() const
{ {
return m_hideText; return m_hideText;

View File

@ -49,6 +49,7 @@ class BarcodeItem : public LimeReport::ContentItemDesignIntf {
Q_PROPERTY(int securityLevel READ securityLevel WRITE setSecurityLevel) Q_PROPERTY(int securityLevel READ securityLevel WRITE setSecurityLevel)
Q_PROPERTY(int pdf417CodeWords READ pdf417CodeWords WRITE setPdf417CodeWords) Q_PROPERTY(int pdf417CodeWords READ pdf417CodeWords WRITE setPdf417CodeWords)
Q_PROPERTY(InputMode inputMode READ inputMode WRITE setInputMode) Q_PROPERTY(InputMode inputMode READ inputMode WRITE setInputMode)
Q_PROPERTY(bool escapeMode READ escapeMode WRITE setEscapeMode)
Q_PROPERTY(bool hideText READ hideText WRITE setHideText) Q_PROPERTY(bool hideText READ hideText WRITE setHideText)
Q_PROPERTY(int option3 READ option3 WRITE setOption3) Q_PROPERTY(int option3 READ option3 WRITE setOption3)
Q_PROPERTY(bool hideIfEmpty READ hideIfEmpty WRITE setHideIfEmpty) Q_PROPERTY(bool hideIfEmpty READ hideIfEmpty WRITE setHideIfEmpty)
@ -193,6 +194,8 @@ public:
void setPdf417CodeWords(int pdf417CodeWords); void setPdf417CodeWords(int pdf417CodeWords);
InputMode inputMode() const; InputMode inputMode() const;
void setInputMode(const InputMode &inputMode); void setInputMode(const InputMode &inputMode);
bool escapeMode() const;
void setEscapeMode(bool escapeMode);
bool hideText() const; bool hideText() const;
void setHideText(bool hideText); void setHideText(bool hideText);
int option3() const; int option3() const;
@ -218,6 +221,7 @@ private:
int m_securityLevel; int m_securityLevel;
int m_pdf417CodeWords; int m_pdf417CodeWords;
InputMode m_inputMode; InputMode m_inputMode;
bool m_escapeMode;
bool m_hideText; bool m_hideText;
int m_option3; int m_option3;
bool m_hideIfEmpty; bool m_hideIfEmpty;

View File

@ -915,6 +915,11 @@ void ReportDesignWindow::restoreSetting()
createRecentFilesMenu(); createRecentFilesMenu();
} }
QImage ReportDesignWindow::previewImage(int pageN)
{
return QImage{};
}
bool ReportDesignWindow::checkNeedToSave() bool ReportDesignWindow::checkNeedToSave()
{ {
if (m_reportDesignWidget->isNeedToSave()){ if (m_reportDesignWidget->isNeedToSave()){

View File

@ -71,6 +71,8 @@ public:
QSettings* settings(); QSettings* settings();
void restoreSetting(); void restoreSetting();
void setShowProgressDialog(bool value){m_showProgressDialog = value;} void setShowProgressDialog(bool value){m_showProgressDialog = value;}
void newReport() { slotNewReport();}
QImage previewImage(int pageN = 0);
private slots: private slots:
void slotNewReport(); void slotNewReport();
void slotNewPage(); void slotNewPage();

View File

@ -3,10 +3,11 @@
#include <QMainWindow> #include <QMainWindow>
#include <QSettings> #include <QSettings>
#include "lrglobal.h"
namespace LimeReport { namespace LimeReport {
class ReportDesignWindowInterface: public QMainWindow{ class LIMEREPORT_EXPORT ReportDesignWindowInterface: public QMainWindow{
public: public:
ReportDesignWindowInterface(QWidget* parent = 0): QMainWindow(parent){} ReportDesignWindowInterface(QWidget* parent = 0): QMainWindow(parent){}
virtual bool checkNeedToSave() = 0; virtual bool checkNeedToSave() = 0;
@ -16,6 +17,7 @@ public:
virtual QSettings* settings() = 0; virtual QSettings* settings() = 0;
virtual void restoreSetting() = 0; virtual void restoreSetting() = 0;
virtual void setShowProgressDialog(bool value) = 0; virtual void setShowProgressDialog(bool value) = 0;
virtual void newReport() = 0;
}; };
} // namespace LimeReport } // namespace LimeReport