mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-23 20:22:58 +03:00
Script editor modified
This commit is contained in:
parent
fbbf6af33d
commit
dcae0255ae
BIN
limereport/images/property.png
Normal file
BIN
limereport/images/property.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 266 B |
BIN
limereport/images/signal.png
Normal file
BIN
limereport/images/signal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 509 B |
@ -179,5 +179,7 @@
|
||||
<file alias="/images/deleteDialog">images/deleteDialog.png</file>
|
||||
<file alias="/images/copy">images/copy3.png</file>
|
||||
<file alias="/images/paste">images/paste2.png</file>
|
||||
<file alias="/images/property">images/property.png</file>
|
||||
<file alias="/images/signal">images/signal.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -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;
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user