diff --git a/limereport/images/property.png b/limereport/images/property.png new file mode 100644 index 0000000..4e4efaa Binary files /dev/null and b/limereport/images/property.png differ diff --git a/limereport/images/signal.png b/limereport/images/signal.png new file mode 100644 index 0000000..864c27d Binary files /dev/null and b/limereport/images/signal.png differ diff --git a/limereport/report.qrc b/limereport/report.qrc index 7e5f56d..23d48f9 100644 --- a/limereport/report.qrc +++ b/limereport/report.qrc @@ -179,5 +179,7 @@ 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: