From dcae0255aec90a8aefa8d75230874156371ae6a4 Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Fri, 23 Mar 2018 00:03:43 +0300 Subject: [PATCH] Script editor modified --- limereport/images/property.png | Bin 0 -> 266 bytes limereport/images/signal.png | Bin 0 -> 509 bytes limereport/report.qrc | 2 ++ limereport/scripteditor/lrscripteditor.cpp | 31 ++++++++++++++++++--- limereport/scripteditor/lrscripteditor.h | 1 + 5 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 limereport/images/property.png create mode 100644 limereport/images/signal.png diff --git a/limereport/images/property.png b/limereport/images/property.png new file mode 100644 index 0000000000000000000000000000000000000000..4e4efaa2b2f72ea065ff42c270bf15aaf3b5b511 GIT binary patch literal 266 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE9)O4kwElYQpMSoJ4w^wYmd=h<;HU0e&g9mIe zmy|`XE?i|_UD_d6E7HBq>`l*x(`Jz`zQ34p)M!et-PapG@A|PZY&jiPm$|s%&U5XA z`)?oLx-RZ~SkL0HL5uY<&8sVCuyoj+n&JHSJ6}m1Yuum5S|=-C-2DS|B7>)^pUXO@ GgeCx(RAZF@ literal 0 HcmV?d00001 diff --git a/limereport/images/signal.png b/limereport/images/signal.png new file mode 100644 index 0000000000000000000000000000000000000000..864c27d8d127b03453cfddca6d0d03c63b8eb0c1 GIT binary patch literal 509 zcmV|M9 zJjTaNzy@N#KCmlY=@ur?ufy6xdZHrr{@i#I4P{16BnK=5CqO?i86>d^)z#IIi3zV_ z|KhPXB3;=5i~#dM3fKbDKtefc?=yq$@acNgKJIMepvKA*11+R0mw*h=1PlU`Ks7J} zB)^GhX>Z38mD_dUP%E0tm!XwIVA_Nov--dZV76!p0MeEBKz-mS3&eplBWzANs#g5b z;images/deleteDialog.png images/copy3.png images/paste2.png + images/property.png + images/signal.png diff --git a/limereport/scripteditor/lrscripteditor.cpp b/limereport/scripteditor/lrscripteditor.cpp index 61eacf5..e385308 100644 --- a/limereport/scripteditor/lrscripteditor.cpp +++ b/limereport/scripteditor/lrscripteditor.cpp @@ -219,8 +219,6 @@ void ScriptEditor::slotOnCurrentChanged(const QModelIndex &to, const QModelIndex } } - - QString ReportStructureCompleater::pathFromIndex(const QModelIndex &index) const { QStringList dataList; @@ -284,15 +282,24 @@ void ReportStructureCompleater::updateCompleaterModel(ReportEnginePrivateInterfa itemNode->setText(page->pageItem()->objectName()); m_model.invisibleRootItem()->appendRow(itemNode); - QStringList slotsNames = extractSlotNames(page->pageItem()); - foreach(QString slotName, slotsNames){ + QStringList items = extractSlotNames(page->pageItem()); + foreach(QString slotName, items){ QStandardItem* slotItem = new QStandardItem; slotItem->setText(slotName); + slotItem->setIcon(QIcon(":/report/images/signal")); itemNode->appendRow(slotItem); } + items = extractPropertyes(page->pageItem()); + foreach(QString propertyName, items){ + QStandardItem* properyItem = new QStandardItem; + properyItem->setText(propertyName); + properyItem->setIcon(QIcon(":/report/images/property")); + itemNode->appendRow(properyItem); + } foreach (BaseDesignIntf* item, page->pageItem()->childBaseItems()){ addChildItem(item, itemNode->text(), m_model.invisibleRootItem()); } + } } } @@ -325,6 +332,22 @@ QStringList ReportStructureCompleater::extractSlotNames(BaseDesignIntf *item) return result; } +QStringList ReportStructureCompleater::extractPropertyes(BaseDesignIntf *item) +{ + QStringList result; + if (!item) return result; + QMetaObject const * mo = item->metaObject(); + while (mo){ + for(int i = mo->propertyOffset(); i < mo->propertyCount(); ++i) + { + result.append(QString::fromLatin1(mo->property(i).name())); + } + mo = mo->superClass(); + } + result.sort(); + return result; +} + void ReportStructureCompleater::addChildItem(BaseDesignIntf *item, const QString &pageName, QStandardItem *parent) { if (!item) return; diff --git a/limereport/scripteditor/lrscripteditor.h b/limereport/scripteditor/lrscripteditor.h index 666dbc9..31d16fd 100644 --- a/limereport/scripteditor/lrscripteditor.h +++ b/limereport/scripteditor/lrscripteditor.h @@ -34,6 +34,7 @@ public: void updateCompleaterModel(DataSourceManager* dataManager); protected: QStringList extractSlotNames(BaseDesignIntf* item); + QStringList extractPropertyes(BaseDesignIntf* item); void addChildItem(BaseDesignIntf *item, const QString &pageName, QStandardItem *parent); void addAdditionalDatawords(DataSourceManager *dataManager); private: