mirror of
https://github.com/fralx/LimeReport.git
synced 2025-12-14 08:50:58 +03:00
Add barcodeVariablesList
This commit is contained in:
@@ -31,6 +31,9 @@
|
||||
#include "lrdesignelementsfactory.h"
|
||||
#include "qzint.h"
|
||||
#include "lrglobal.h"
|
||||
#include "objectinspector/editors/lrtextitempropertyeditor.h"
|
||||
#include <QApplication>
|
||||
#include "lrreportdesignwindow.h"
|
||||
|
||||
namespace{
|
||||
|
||||
@@ -46,9 +49,9 @@ bool VARIABLE_IS_NOT_USED registred = LimeReport::DesignElementsFactory::instanc
|
||||
namespace LimeReport{
|
||||
|
||||
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(EAN128),
|
||||
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(GS1_INPUT_MODE),
|
||||
m_escapeMode(false), m_hideText(false), m_option3(0), m_hideIfEmpty(false)
|
||||
{}
|
||||
|
||||
@@ -353,6 +356,21 @@ bool BarcodeItem::isEmpty() const
|
||||
return m_content.isEmpty();
|
||||
}
|
||||
|
||||
QWidget *BarcodeItem::defaultEditor()
|
||||
{
|
||||
ReportDesignWindow* dw = nullptr;
|
||||
auto re = reportEditor();
|
||||
if(re)
|
||||
dw = dynamic_cast<ReportDesignWindow*>(re->getDesignerWindow());
|
||||
qDebug() << re << dw;
|
||||
auto editor =
|
||||
new TextItemPropertyEditor(QApplication::activeWindow(),
|
||||
dw ? dw->barcodeVariables() : QStringList{});
|
||||
editor->setText(m_content);
|
||||
editor->setAttribute(Qt::WA_DeleteOnClose);
|
||||
return editor;
|
||||
}
|
||||
|
||||
void BarcodeItem::expandContent(QString data, DataSourceManager* dataManager, RenderPass pass)
|
||||
{
|
||||
setContent(expandUserVariables(data, pass, NoEscapeSymbols, dataManager));
|
||||
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
bool hideIfEmpty() const;
|
||||
void setHideIfEmpty(bool hideIfEmpty);
|
||||
bool isEmpty() const;
|
||||
|
||||
QWidget * defaultEditor();
|
||||
private:
|
||||
void expandContent(QString data, DataSourceManager *dataManager, RenderPass pass);
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ LimeReport::BaseDesignIntf * createTextItem(QObject* owner, LimeReport::BaseDesi
|
||||
return new LimeReport::TextItem(owner,parent);
|
||||
}
|
||||
bool VARIABLE_IS_NOT_USED registred = LimeReport::DesignElementsFactory::instance().registerCreator(xmlTag, LimeReport::ItemAttribs(QObject::tr("Text Item"),"TextItem"), createTextItem);
|
||||
|
||||
}
|
||||
|
||||
namespace LimeReport{
|
||||
|
||||
Reference in New Issue
Block a user