Script editor has been fixed

This commit is contained in:
Arin Alexander 2019-02-12 22:28:43 +03:00
parent edbba49114
commit 9be042819b

View File

@ -204,8 +204,10 @@ void ReportStructureCompleater::addAdditionalDatawords(QStandardItemModel* model
} }
if (it.value().isQObject()){ if (it.value().isQObject()){
if (it.value().toQObject()){ if (it.value().toQObject()){
if (model->findItems(it.name()).isEmpty()){
QStandardItem* objectNode = new QStandardItem; QStandardItem* objectNode = new QStandardItem;
objectNode->setText(it.name()); objectNode->setText(it.name());
objectNode->setIcon(QIcon(":/report/images/object"));
for (int i = 0; i< it.value().toQObject()->metaObject()->methodCount();++i){ for (int i = 0; i< it.value().toQObject()->metaObject()->methodCount();++i){
if (it.value().toQObject()->metaObject()->method(i).methodType() == QMetaMethod::Method){ if (it.value().toQObject()->metaObject()->method(i).methodType() == QMetaMethod::Method){
QStandardItem* methodNode = new QStandardItem; QStandardItem* methodNode = new QStandardItem;
@ -225,6 +227,7 @@ void ReportStructureCompleater::addAdditionalDatawords(QStandardItemModel* model
} }
} }
} }
}
#endif #endif
} }
@ -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);
} }
} }