mirror of
https://github.com/fralx/LimeReport.git
synced 2025-10-04 04:06:43 +03:00
added proxyModel to filter datasource for groupHeader
This commit is contained in:
@@ -514,11 +514,14 @@ TextItem::TextPtr TextItem::textDocument() const
|
||||
QString content = m_trimValue ? m_strText.trimmed() : m_strText;
|
||||
|
||||
if (allowHTML())
|
||||
{
|
||||
if (isReplaceCarriageReturns()){
|
||||
text->setHtml(replaceReturns(content));
|
||||
} else {
|
||||
text->setHtml(content);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
text->setPlainText(content);
|
||||
|
||||
@@ -533,7 +536,7 @@ TextItem::TextPtr TextItem::textDocument() const
|
||||
to.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
|
||||
else to.setWrapMode(QTextOption::NoWrap);
|
||||
|
||||
text->setDocumentMargin(0);
|
||||
text->setDocumentMargin(marginSize());
|
||||
text->setDefaultTextOption(to);
|
||||
|
||||
QFont _font = transformToSceneFont(font());
|
||||
|
@@ -99,7 +99,7 @@ bool QueryHolder::runQuery(IDataSource::DatasourceMode mode)
|
||||
if (m_dataSource)
|
||||
m_dataSource.clear();
|
||||
setLastError(model->lastError().text());
|
||||
delete model;
|
||||
//delete model;
|
||||
return false;
|
||||
} else { setLastError("");}
|
||||
|
||||
|
@@ -329,6 +329,7 @@ bool DataSourceManager::addModel(const QString &name, QAbstractItemModel *model,
|
||||
} catch (ReportError &e){
|
||||
putError(e.what());
|
||||
setLastError(e.what());
|
||||
delete model;
|
||||
return false;
|
||||
}
|
||||
emit datasourcesChanged();
|
||||
|
@@ -968,9 +968,14 @@ void ReportRender::renderGroupHeader(BandDesignIntf *parentBand, IDataSource* da
|
||||
GroupBandHeader *group = dynamic_cast<GroupBandHeader*>(parentBand);
|
||||
if(dataSource->model() && group && !group->groupFieldName().isEmpty() && !m_dataSourceSorted)
|
||||
{
|
||||
dataSource->model()->sort(dataSource->columnIndexByName(group->groupFieldName()),group->SortFieldNameBy());
|
||||
qDebug()<<"sorted;";
|
||||
m_dataSourceSorted = true;
|
||||
MasterDetailProxyModel *proxyModel = static_cast<MasterDetailProxyModel*>(dataSource->model());
|
||||
if(proxyModel)
|
||||
{
|
||||
proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
|
||||
proxyModel->sort(dataSource->columnIndexByName(group->groupFieldName()),group->SortFieldNameBy());
|
||||
m_dataSourceSorted = true;
|
||||
}
|
||||
}
|
||||
|
||||
foreach(BandDesignIntf* band,parentBand->childrenByType(BandDesignIntf::GroupHeader)){
|
||||
|
Reference in New Issue
Block a user