Merge branch 'master' into develop

# Conflicts:
#	limereport/objectinspector/propertyItems/lrdatasourcepropitem.cpp
This commit is contained in:
Arin Alexander 2019-05-12 23:15:07 +03:00
commit 3f0558f2e9
5 changed files with 3370 additions and 2 deletions

View File

@ -115,6 +115,36 @@ void BarcodeItem::setContent(const QString &content)
}
}
QString BarcodeItem::datasource() const
{
return m_datasource;
}
void BarcodeItem::setDatasource(const QString &datasource)
{
if (m_datasource != datasource){
QString oldValue = m_datasource;
m_datasource = datasource;
update();
notify("datasource", oldValue, datasource);
}
}
QString BarcodeItem::field() const
{
return m_field;
}
void BarcodeItem::setField(const QString &field)
{
if (m_field != field){
QString oldValue = m_field;
m_field = field;
update();
notify("field", oldValue, field);
}
}
void BarcodeItem::setBarcodeType(BarcodeItem::BarcodeType value)
{
if (m_barcodeType!=value){
@ -268,12 +298,38 @@ void BarcodeItem::setHideText(bool hideText)
void BarcodeItem::updateItemSize(DataSourceManager* dataManager, RenderPass pass, int maxHeight)
{
switch(pass){
if (content().isEmpty())
{
if (!m_datasource.isEmpty() && !m_field.isEmpty())
{
IDataSource* ds = dataManager->dataSource(m_datasource);
if (ds)
{
QVariant data = ds->data(m_field);
if (data.isValid())
{
switch(pass)
{
case FirstPass:
setContent(expandUserVariables(data.toString(),pass,NoEscapeSymbols, dataManager));
setContent(expandDataFields(data.toString(), NoEscapeSymbols, dataManager));
break;
default:;
}
}
}
}
}
else
{
switch(pass)
{
case FirstPass:
setContent(expandUserVariables(content(),pass,NoEscapeSymbols, dataManager));
setContent(expandDataFields(content(), NoEscapeSymbols, dataManager));
break;
default:;
}
}
BaseDesignIntf::updateItemSize(dataManager, pass, maxHeight);
}

View File

@ -40,6 +40,8 @@ class BarcodeItem : public LimeReport::ContentItemDesignIntf {
Q_ENUMS(InputMode)
Q_PROPERTY(QString content READ content WRITE setContent)
Q_PROPERTY(BarcodeType barcodeType READ barcodeType WRITE setBarcodeType )
Q_PROPERTY(QString datasource READ datasource WRITE setDatasource)
Q_PROPERTY(QString field READ field WRITE setField)
Q_PROPERTY(QString testValue READ designTestValue WRITE setDesignTestValue)
Q_PROPERTY(QColor foregroundColor READ foregroundColor WRITE setForegroundColor)
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
@ -163,6 +165,10 @@ public:
QString content() const {return m_content;}
void setBarcodeType(BarcodeType value);
BarcodeType barcodeType(){return m_barcodeType;}
QString datasource() const;
void setDatasource(const QString &datasource);
QString field() const;
void setField(const QString &field);
void setDesignTestValue(QString value);
QString designTestValue(){return m_designTestValue;}
QColor foregroundColor(){return m_foregroundColor;}
@ -188,6 +194,8 @@ public:
private:
QString m_content;
QString m_datasource;
QString m_field;
QString m_designTestValue;
BarcodeType m_barcodeType;
QColor m_foregroundColor;

View File

@ -111,7 +111,7 @@ INSTALLS += target
####Automatically build required translation files (*.qm)
contains(CONFIG,build_translations){
LANGUAGES = ru es_ES ar fr zh
LANGUAGES = ru es_ES ar fr zh pl
defineReplace(prependAll) {
for(a,$$1):result += $$2$${a}$$3

View File

@ -48,14 +48,25 @@ namespace{
bool VARIABLE_IS_NOT_USED registredDatasouceProp = LimeReport::ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("datasource","LimeReport::DataBandDesignIntf"),QObject::tr("datasource"),createDatasourcePropItem
);
bool VARIABLE_IS_NOT_USED registredImageDatasouceProp = LimeReport::ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("datasource","LimeReport::ImageItem"),QObject::tr("datasource"),createDatasourcePropItem
);
bool VARIABLE_IS_NOT_USED registredImageFieldProp = LimeReport::ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("field","LimeReport::ImageItem"),QObject::tr("field"),createFieldPropItem
);
bool VARIABLE_IS_NOT_USED registredChartDatasouceProp = LimeReport::ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("datasource","LimeReport::ChartItem"),QObject::tr("datasource"),createDatasourcePropItem
);
bool VARIABLE_IS_NOT_USED registredBarcodeDatasouceProp = LimeReport::ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("datasource","LimeReport::BarcodeItem"),QObject::tr("datasource"),createDatasourcePropItem
);
bool VARIABLE_IS_NOT_USED registredBarcodeFieldProp = LimeReport::ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("field","LimeReport::BarcodeItem"),QObject::tr("field"),createFieldPropItem
);
}

File diff suppressed because it is too large Load Diff