0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-09-23 08:29:07 +03:00

Merge branch 'master' into 1.4

# Conflicts:
#	limereport/lrreportrender.cpp
This commit is contained in:
Arin Alexander
2016-09-28 02:27:45 +04:00
5 changed files with 44 additions and 21 deletions

View File

@@ -42,18 +42,24 @@ namespace {
}
namespace LimeReport {
QString findDatasourceName(BandDesignIntf* band){
if (!band) return "";
if (!band->datasourceName().isEmpty()) return band->datasourceName();
else return findDatasourceName(band->parentBand());
}
QWidget *GroupFieldPropItem::createProperyEditor(QWidget *parent) const
{
ComboBoxEditor *editor = new ComboBoxEditor(parent,true);
editor->setEditable(true);
GroupBandHeader *item=dynamic_cast<GroupBandHeader*>(object());
if (item){
DataBandDesignIntf* dataBand = dynamic_cast<DataBandDesignIntf*>(item->parentBand());
BandDesignIntf* dataBand = dynamic_cast<BandDesignIntf*>(item->parentBand());
if (dataBand){
int propertyIndex = dataBand->metaObject()->indexOfProperty("datasource");
if (item && propertyIndex>0){
editor->addItems(item->reportEditor()->dataManager()->fieldNames(dataBand->property("datasource").toString()));
QString datasourceName = findDatasourceName(dataBand);
if (!datasourceName.isEmpty()){
editor->addItems(item->reportEditor()->dataManager()->fieldNames(datasourceName));
}
}
}