mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-23 20:22:58 +03:00
Report structure browser has been modified
This commit is contained in:
parent
3c22c63600
commit
a337ef39a4
@ -90,7 +90,7 @@ void ObjectBrowser::fillNode(QTreeWidgetItem* parentNode, BaseDesignIntf* report
|
||||
|
||||
foreach (BaseDesignIntf* item, reportItem->childBaseItems()) {
|
||||
if (item != ignoredItem){
|
||||
ObjectBrowserNode* treeItem = new ObjectBrowserNode(parentNode);
|
||||
ObjectBrowserNode* treeItem = new ObjectBrowserNode(/*parentNode*/);
|
||||
treeItem->setText(0,item->objectName());
|
||||
treeItem->setObject(item);
|
||||
treeItem->setIcon(0,QIcon(":/items/"+extractClassName(item->metaObject()->className())));
|
||||
@ -102,7 +102,26 @@ void ObjectBrowser::fillNode(QTreeWidgetItem* parentNode, BaseDesignIntf* report
|
||||
this, SLOT(slotItemParentChanged(BaseDesignIntf*,BaseDesignIntf*)), Qt::UniqueConnection);
|
||||
}
|
||||
m_itemsMap.insert(item,treeItem);
|
||||
parentNode->addChild(treeItem);
|
||||
|
||||
BandDesignIntf* band = dynamic_cast<BandDesignIntf*>(item);
|
||||
|
||||
QSet<BandDesignIntf::BandsType> subBands;
|
||||
subBands << BandDesignIntf::SubDetailBand <<
|
||||
BandDesignIntf::SubDetailHeader <<
|
||||
BandDesignIntf::SubDetailFooter;
|
||||
|
||||
if (band && subBands.contains(band->bandType())){
|
||||
ObjectBrowserNode* parentBandNode = 0;
|
||||
if (band->bandType() == BandDesignIntf::SubDetailBand){
|
||||
parentBandNode = m_itemsMap.value(band->parentBand());
|
||||
} else {
|
||||
parentBandNode = m_itemsMap.value(band->parentBand()->parentBand());
|
||||
}
|
||||
if(parentBandNode)
|
||||
parentBandNode->addChild(treeItem);
|
||||
} else {
|
||||
parentNode->addChild(treeItem);
|
||||
}
|
||||
if (!item->childBaseItems().isEmpty())
|
||||
fillNode(treeItem,item, ignoredItem);
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
void setObject(QObject* value);
|
||||
QObject* object() const;
|
||||
explicit ObjectBrowserNode(QTreeWidget *view);
|
||||
explicit ObjectBrowserNode(QTreeWidgetItem *parent);
|
||||
explicit ObjectBrowserNode(QTreeWidgetItem *parent = 0);
|
||||
bool operator <(const QTreeWidgetItem& other) const;
|
||||
private:
|
||||
QObject* m_object;
|
||||
|
Loading…
Reference in New Issue
Block a user