mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2025-03-20 01:03:53 +03:00
Script editor has been fixed
This commit is contained in:
parent
edbba49114
commit
9be042819b
@ -204,24 +204,27 @@ void ReportStructureCompleater::addAdditionalDatawords(QStandardItemModel* model
|
|||||||
}
|
}
|
||||||
if (it.value().isQObject()){
|
if (it.value().isQObject()){
|
||||||
if (it.value().toQObject()){
|
if (it.value().toQObject()){
|
||||||
QStandardItem* objectNode = new QStandardItem;
|
if (model->findItems(it.name()).isEmpty()){
|
||||||
objectNode->setText(it.name());
|
QStandardItem* objectNode = new QStandardItem;
|
||||||
for (int i = 0; i< it.value().toQObject()->metaObject()->methodCount();++i){
|
objectNode->setText(it.name());
|
||||||
if (it.value().toQObject()->metaObject()->method(i).methodType() == QMetaMethod::Method){
|
objectNode->setIcon(QIcon(":/report/images/object"));
|
||||||
QStandardItem* methodNode = new QStandardItem;
|
for (int i = 0; i< it.value().toQObject()->metaObject()->methodCount();++i){
|
||||||
QMetaMethod m = it.value().toQObject()->metaObject()->method(i);
|
if (it.value().toQObject()->metaObject()->method(i).methodType() == QMetaMethod::Method){
|
||||||
QString methodSignature = m.name() + "(";
|
QStandardItem* methodNode = new QStandardItem;
|
||||||
bool isFirst = true;
|
QMetaMethod m = it.value().toQObject()->metaObject()->method(i);
|
||||||
for (int j = 0; j < m.parameterCount(); ++j){
|
QString methodSignature = m.name() + "(";
|
||||||
methodSignature += (isFirst ? "" : ",") + m.parameterTypes()[j]+" "+m.parameterNames()[j];
|
bool isFirst = true;
|
||||||
if (isFirst) isFirst = false;
|
for (int j = 0; j < m.parameterCount(); ++j){
|
||||||
|
methodSignature += (isFirst ? "" : ",") + m.parameterTypes()[j]+" "+m.parameterNames()[j];
|
||||||
|
if (isFirst) isFirst = false;
|
||||||
|
}
|
||||||
|
methodSignature += ")";
|
||||||
|
methodNode->setText(methodSignature);
|
||||||
|
objectNode->appendRow(methodNode);
|
||||||
}
|
}
|
||||||
methodSignature += ")";
|
|
||||||
methodNode->setText(methodSignature);
|
|
||||||
objectNode->appendRow(methodNode);
|
|
||||||
}
|
}
|
||||||
|
model->invisibleRootItem()->appendRow(objectNode);
|
||||||
}
|
}
|
||||||
model->invisibleRootItem()->appendRow(objectNode);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -235,7 +238,6 @@ void ReportStructureCompleater::updateCompleaterModel(ReportEnginePrivateInterfa
|
|||||||
m_model.clear();
|
m_model.clear();
|
||||||
QIcon signalIcon(":/report/images/signal");
|
QIcon signalIcon(":/report/images/signal");
|
||||||
QIcon propertyIcon(":/report/images/property");
|
QIcon propertyIcon(":/report/images/property");
|
||||||
addAdditionalDatawords(&m_model, report->dataManager());
|
|
||||||
|
|
||||||
for ( int i = 0; i < report->pageCount(); ++i){
|
for ( int i = 0; i < report->pageCount(); ++i){
|
||||||
PageDesignIntf* page = report->pageAt(i);
|
PageDesignIntf* page = report->pageAt(i);
|
||||||
@ -262,8 +264,10 @@ void ReportStructureCompleater::updateCompleaterModel(ReportEnginePrivateInterfa
|
|||||||
foreach (BaseDesignIntf* item, page->pageItem()->childBaseItems()){
|
foreach (BaseDesignIntf* item, page->pageItem()->childBaseItems()){
|
||||||
addChildItem(item, itemNode->text(), m_model.invisibleRootItem());
|
addChildItem(item, itemNode->text(), m_model.invisibleRootItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addAdditionalDatawords(&m_model, report->dataManager());
|
||||||
|
m_model.sort(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user