From 8dd7540a8b59db780a79d9d9a7a47fa981eb6116 Mon Sep 17 00:00:00 2001 From: Sanych Date: Tue, 14 Nov 2023 11:37:14 +0300 Subject: [PATCH] Some changes --- limereport/items/lrbarcodeitem.cpp | 24 +++++++++++++++++++-- limereport/items/lrbarcodeitem.h | 4 ++++ limereport/lrreportdesignwindow.cpp | 5 +++++ limereport/lrreportdesignwindow.h | 2 ++ limereport/lrreportdesignwindowintrerface.h | 4 +++- 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/limereport/items/lrbarcodeitem.cpp b/limereport/items/lrbarcodeitem.cpp index 78a242c..1bf9128 100644 --- a/limereport/items/lrbarcodeitem.cpp +++ b/limereport/items/lrbarcodeitem.cpp @@ -49,7 +49,7 @@ BarcodeItem::BarcodeItem(QObject* owner,QGraphicsItem* parent) : 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_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() @@ -66,7 +66,10 @@ void BarcodeItem::paint(QPainter *ppainter, const QStyleOptionGraphicsItem *opti Zint::QZint bc; if (itemMode() & DesignMode) bc.setText(m_designTestValue); 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.setWhitespace(m_whitespace); 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 { return m_hideText; diff --git a/limereport/items/lrbarcodeitem.h b/limereport/items/lrbarcodeitem.h index b156c14..59c9a15 100644 --- a/limereport/items/lrbarcodeitem.h +++ b/limereport/items/lrbarcodeitem.h @@ -49,6 +49,7 @@ class BarcodeItem : public LimeReport::ContentItemDesignIntf { Q_PROPERTY(int securityLevel READ securityLevel WRITE setSecurityLevel) Q_PROPERTY(int pdf417CodeWords READ pdf417CodeWords WRITE setPdf417CodeWords) 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(int option3 READ option3 WRITE setOption3) Q_PROPERTY(bool hideIfEmpty READ hideIfEmpty WRITE setHideIfEmpty) @@ -193,6 +194,8 @@ public: void setPdf417CodeWords(int pdf417CodeWords); InputMode inputMode() const; void setInputMode(const InputMode &inputMode); + bool escapeMode() const; + void setEscapeMode(bool escapeMode); bool hideText() const; void setHideText(bool hideText); int option3() const; @@ -218,6 +221,7 @@ private: int m_securityLevel; int m_pdf417CodeWords; InputMode m_inputMode; + bool m_escapeMode; bool m_hideText; int m_option3; bool m_hideIfEmpty; diff --git a/limereport/lrreportdesignwindow.cpp b/limereport/lrreportdesignwindow.cpp index 881184e..cc0800c 100644 --- a/limereport/lrreportdesignwindow.cpp +++ b/limereport/lrreportdesignwindow.cpp @@ -915,6 +915,11 @@ void ReportDesignWindow::restoreSetting() createRecentFilesMenu(); } +QImage ReportDesignWindow::previewImage(int pageN) +{ + return QImage{}; +} + bool ReportDesignWindow::checkNeedToSave() { if (m_reportDesignWidget->isNeedToSave()){ diff --git a/limereport/lrreportdesignwindow.h b/limereport/lrreportdesignwindow.h index 365c722..8aa9448 100644 --- a/limereport/lrreportdesignwindow.h +++ b/limereport/lrreportdesignwindow.h @@ -71,6 +71,8 @@ public: QSettings* settings(); void restoreSetting(); void setShowProgressDialog(bool value){m_showProgressDialog = value;} + void newReport() { slotNewReport();} + QImage previewImage(int pageN = 0); private slots: void slotNewReport(); void slotNewPage(); diff --git a/limereport/lrreportdesignwindowintrerface.h b/limereport/lrreportdesignwindowintrerface.h index 858881e..23c5b93 100644 --- a/limereport/lrreportdesignwindowintrerface.h +++ b/limereport/lrreportdesignwindowintrerface.h @@ -3,10 +3,11 @@ #include #include +#include "lrglobal.h" namespace LimeReport { -class ReportDesignWindowInterface: public QMainWindow{ +class LIMEREPORT_EXPORT ReportDesignWindowInterface: public QMainWindow{ public: ReportDesignWindowInterface(QWidget* parent = 0): QMainWindow(parent){} virtual bool checkNeedToSave() = 0; @@ -16,6 +17,7 @@ public: virtual QSettings* settings() = 0; virtual void restoreSetting() = 0; virtual void setShowProgressDialog(bool value) = 0; + virtual void newReport() = 0; }; } // namespace LimeReport