From 4559925af437b8012f128ff21435e277b0b27719 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Tue, 21 Mar 2017 18:01:35 +0300 Subject: [PATCH 1/9] aggregate functions can be called in data header --- limereport/bands/lrsubdetailband.h | 1 + limereport/lrbanddesignintf.cpp | 24 ++++++++ limereport/lrbanddesignintf.h | 7 ++- limereport/lrbasedesignintf.cpp | 14 ++++- limereport/lrbasedesignintf.h | 3 + limereport/lrdatasourcemanager.cpp | 6 +- limereport/lrreportrender.cpp | 90 ++++++++++++++++++++++++------ limereport/lrreportrender.h | 7 +++ 8 files changed, 131 insertions(+), 21 deletions(-) diff --git a/limereport/bands/lrsubdetailband.h b/limereport/bands/lrsubdetailband.h index ae094e4..afbc6c5 100644 --- a/limereport/bands/lrsubdetailband.h +++ b/limereport/bands/lrsubdetailband.h @@ -64,6 +64,7 @@ class SubDetailHeaderBand : public BandDesignIntf public: SubDetailHeaderBand(QObject* owner = 0, QGraphicsItem* parent=0); bool isUnique() const; + bool isHeader() const {return true;} protected: QColor bandColor() const; private: diff --git a/limereport/lrbanddesignintf.cpp b/limereport/lrbanddesignintf.cpp index ed9a534..42342ad 100644 --- a/limereport/lrbanddesignintf.cpp +++ b/limereport/lrbanddesignintf.cpp @@ -461,6 +461,19 @@ void BandDesignIntf::processPopUpAction(QAction *action) } } +void BandDesignIntf::recalcItems(DataSourceManager* dataManager) +{ + foreach(BaseDesignIntf* bi, childBaseItems()){ + ContentItemDesignIntf* ci = dynamic_cast(bi); + if (bi){ + ContentItemDesignIntf* pci = dynamic_cast(bi->patternItem()); + ci->setContent(pci->content()); + } + } + + updateItemSize(dataManager,FirstPass,height()); +} + BaseDesignIntf* BandDesignIntf::cloneUpperPart(int height, QObject *owner, QGraphicsItem *parent) { int maxBottom = 0; @@ -966,6 +979,17 @@ void BandDesignIntf::updateItemSize(DataSourceManager* dataManager, RenderPass p BaseDesignIntf::updateItemSize(dataManager, pass, maxHeight); } +void BandDesignIntf::restoreItems() +{ + foreach(BaseDesignIntf* bi, childBaseItems()){ + ContentItemDesignIntf* ci = dynamic_cast(bi); + if (ci){ + ContentItemDesignIntf* pci = dynamic_cast(bi->patternItem()); + ci->setContent(pci->content()); + } + } +} + void BandDesignIntf::updateBandNameLabel() { if (m_bandNameLabel) m_bandNameLabel->updateLabel(); diff --git a/limereport/lrbanddesignintf.h b/limereport/lrbanddesignintf.h index c53b9e3..c440aab 100644 --- a/limereport/lrbanddesignintf.h +++ b/limereport/lrbanddesignintf.h @@ -128,6 +128,8 @@ public: virtual QIcon bandIcon() const; virtual bool isUnique() const; void updateItemSize(DataSourceManager *dataManager, RenderPass pass=FirstPass, int maxHeight=0); + void restoreItems(); + void recalcItems(DataSourceManager* dataManager); void updateBandNameLabel(); virtual QColor selectionColor() const; @@ -220,8 +222,8 @@ public: QColor alternateBackgroundColor() const; void setAlternateBackgroundColor(const QColor &alternateBackgroundColor); bool useAlternateBackgroundColor() const; - void setUseAlternateBackgroundColor(bool useAlternateBackgroundColor); - + void setUseAlternateBackgroundColor(bool useAlternateBackgroundColor); + void replaceGroupsFunction(BandDesignIntf *band); signals: void bandRendered(BandDesignIntf* band); protected: @@ -248,6 +250,7 @@ protected: void moveItemsDown(qreal startPos, qreal offset); void preparePopUpMenu(QMenu &menu); void processPopUpAction(QAction *action); + private slots: void childBandDeleted(QObject* band); private: diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp index 944277e..1e02ecf 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -79,7 +79,8 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q m_changingItemAlign(false), m_borderColor(Qt::black), m_reportSettings(0), - m_patternName("") + m_patternName(""), + m_patternItem(0) { setGeometry(QRectF(0, 0, m_width, m_height)); if (BaseDesignIntf *item = dynamic_cast(parent)) { @@ -712,6 +713,16 @@ void BaseDesignIntf::setPatternName(const QString &patternName) m_patternName = patternName; } +BaseDesignIntf* BaseDesignIntf::patternItem() const +{ + return m_patternItem; +} + +void BaseDesignIntf::setPatternItem(BaseDesignIntf *patternItem) +{ + m_patternItem = patternItem; +} + ReportSettings *BaseDesignIntf::reportSettings() const { return m_reportSettings; @@ -1330,6 +1341,7 @@ BaseDesignIntf *BaseDesignIntf::cloneItem(ItemMode mode, QObject *owner, QGraphi { BaseDesignIntf *clone = cloneItemWOChild(mode, owner, parent); clone->setPatternName(this->objectName()); + clone->setPatternItem(this); #ifdef HAVE_QT5 foreach(QObject * child, children()) { #else diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index c925579..812fefc 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -272,6 +272,8 @@ public: void setZValueProperty(qreal value); QString patternName() const; void setPatternName(const QString &patternName); + BaseDesignIntf* patternItem() const; + void setPatternItem(BaseDesignIntf* patternItem); Q_INVOKABLE QString setItemWidth(qreal width); Q_INVOKABLE QString setItemHeight(qreal height); @@ -397,6 +399,7 @@ private: QColor m_borderColor; ReportSettings* m_reportSettings; QString m_patternName; + BaseDesignIntf* m_patternItem; signals: void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); void posChanged(QObject* object, QPointF newPos, QPointF oldPos); diff --git a/limereport/lrdatasourcemanager.cpp b/limereport/lrdatasourcemanager.cpp index dc2c32e..1198f8b 100644 --- a/limereport/lrdatasourcemanager.cpp +++ b/limereport/lrdatasourcemanager.cpp @@ -258,7 +258,11 @@ void DataSourceManager::clearGroupFuntionsExpressions() QString DataSourceManager::getExpression(QString index) { - return m_groupFunctionsExpressions.at(index.toInt()); + bool ok = false; + int i = index.toInt(&ok); + if (ok && m_groupFunctionsExpressions.size()>i) + return m_groupFunctionsExpressions.at(index.toInt()); + else return ""; } bool DataSourceManager::designTime() const diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index 2476930..99d5cf3 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -259,11 +259,8 @@ void ReportRender::renderPage(PageDesignIntf* patternPage) clearPageMap(); startNewPage(true); - renderReportHeader(m_patternPageItem, AfterPageHeader); -// renderBand(m_patternPageItem->bandByType(BandDesignIntf::ReportHeader), 0, StartNewPageAsNeeded); - BandDesignIntf* lastRenderedBand = 0; for (int i=0;idataBandCount() && !m_renderCanceled;i++){ lastRenderedBand = m_patternPageItem->dataBandAt(i); @@ -318,6 +315,7 @@ void ReportRender::initRenderPage() m_renderPageItem->initFromItem(m_patternPageItem); m_renderPageItem->setItemMode(PreviewMode); m_renderPageItem->setPatternName(m_patternPageItem->objectName()); + m_renderPageItem->setPatternItem(m_patternPageItem); } } @@ -393,6 +391,21 @@ void ReportRender::extractGroupsFunction(BandDesignIntf *band) } } +bool ReportRender::containsGroupsFunction(BandDesignIntf *band){ + foreach(BaseDesignIntf* item,band->childBaseItems()){ + ContentItemDesignIntf* contentItem = dynamic_cast(item); + if (contentItem){ + QString content = contentItem->content(); + foreach(QString functionName, m_datasources->groupFunctionNames()){ + QRegExp rx(QString(Const::GROUP_FUNCTION_RX).arg(functionName)); + if (rx.indexIn(content)>=0){ + return true; + } + } + } + } + return false; +} void ReportRender::replaceGroupsFunction(BandDesignIntf *band) { @@ -517,20 +530,20 @@ void ReportRender::renderDataBand(BandDesignIntf *dataBand) BandDesignIntf* header = dataBand->bandHeader(); BandDesignIntf* footer = dataBand->bandFooter(); - if (header && header->printAlways()) renderBand(header, 0); + if (header && header->printAlways()) renderDataHeader(header); if(bandDatasource && !bandDatasource->eof() && !m_renderCanceled){ QString varName = QLatin1String("line_")+dataBand->objectName().toLower(); datasources()->setReportVariable(varName,1); - if (header && !header->printAlways()) - renderBand(header, 0); - - if (dataBand->bandHeader() && dataBand->bandHeader()->reprintOnEachPage()) + if (header && header->reprintOnEachPage()) m_reprintableBands.append(dataBand->bandHeader()); - renderChildHeader(dataBand,PrintNotAlwaysPrintable); + if (header && !header->printAlways()) + renderDataHeader(header); + + //renderChildHeader(dataBand,PrintNotAlwaysPrintable); renderGroupHeader(dataBand, bandDatasource, true); bool firstTime = true; @@ -578,7 +591,8 @@ void ReportRender::renderDataBand(BandDesignIntf *dataBand) firstTime = false; } - m_reprintableBands.removeOne(dataBand->bandHeader()); + m_reprintableBands.removeOne(header); + if (header) recalcIfNeeded(header); renderGroupFooter(dataBand); @@ -702,13 +716,48 @@ void ReportRender::renderChildBands(BandDesignIntf *parentBand) } } +BandDesignIntf* ReportRender::findRecalcableBand(BandDesignIntf* patternBand){ + + QList::iterator it = m_recalcBands.begin(); + for (;it !=m_recalcBands.end() ;++it){ + if ((*it)->patternItem() == patternBand){ + BandDesignIntf* result = (*it); + m_recalcBands.erase(it); + return result; + } + } + return 0; +} + +void ReportRender::recalcIfNeeded(BandDesignIntf* band){ + BandDesignIntf* recalcBand = findRecalcableBand(band); + if (recalcBand){ + QString bandName = recalcBand->objectName(); + recalcBand->restoreItems(); + recalcBand->setObjectName(recalcBand->patternItem()->objectName()); + replaceGroupsFunction(recalcBand); + recalcBand->updateItemSize(datasources()); + recalcBand->setObjectName(bandName); + datasources()->clearGroupFunctionValues(recalcBand->patternItem()->objectName()); + } +} + +void ReportRender::renderDataHeader(BandDesignIntf *header) +{ + recalcIfNeeded(header); + BandDesignIntf* renderedHeader = renderBand(header, 0); + if (containsGroupsFunction(header)) + m_recalcBands.append(renderedHeader); +} + void ReportRender::renderGroupHeader(BandDesignIntf *parentBand, IDataSource* dataSource, bool firstTime) { foreach(BandDesignIntf* band,parentBand->childrenByType(BandDesignIntf::GroupHeader)){ IGroupBand* gb = dynamic_cast(band); - if (gb&&gb->isNeedToClose(m_datasources)){ + if (gb&&gb->isNeedToClose(datasources())){ if (band->childBands().count()>0){ dataSource->prior(); + foreach (BandDesignIntf* subBand, band->childrenByType(BandDesignIntf::GroupHeader)) { foreach(BandDesignIntf* footer, subBand->childrenByType(BandDesignIntf::GroupFooter)){ renderBand(footer, 0); @@ -723,10 +772,6 @@ void ReportRender::renderGroupHeader(BandDesignIntf *parentBand, IDataSource* da dataSource->next(); } closeDataGroup(band); -// if (gb->isNeedToStartNewPage()){ -// savePage(); -// startNewPage(); -// } } if (!gb->isStarted()){ @@ -734,12 +779,15 @@ void ReportRender::renderGroupHeader(BandDesignIntf *parentBand, IDataSource* da m_reprintableBands.append(band); gb->startGroup(m_datasources); openDataGroup(band); + BandDesignIntf* renderedHeader = 0; if (!firstTime && gb->startNewPage()){ if (gb->resetPageNumber()) resetPageNumber(BandReset); - renderBand(band, 0, ForcedStartPage); + renderedHeader = renderBand(band, 0, ForcedStartPage); } else { - renderBand(band, 0, StartNewPageAsNeeded); + renderedHeader = renderBand(band, 0, StartNewPageAsNeeded); } + if (containsGroupsFunction(band)) + m_recalcBands.append(renderedHeader); } renderGroupHeader(band, dataSource, firstTime); @@ -753,6 +801,7 @@ void ReportRender::renderGroupFooterByHeader(BandDesignIntf* groupHeader){ foreach (BandDesignIntf* footer, groupHeader->childrenByType(BandDesignIntf::GroupFooter)){ renderBand(footer, 0, StartNewPageAsNeeded); } + recalcIfNeeded(groupHeader); } void ReportRender::renderGroupFooter(BandDesignIntf *parentBand) @@ -780,6 +829,7 @@ void ReportRender::initGroups() if (band->isHeader()){ IGroupBand* gb = dynamic_cast(band); if (gb) gb->closeGroup(); + extractGroupsFunction(band); } } } @@ -852,6 +902,7 @@ void ReportRender::closeDataGroup(BandDesignIntf *band) groupBand->closeGroup(); if (band->reprintOnEachPage()) m_reprintableBands.removeOne(band); } + recalcIfNeeded(band); closeGroup(band); } @@ -1056,6 +1107,11 @@ BandDesignIntf *ReportRender::renderData(BandDesignIntf *patternBand) if (patternBand->isFooter()){ replaceGroupsFunction(bandClone); } + + if (patternBand->isHeader()){ + replaceGroupsFunction(bandClone); + } + bandClone->updateItemSize(m_datasources); baseDesignIntfToScript(bandClone); diff --git a/limereport/lrreportrender.h b/limereport/lrreportrender.h index 1759712..21048c9 100644 --- a/limereport/lrreportrender.h +++ b/limereport/lrreportrender.h @@ -90,6 +90,7 @@ private: void baseDesignIntfToScript(BaseDesignIntf* item); + void renderPage(PageDesignIntf *patternPage); void initDatasources(); void initDatasource(const QString &name); @@ -112,13 +113,18 @@ private: void renderChildHeader(BandDesignIntf* parent, BandPrintMode printMode); void renderChildFooter(BandDesignIntf* parent, BandPrintMode printMode); void renderChildBands(BandDesignIntf* parentBand); + void recalcIfNeeded(BandDesignIntf *band); + void renderDataHeader(BandDesignIntf* header); void renderGroupHeader(BandDesignIntf* parentBand, IDataSource* dataSource, bool firstTime); void renderGroupFooter(BandDesignIntf* parentBand); void initGroups(); + bool containsGroupsFunction(BandDesignIntf* band); void extractGroupsFunction(BandDesignIntf* band); void replaceGroupsFunction(BandDesignIntf* band); + BandDesignIntf *findRecalcableBand(BandDesignIntf *patternBand); + void popPageFooterGroupValues(BandDesignIntf* dataBand); void pushPageFooterGroupValues(BandDesignIntf* dataBand); @@ -162,6 +168,7 @@ private: QList m_renderedPages; QMultiMap< BandDesignIntf*, GroupBandsHolder* > m_childBands; QList m_reprintableBands; + QList m_recalcBands; // QList m_lastRenderedHeaders; //int m_maxHeightByColumn[0]; From 61a3c20bb2985d706356b0f4100b1c1c9c2e226c Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Sat, 1 Apr 2017 14:48:56 +0300 Subject: [PATCH 2/9] Readme.md has been changed --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index febeb6d..00a80dd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -LimeReport v1.3.11 [![Build Status](https://api.travis-ci.org/fralx/LimeReport.svg?branch=master)](https://travis-ci.org/fralx/LimeReport) +LimeReport v1.4.7 [![Build Status](https://api.travis-ci.org/fralx/LimeReport.svg?branch=master)](https://travis-ci.org/fralx/LimeReport) +----------- +Official LimeReport web site [http://limereport.ru](http://limereport.ru) ----------- ##Features @@ -38,6 +40,17 @@ For more samples see a demo ## Change log +###1.4.7 +1. Multipage +2. Dialogs +3. Render events +4. Initscript +5. Memory usage has been reduced +6. Datasource manager has been refactored +7. Report items context menus have been added +8. Editable report +And many others minor fixes and improvements + ###1.3.11 1. LimeReport project structure has been changed 2. Preview widget has been added From 6dca8b27cb63eb591ec8de6c41db48f75575a03d Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Wed, 5 Apr 2017 00:58:04 +0300 Subject: [PATCH 3/9] Fix #61 AutoHeight overlapping --- limereport/items/lrtextitem.cpp | 2 +- limereport/limereport.pri | 6 +- limereport/lrbanddesignintf.cpp | 113 +--------------------- limereport/lrbanddesignintf.h | 42 +------- limereport/lrbasedesignintf.cpp | 4 +- limereport/lritemscontainerdesignitf.cpp | 117 +++++++++++++++++++++++ limereport/lritemscontainerdesignitf.h | 56 +++++++++++ limereport/lrpageitemdesignintf.cpp | 12 ++- limereport/lrpageitemdesignintf.h | 4 +- limereport/lrreportrender.cpp | 7 +- 10 files changed, 200 insertions(+), 163 deletions(-) create mode 100644 limereport/lritemscontainerdesignitf.cpp create mode 100644 limereport/lritemscontainerdesignitf.h diff --git a/limereport/items/lrtextitem.cpp b/limereport/items/lrtextitem.cpp index e36d251..1224bc9 100644 --- a/limereport/items/lrtextitem.cpp +++ b/limereport/items/lrtextitem.cpp @@ -691,7 +691,7 @@ bool TextItem::isNeedUpdateSize(RenderPass pass) const { Q_UNUSED(pass) - if ((autoHeight() && autoWidth()) || hasFollower()){ + if ((autoHeight() || autoWidth()) || hasFollower()){ initTextSizes(); } diff --git a/limereport/limereport.pri b/limereport/limereport.pri index 7f621e9..605f96a 100644 --- a/limereport/limereport.pri +++ b/limereport/limereport.pri @@ -89,7 +89,8 @@ SOURCES += \ $$REPORT_PATH/lrsimplecrypt.cpp \ $$REPORT_PATH/lraboutdialog.cpp \ $$REPORT_PATH/lrsettingdialog.cpp \ - $$REPORT_PATH/scriptbrowser/lrscriptbrowser.cpp + $$REPORT_PATH/scriptbrowser/lrscriptbrowser.cpp \ + $$REPORT_PATH/lritemscontainerdesignitf.cpp contains(CONFIG, zint){ SOURCES += $$REPORT_PATH/items/lrbarcodeitem.cpp @@ -188,7 +189,8 @@ HEADERS += \ $$REPORT_PATH/lrcallbackdatasourceintf.h \ $$REPORT_PATH/lrsettingdialog.h \ $$REPORT_PATH/lrpreviewreportwidget_p.h \ - $$REPORT_PATH/scriptbrowser/lrscriptbrowser.h + $$REPORT_PATH/scriptbrowser/lrscriptbrowser.h \ + $$REPORT_PATH/lritemscontainerdesignitf.h contains(CONFIG,zint){ HEADERS += $$REPORT_PATH/items/lrbarcodeitem.h diff --git a/limereport/lrbanddesignintf.cpp b/limereport/lrbanddesignintf.cpp index 9a704f2..f4a1cf9 100644 --- a/limereport/lrbanddesignintf.cpp +++ b/limereport/lrbanddesignintf.cpp @@ -99,33 +99,8 @@ void BandMarker::mousePressEvent(QGraphicsSceneMouseEvent *event) } } -bool Segment::intersect(Segment value) -{ - return ((value.m_end>=m_begin)&&(value.m_end<=m_end)) || - ((value.m_begin>=m_begin)&&(value.m_end>=m_end)) || - ((value.m_begin>=m_begin)&&(value.m_end<=m_end)) || - ((value.m_beginm_end)) ; -} - -qreal Segment::intersectValue(Segment value) -{ - if ((value.m_end>=m_begin)&&(value.m_end<=m_end)){ - return value.m_end-m_begin; - } - if ((value.m_begin>=m_begin)&&(value.m_end>=m_end)){ - return m_end-value.m_begin; - } - if ((value.m_begin>=m_begin)&&(value.m_end<=m_end)){ - return value.m_end-value.m_begin; - } - if ((value.m_beginm_end)){ - return m_end-m_begin; - } - return 0; -} - BandDesignIntf::BandDesignIntf(BandsType bandType, const QString &xmlTypeName, QObject* owner, QGraphicsItem *parent) : - BaseDesignIntf(xmlTypeName, owner,parent), + ItemsContainerDesignInft(xmlTypeName, owner,parent), m_bandType(bandType), m_bandIndex(static_cast(bandType)), m_dataSourceName(""), @@ -581,97 +556,11 @@ void BandDesignIntf::setSplittable(bool value){ } } -bool itemSortContainerLessThen(const PItemSortContainer c1, const PItemSortContainer c2) -{ - VSegment vS1(c1->m_rect),vS2(c2->m_rect); - HSegment hS1(c1->m_rect),hS2(c2->m_rect); - if (vS1.intersectValue(vS2)>hS1.intersectValue(hS2)) - return c1->m_rect.x()m_rect.x(); - else return c1->m_rect.y()m_rect.y(); -} - bool bandIndexLessThen(const BandDesignIntf* b1, const BandDesignIntf* b2) { return b1->bandIndex()bandIndex(); } -void BandDesignIntf::snapshotItemsLayout() -{ - m_bandItems.clear(); - foreach(BaseDesignIntf *childItem,childBaseItems()){ - m_bandItems.append(PItemSortContainer(new ItemSortContainer(childItem))); - } - qSort(m_bandItems.begin(),m_bandItems.end(),itemSortContainerLessThen); -} - -void BandDesignIntf::arrangeSubItems(RenderPass pass, DataSourceManager *dataManager, ArrangeType type) -{ - bool needArrage=(type==Force); - - foreach (PItemSortContainer item, m_bandItems) { - if (item->m_item->isNeedUpdateSize(pass)){ - item->m_item->updateItemSize(dataManager, pass); - needArrage=true; - } - } - - if (needArrage){ - //qSort(m_bandItems.begin(),m_bandItems.end(),itemSortContainerLessThen); - for (int i=0;im_item->collidesWithItem(m_bandItems[j]->m_item))){ - HSegment hS1(m_bandItems[j]->m_rect),hS2(m_bandItems[i]->m_rect); - VSegment vS1(m_bandItems[j]->m_rect),vS2(m_bandItems[i]->m_rect); - if (m_bandItems[i]->m_rect.bottom()m_item->geometry().bottom()){ - if (hS1.intersectValue(hS2)>vS1.intersectValue(vS2)) - m_bandItems[j]->m_item->setY(m_bandItems[i]->m_item->y()+m_bandItems[i]->m_item->height() - +m_bandItems[j]->m_rect.top()-m_bandItems[i]->m_rect.bottom()); - - } - if (m_bandItems[i]->m_rect.right()m_item->geometry().right()){ - if (vS1.intersectValue(vS2)>hS1.intersectValue(hS2)) - m_bandItems[j]->m_item->setX(m_bandItems[i]->m_item->geometry().right()+ - (m_bandItems[j]->m_rect.x()-m_bandItems[i]->m_rect.right())); - } - } - } - } - - if(needArrage||pass==FirstPass){ - int maxBottom = findMaxBottom(); - foreach(BaseDesignIntf* item,childBaseItems()){ - ItemDesignIntf* childItem=dynamic_cast(item); - if (childItem){ - if (childItem->stretchToMaxHeight()) - childItem->setHeight(maxBottom-childItem->geometry().top()); - } - } - } - -} - -qreal BandDesignIntf::findMaxBottom() -{ - qreal maxBottom=0; - foreach(QGraphicsItem* item,childItems()){ - BaseDesignIntf* subItem = dynamic_cast(item); - if(subItem) - if ( subItem->isVisible() && (subItem->geometry().bottom()>maxBottom) ) - maxBottom=subItem->geometry().bottom(); - } - return maxBottom; -} - -qreal BandDesignIntf::findMaxHeight(){ - qreal maxHeight=0; - foreach(QGraphicsItem* item,childItems()){ - BaseDesignIntf* subItem = dynamic_cast(item); - if(subItem) - if (subItem->geometry().height()>maxHeight) maxHeight=subItem->geometry().height(); - } - return maxHeight; -} - void BandDesignIntf::trimToMaxHeight(int maxHeight) { foreach(BaseDesignIntf* item,childBaseItems()){ diff --git a/limereport/lrbanddesignintf.h b/limereport/lrbanddesignintf.h index 0d92f5e..e588385 100644 --- a/limereport/lrbanddesignintf.h +++ b/limereport/lrbanddesignintf.h @@ -31,6 +31,7 @@ #define LRBANDDESIGNINTF_H #include "lrbasedesignintf.h" #include "lrdatasourcemanager.h" +#include "lritemscontainerdesignitf.h" #include namespace LimeReport { @@ -81,10 +82,7 @@ private: BandDesignIntf* m_band; }; -struct ItemSortContainer; -typedef QSharedPointer< ItemSortContainer > PItemSortContainer; - -class BandDesignIntf : public BaseDesignIntf +class BandDesignIntf : public ItemsContainerDesignInft { Q_OBJECT Q_PROPERTY(bool autoHeight READ autoHeight WRITE setAutoHeight ) @@ -223,10 +221,6 @@ public: signals: void bandRendered(BandDesignIntf* band); protected: - void snapshotItemsLayout(); - void arrangeSubItems(RenderPass pass, DataSourceManager *dataManager, ArrangeType type = AsNeeded); - qreal findMaxBottom(); - qreal findMaxHeight(); void trimToMaxHeight(int maxHeight); void setBandTypeText(const QString& value); QString bandTypeText(){return m_bandTypeText;} @@ -286,37 +280,7 @@ public: DataBandDesignIntf(BandsType bandType, QString xmlTypeName, QObject* owner = 0, QGraphicsItem* parent=0); }; -class Segment{ -public: - Segment(qreal segmentStart,qreal segmentEnd):m_begin(segmentStart),m_end(segmentEnd){} - bool intersect(Segment value); - qreal intersectValue(Segment value); -private: - qreal m_begin; - qreal m_end; -}; - -class VSegment : public Segment{ -public: - VSegment(QRectF rect):Segment(rect.top(),rect.bottom()){} -}; - -struct HSegment :public Segment{ -public: - HSegment(QRectF rect):Segment(rect.left(),rect.right()){} -}; - -struct ItemSortContainer { - QRectF m_rect; - BaseDesignIntf * m_item; - ItemSortContainer(BaseDesignIntf *item){ - m_item=item; - m_rect=item->geometry(); - } -}; - -bool itemSortContainerLessThen(const PItemSortContainer c1, const PItemSortContainer c2); bool bandIndexLessThen(const BandDesignIntf* b1, const BandDesignIntf* b2); -} +} // namespace LimeReport #endif // LRBANDDESIGNINTF_H diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp index 944277e..a80fd33 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -39,7 +39,6 @@ #include "serializators/lrxmlreader.h" #include - #include #include #include @@ -1525,8 +1524,7 @@ BaseDesignIntf *Marker::object() const return m_object; } - -} +} //namespace LimeReport diff --git a/limereport/lritemscontainerdesignitf.cpp b/limereport/lritemscontainerdesignitf.cpp new file mode 100644 index 0000000..dcad6ee --- /dev/null +++ b/limereport/lritemscontainerdesignitf.cpp @@ -0,0 +1,117 @@ +#include "lritemscontainerdesignitf.h" +#include "lritemdesignintf.h" + +namespace LimeReport { + +bool Segment::intersect(Segment value) +{ + return ((value.m_end>=m_begin)&&(value.m_end<=m_end)) || + ((value.m_begin>=m_begin)&&(value.m_end>=m_end)) || + ((value.m_begin>=m_begin)&&(value.m_end<=m_end)) || + ((value.m_beginm_end)) ; +} + +qreal Segment::intersectValue(Segment value) +{ + if ((value.m_end>=m_begin)&&(value.m_end<=m_end)){ + return value.m_end-m_begin; + } + if ((value.m_begin>=m_begin)&&(value.m_end>=m_end)){ + return m_end-value.m_begin; + } + if ((value.m_begin>=m_begin)&&(value.m_end<=m_end)){ + return value.m_end-value.m_begin; + } + if ((value.m_beginm_end)){ + return m_end-m_begin; + } + return 0; +} + +bool itemSortContainerLessThen(const PItemSortContainer c1, const PItemSortContainer c2) +{ + VSegment vS1(c1->m_rect),vS2(c2->m_rect); + HSegment hS1(c1->m_rect),hS2(c2->m_rect); + if (vS1.intersectValue(vS2)>hS1.intersectValue(hS2)) + return c1->m_rect.x()m_rect.x(); + else return c1->m_rect.y()m_rect.y(); +} + +void ItemsContainerDesignInft::snapshotItemsLayout() +{ + m_containerItems.clear(); + foreach(BaseDesignIntf *childItem,childBaseItems()){ + m_containerItems.append(PItemSortContainer(new ItemSortContainer(childItem))); + } + qSort(m_containerItems.begin(),m_containerItems.end(),itemSortContainerLessThen); +} + +void ItemsContainerDesignInft::arrangeSubItems(RenderPass pass, DataSourceManager *dataManager, ArrangeType type) +{ + bool needArrage=(type==Force); + + foreach (PItemSortContainer item, m_containerItems) { + if (item->m_item->isNeedUpdateSize(pass)){ + item->m_item->updateItemSize(dataManager, pass); + needArrage=true; + } + } + + if (needArrage){ + for (int i=0;im_item->collidesWithItem(m_containerItems[j]->m_item))){ + HSegment hS1(m_containerItems[j]->m_rect),hS2(m_containerItems[i]->m_rect); + VSegment vS1(m_containerItems[j]->m_rect),vS2(m_containerItems[i]->m_rect); + if (m_containerItems[i]->m_rect.bottom()m_item->geometry().bottom()){ + if (hS1.intersectValue(hS2)>vS1.intersectValue(vS2)) + m_containerItems[j]->m_item->setY(m_containerItems[i]->m_item->y()+m_containerItems[i]->m_item->height() + +m_containerItems[j]->m_rect.top()-m_containerItems[i]->m_rect.bottom()); + + } + if (m_containerItems[i]->m_rect.right()m_item->geometry().right()){ + if (vS1.intersectValue(vS2)>hS1.intersectValue(hS2)) + m_containerItems[j]->m_item->setX(m_containerItems[i]->m_item->geometry().right()+ + (m_containerItems[j]->m_rect.x()-m_containerItems[i]->m_rect.right())); + } + } + } + } + } + + if (needArrage||pass==FirstPass){ + int maxBottom = findMaxBottom(); + foreach(BaseDesignIntf* item,childBaseItems()){ + ItemDesignIntf* childItem=dynamic_cast(item); + if (childItem){ + if (childItem->stretchToMaxHeight()) + childItem->setHeight(maxBottom-childItem->geometry().top()); + } + } + } +} + +qreal ItemsContainerDesignInft::findMaxBottom() +{ + qreal maxBottom=0; + foreach(QGraphicsItem* item,childItems()){ + BaseDesignIntf* subItem = dynamic_cast(item); + if(subItem) + if ( subItem->isVisible() && (subItem->geometry().bottom()>maxBottom) ) + maxBottom=subItem->geometry().bottom(); + } + return maxBottom; +} + +qreal ItemsContainerDesignInft::findMaxHeight() +{ + qreal maxHeight=0; + foreach(QGraphicsItem* item,childItems()){ + BaseDesignIntf* subItem = dynamic_cast(item); + if(subItem) + if (subItem->geometry().height()>maxHeight) maxHeight=subItem->geometry().height(); + } + return maxHeight; +} + +} // namespace LimeReport diff --git a/limereport/lritemscontainerdesignitf.h b/limereport/lritemscontainerdesignitf.h new file mode 100644 index 0000000..86b2509 --- /dev/null +++ b/limereport/lritemscontainerdesignitf.h @@ -0,0 +1,56 @@ +#ifndef ITEMSCONTAINERDESIGNITF_H +#define ITEMSCONTAINERDESIGNITF_H + +#include "lrbasedesignintf.h" + +namespace LimeReport{ + +class Segment{ +public: + Segment(qreal segmentStart,qreal segmentEnd):m_begin(segmentStart),m_end(segmentEnd){} + bool intersect(Segment value); + qreal intersectValue(Segment value); +private: + qreal m_begin; + qreal m_end; +}; + +class VSegment : public Segment{ +public: + VSegment(QRectF rect):Segment(rect.top(),rect.bottom()){} +}; + +struct HSegment :public Segment{ +public: + HSegment(QRectF rect):Segment(rect.left(),rect.right()){} +}; + +struct ItemSortContainer { + QRectF m_rect; + BaseDesignIntf * m_item; + ItemSortContainer(BaseDesignIntf *item){ + m_item=item; + m_rect=item->geometry(); + } +}; + +typedef QSharedPointer< ItemSortContainer > PItemSortContainer; +bool itemSortContainerLessThen(const PItemSortContainer c1, const PItemSortContainer c2); + +class ItemsContainerDesignInft : public BaseDesignIntf{ +public: + ItemsContainerDesignInft(const QString& xmlTypeName, QObject* owner = 0, QGraphicsItem* parent=0): + BaseDesignIntf(xmlTypeName, owner, parent){} +protected: + void snapshotItemsLayout(); + void arrangeSubItems(RenderPass pass, DataSourceManager *dataManager, ArrangeType type = AsNeeded); + qreal findMaxBottom(); + qreal findMaxHeight(); +private: + QVector m_containerItems; + +}; + +} // namespace LimeReport + +#endif // ITEMSCONTAINERDESIGNITF_H diff --git a/limereport/lrpageitemdesignintf.cpp b/limereport/lrpageitemdesignintf.cpp index d943a13..150df06 100644 --- a/limereport/lrpageitemdesignintf.cpp +++ b/limereport/lrpageitemdesignintf.cpp @@ -46,24 +46,26 @@ bool bandSortBandLessThenByIndex(const BandDesignIntf *c1, const BandDesignIntf } PageItemDesignIntf::PageItemDesignIntf(QObject *owner, QGraphicsItem *parent) : - BaseDesignIntf("PageItem",owner,parent), + ItemsContainerDesignInft("PageItem",owner,parent), m_topMargin(0), m_bottomMargin(0), m_leftMargin(0), m_rightMargin(0), m_pageOrientaion(Portrait), m_pageSize(A4), m_sizeChainging(false), m_fullPage(false), m_oldPrintMode(false), m_resetPageNumber(false) { setFixedPos(true); setPossibleResizeDirectionFlags(Fixed); + setFlag(QGraphicsItem::ItemClipsChildrenToShape); initPageSize(m_pageSize); } PageItemDesignIntf::PageItemDesignIntf(const PageSize pageSize, const QRectF &rect, QObject *owner, QGraphicsItem *parent) : - BaseDesignIntf("PageItem",owner,parent), + ItemsContainerDesignInft("PageItem",owner,parent), m_topMargin(0), m_bottomMargin(0), m_leftMargin(0), m_rightMargin(0), m_pageOrientaion(Portrait), m_pageSize(pageSize), m_sizeChainging(false), m_fullPage(false), m_oldPrintMode(false), m_resetPageNumber(false) { setFixedPos(true); setPossibleResizeDirectionFlags(Fixed); + setFlag(QGraphicsItem::ItemClipsChildrenToShape); initPageSize(rect.size()); } @@ -316,6 +318,12 @@ void PageItemDesignIntf::setResetPageNumber(bool resetPageNumber) } } +void PageItemDesignIntf::updateSubItemsSize(RenderPass pass, DataSourceManager *dataManager) +{ + snapshotItemsLayout(); + arrangeSubItems(pass, dataManager); +} + bool PageItemDesignIntf::oldPrintMode() const { return m_oldPrintMode; diff --git a/limereport/lrpageitemdesignintf.h b/limereport/lrpageitemdesignintf.h index 2c1fb84..ef9b06d 100644 --- a/limereport/lrpageitemdesignintf.h +++ b/limereport/lrpageitemdesignintf.h @@ -31,13 +31,14 @@ #define LRPAGEITEM_H #include "lrbasedesignintf.h" #include "lrbanddesignintf.h" +#include "lritemscontainerdesignitf.h" #include #include namespace LimeReport{ class ReportRender; -class PageItemDesignIntf : public LimeReport::BaseDesignIntf +class PageItemDesignIntf : public LimeReport::ItemsContainerDesignInft { Q_OBJECT Q_ENUMS(Orientation) @@ -115,6 +116,7 @@ public: bool canContainChildren(){ return true;} bool resetPageNumber() const; void setResetPageNumber(bool resetPageNumber); + void updateSubItemsSize(RenderPass pass, DataSourceManager *dataManager); protected slots: void bandDeleted(QObject* band); diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index c7c82fc..8d2ccb6 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -608,9 +608,10 @@ void ReportRender::renderPageItems(PageItemDesignIntf* patternPage) } } m_renderPageItem->restoreLinks(); - foreach(BaseDesignIntf* item, pageItems){ - item->updateItemSize(m_datasources); - } + m_renderPageItem->updateSubItemsSize(FirstPass,m_datasources); +// foreach(BaseDesignIntf* item, pageItems){ +// item->updateItemSize(m_datasources); +// } } qreal ReportRender::calcPageFooterHeight(PageItemDesignIntf *patternPage) From 1ccfd147f170ff0f47935ff3df7b0bc5b09d2e80 Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Wed, 5 Apr 2017 01:08:03 +0300 Subject: [PATCH 4/9] version has been changed --- common.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.pri b/common.pri index 6b59a37..0bb04eb 100644 --- a/common.pri +++ b/common.pri @@ -56,7 +56,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 4 +LIMEREPORT_VERSION_RELEASE = 8 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\" From cd2e748a9bbe110ac4ceda2a9c924d2791d42d46 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Fri, 7 Apr 2017 21:01:51 +0300 Subject: [PATCH 5/9] QtDesigner integration has been added QtDesigner intergration has been added --- common.pri | 2 + .../3rdparty/designer/pluginmanager_p.h | 109 ++++++++++ .../designer/qdesigner_integration_p.h | 126 +++++++++++ .../3rdparty/designer/shared_global_p.h | 72 +++++++ .../designerintegrationv2/README.txt | 10 + .../designerintegration.pri | 11 + .../designerintegrationv2/formresizer.cpp | 198 ++++++++++++++++++ .../designerintegrationv2/formresizer.h | 99 +++++++++ .../designerintegrationv2/sizehandlerect.cpp | 188 +++++++++++++++++ .../designerintegrationv2/sizehandlerect.h | 82 ++++++++ .../designerintegrationv2/widgethost.cpp | 111 ++++++++++ .../designerintegrationv2/widgethost.h | 80 +++++++ .../widgethostconstants.h | 41 ++++ .../3rdparty/qtcreator/namespace_global.h | 48 +++++ limereport/dialogdesigner/dialogdesigner.pri | 17 ++ .../dialogdesigner/lrdialogdesigner.cpp | 171 +++++++++++++++ limereport/dialogdesigner/lrdialogdesigner.h | 48 +++++ limereport/limereport.pri | 34 +-- limereport/lrreportdesignwidget.cpp | 59 +++++- limereport/lrreportdesignwidget.h | 22 +- limereport/lrreportdesignwindow.cpp | 138 +++++++++++- limereport/lrreportdesignwindow.h | 17 +- limereport/lrreportrender.cpp | 2 +- limereport/lrscriptenginemanager.h | 12 +- limereport/scriptbrowser/lrscriptbrowser.cpp | 2 +- 25 files changed, 1662 insertions(+), 37 deletions(-) create mode 100644 limereport/dialogdesigner/3rdparty/designer/pluginmanager_p.h create mode 100644 limereport/dialogdesigner/3rdparty/designer/qdesigner_integration_p.h create mode 100644 limereport/dialogdesigner/3rdparty/designer/shared_global_p.h create mode 100644 limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/README.txt create mode 100644 limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/designerintegration.pri create mode 100644 limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/formresizer.cpp create mode 100644 limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/formresizer.h create mode 100644 limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/sizehandlerect.cpp create mode 100644 limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/sizehandlerect.h create mode 100644 limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/widgethost.cpp create mode 100644 limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/widgethost.h create mode 100644 limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/widgethostconstants.h create mode 100644 limereport/dialogdesigner/3rdparty/qtcreator/namespace_global.h create mode 100644 limereport/dialogdesigner/dialogdesigner.pri create mode 100644 limereport/dialogdesigner/lrdialogdesigner.cpp create mode 100644 limereport/dialogdesigner/lrdialogdesigner.h diff --git a/common.pri b/common.pri index 7d148ef..f9e80f3 100644 --- a/common.pri +++ b/common.pri @@ -1,6 +1,8 @@ CONFIG += build_translations CONFIG += zint CONFIG += qjsengine +CONFIG += dialogdesigner + greaterThan(QT_MAJOR_VERSION, 4) { QT += uitools } diff --git a/limereport/dialogdesigner/3rdparty/designer/pluginmanager_p.h b/limereport/dialogdesigner/3rdparty/designer/pluginmanager_p.h new file mode 100644 index 0000000..1706182 --- /dev/null +++ b/limereport/dialogdesigner/3rdparty/designer/pluginmanager_p.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information +** to ensure GNU General Public Licensing requirements will be met: +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. In addition, as a special +** exception, Nokia gives you certain additional rights. These rights +** are described in the Nokia Qt GPL Exception version 1.3, included in +** the file GPL_EXCEPTION.txt in this package. +** +** Qt for Windows(R) Licensees +** As a special exception, Nokia, as the sole copyright holder for Qt +** Designer, grants users of the Qt/Eclipse Integration plug-in the +** right for the Qt/Eclipse Integration to link to functionality +** provided by Qt Designer and its related libraries. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +****************************************************************************/ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of Qt Designer. This header +// file may change from version to version without notice, or even be removed. +// +// We mean it. +// + +#ifndef PLUGINMANAGER_H +#define PLUGINMANAGER_H + +#include "shared_global_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +class QDesignerFormEditorInterface; +class QDesignerCustomWidgetInterface; +class QDesignerPluginManagerPrivate; + +class QDESIGNER_SHARED_EXPORT QDesignerPluginManager: public QObject +{ + Q_OBJECT +public: + explicit QDesignerPluginManager(QDesignerFormEditorInterface *core); + virtual ~QDesignerPluginManager(); + + QDesignerFormEditorInterface *core() const; + + QObject *instance(const QString &plugin) const; + + QStringList registeredPlugins() const; + + QStringList findPlugins(const QString &path); + + QStringList pluginPaths() const; + void setPluginPaths(const QStringList &plugin_paths); + + QStringList disabledPlugins() const; + void setDisabledPlugins(const QStringList &disabled_plugins); + + QStringList failedPlugins() const; + QString failureReason(const QString &pluginName) const; + + QList instances() const; + QList registeredCustomWidgets() const; + + bool registerNewPlugins(); + +public slots: + bool syncSettings(); + void ensureInitialized(); + +private: + void updateRegisteredPlugins(); + void registerPath(const QString &path); + void registerPlugin(const QString &plugin); + +private: + static QStringList defaultPluginPaths(); + + QDesignerPluginManagerPrivate *m_d; +}; + +QT_END_NAMESPACE + +#endif // PLUGINMANAGER_H diff --git a/limereport/dialogdesigner/3rdparty/designer/qdesigner_integration_p.h b/limereport/dialogdesigner/3rdparty/designer/qdesigner_integration_p.h new file mode 100644 index 0000000..f59c001 --- /dev/null +++ b/limereport/dialogdesigner/3rdparty/designer/qdesigner_integration_p.h @@ -0,0 +1,126 @@ +/**************************************************************************** +** +** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information +** to ensure GNU General Public Licensing requirements will be met: +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. In addition, as a special +** exception, Nokia gives you certain additional rights. These rights +** are described in the Nokia Qt GPL Exception version 1.3, included in +** the file GPL_EXCEPTION.txt in this package. +** +** Qt for Windows(R) Licensees +** As a special exception, Nokia, as the sole copyright holder for Qt +** Designer, grants users of the Qt/Eclipse Integration plug-in the +** right for the Qt/Eclipse Integration to link to functionality +** provided by Qt Designer and its related libraries. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +****************************************************************************/ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of Qt Designer. This header +// file may change from version to version without notice, or even be removed. +// +// We mean it. +// + +#ifndef QDESIGNER_INTEGRATION_H +#define QDESIGNER_INTEGRATION_H + +#include "shared_global_p.h" +#include + +#include + +QT_BEGIN_NAMESPACE + +class QDesignerFormEditorInterface; +class QDesignerFormWindowInterface; +class QDesignerResourceBrowserInterface; + +class QVariant; +class QWidget; + +namespace qdesigner_internal { + +struct Selection; +class QDesignerIntegrationPrivate; + +class QDESIGNER_SHARED_EXPORT QDesignerIntegration: public QDesignerIntegrationInterface +{ + Q_OBJECT +public: + explicit QDesignerIntegration(QDesignerFormEditorInterface *core, QObject *parent = 0); + virtual ~QDesignerIntegration(); + + static void requestHelp(const QDesignerFormEditorInterface *core, const QString &manual, const QString &document); + + virtual QWidget *containerWindow(QWidget *widget) const; + + // Load plugins into widget database and factory. + static void initializePlugins(QDesignerFormEditorInterface *formEditor); + void emitObjectNameChanged(QDesignerFormWindowInterface *formWindow, QObject *object, const QString &newName, const QString &oldName); + + // Create a resource browser specific to integration. Language integration takes precedence + virtual QDesignerResourceBrowserInterface *createResourceBrowser(QWidget *parent = 0); + +signals: + void propertyChanged(QDesignerFormWindowInterface *formWindow, const QString &name, const QVariant &value); + void objectNameChanged(QDesignerFormWindowInterface *formWindow, QObject *object, const QString &newName, const QString &oldName); + void helpRequested(const QString &manual, const QString &document); + +public slots: + virtual void updateProperty(const QString &name, const QVariant &value, bool enableSubPropertyHandling); + // Additional signals of designer property editor + virtual void updatePropertyComment(const QString &name, const QString &value); + virtual void resetProperty(const QString &name); + virtual void addDynamicProperty(const QString &name, const QVariant &value); + virtual void removeDynamicProperty(const QString &name); + + + virtual void updateActiveFormWindow(QDesignerFormWindowInterface *formWindow); + virtual void setupFormWindow(QDesignerFormWindowInterface *formWindow); + virtual void updateSelection(); + virtual void updateGeometry(); + virtual void activateWidget(QWidget *widget); + + void updateCustomWidgetPlugins(); + +private slots: + void updatePropertyPrivate(const QString &name, const QVariant &value); + +private: + void initialize(); + void getSelection(Selection &s); + QObject *propertyEditorObject(); + + QDesignerIntegrationPrivate *m_d; +}; + +} // namespace qdesigner_internal + +QT_END_NAMESPACE + +#endif // QDESIGNER_INTEGRATION_H diff --git a/limereport/dialogdesigner/3rdparty/designer/shared_global_p.h b/limereport/dialogdesigner/3rdparty/designer/shared_global_p.h new file mode 100644 index 0000000..3b9ff24 --- /dev/null +++ b/limereport/dialogdesigner/3rdparty/designer/shared_global_p.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information +** to ensure GNU General Public Licensing requirements will be met: +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. In addition, as a special +** exception, Nokia gives you certain additional rights. These rights +** are described in the Nokia Qt GPL Exception version 1.3, included in +** the file GPL_EXCEPTION.txt in this package. +** +** Qt for Windows(R) Licensees +** As a special exception, Nokia, as the sole copyright holder for Qt +** Designer, grants users of the Qt/Eclipse Integration plug-in the +** right for the Qt/Eclipse Integration to link to functionality +** provided by Qt Designer and its related libraries. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +****************************************************************************/ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of Qt Designer. This header +// file may change from version to version without notice, or even be removed. +// +// We mean it. +// + +#ifndef SHARED_GLOBAL_H +#define SHARED_GLOBAL_H + +#include + +#ifdef QT_DESIGNER_STATIC +#define QDESIGNER_SHARED_EXTERN +#define QDESIGNER_SHARED_IMPORT +#else +#define QDESIGNER_SHARED_EXTERN Q_DECL_EXPORT +#define QDESIGNER_SHARED_IMPORT Q_DECL_IMPORT +#endif + +#ifndef QT_NO_SHARED_EXPORT +# ifdef QDESIGNER_SHARED_LIBRARY +# define QDESIGNER_SHARED_EXPORT QDESIGNER_SHARED_EXTERN +# else +# define QDESIGNER_SHARED_EXPORT QDESIGNER_SHARED_IMPORT +# endif +#else +# define QDESIGNER_SHARED_EXPORT +#endif + +#endif // SHARED_GLOBAL_H diff --git a/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/README.txt b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/README.txt new file mode 100644 index 0000000..f5351ea --- /dev/null +++ b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/README.txt @@ -0,0 +1,10 @@ +This is a new Designer integration, started on 28.02.2008. + +The reason for it is the introduction of layout caching +in Qt 4.4, which unearthed a lot of mainwindow-size related +bugs in Designer and all integrations. + +The goal of it is to have a closed layout chain from +integration top level to form window. + +Friedemann diff --git a/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/designerintegration.pri b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/designerintegration.pri new file mode 100644 index 0000000..f3a02f6 --- /dev/null +++ b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/designerintegration.pri @@ -0,0 +1,11 @@ +INCLUDEPATH *= $$PWD $$PWD/.. + +SOURCES += $$PWD/widgethost.cpp \ + $$PWD/sizehandlerect.cpp \ + $$PWD/formresizer.cpp + +HEADERS += $$PWD/widgethost.h \ + $$PWD/sizehandlerect.h \ + $$PWD/formresizer.h \ + $$PWD/widgethostconstants.h \ + $$PWD/../namespace_global.h diff --git a/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/formresizer.cpp b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/formresizer.cpp new file mode 100644 index 0000000..e0d88ed --- /dev/null +++ b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/formresizer.cpp @@ -0,0 +1,198 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#include "formresizer.h" +#include "sizehandlerect.h" +#include "widgethostconstants.h" + +#include + +#include + +#include +#include +#include +#include +#include + +enum { debugFormResizer = 0 }; + +using namespace SharedTools::Internal; + +FormResizer::FormResizer(QWidget *parent) : + QWidget(parent), + m_frame(new QFrame), + m_formWindow(0) +{ + // Make the resize grip of a mainwindow form find us as resizable window. + setWindowFlags(windowFlags() | Qt::SubWindow); + setBackgroundRole(QPalette::Base); + + QVBoxLayout *handleLayout = new QVBoxLayout(this); + handleLayout->setMargin(SELECTION_MARGIN); + handleLayout->addWidget(m_frame); + + m_frame->setFrameStyle(QFrame::Panel | QFrame::Raised); + QVBoxLayout *layout = new QVBoxLayout(m_frame); + layout->setMargin(0); + // handles + m_handles.reserve(SizeHandleRect::Left); + for (int i = SizeHandleRect::LeftTop; i <= SizeHandleRect::Left; ++i) { + SizeHandleRect *shr = new SizeHandleRect(this, static_cast(i), this); + connect(shr, SIGNAL(mouseButtonReleased(QRect,QRect)), this, SIGNAL(formWindowSizeChanged(QRect,QRect))); + m_handles.push_back(shr); + } + setState(SelectionHandleActive); + updateGeometry(); +} + +void FormResizer::updateGeometry() +{ + const QRect &geom = m_frame->geometry(); + + if (debugFormResizer) + qDebug() << "FormResizer::updateGeometry() " << size() << " frame " << geom; + + const int w = SELECTION_HANDLE_SIZE; + const int h = SELECTION_HANDLE_SIZE; + + const Handles::iterator hend = m_handles.end(); + for (Handles::iterator it = m_handles.begin(); it != hend; ++it) { + SizeHandleRect *hndl = *it;; + switch (hndl->dir()) { + case SizeHandleRect::LeftTop: + hndl->move(geom.x() - w / 2, geom.y() - h / 2); + break; + case SizeHandleRect::Top: + hndl->move(geom.x() + geom.width() / 2 - w / 2, geom.y() - h / 2); + break; + case SizeHandleRect::RightTop: + hndl->move(geom.x() + geom.width() - w / 2, geom.y() - h / 2); + break; + case SizeHandleRect::Right: + hndl->move(geom.x() + geom.width() - w / 2, geom.y() + geom.height() / 2 - h / 2); + break; + case SizeHandleRect::RightBottom: + hndl->move(geom.x() + geom.width() - w / 2, geom.y() + geom.height() - h / 2); + break; + case SizeHandleRect::Bottom: + hndl->move(geom.x() + geom.width() / 2 - w / 2, geom.y() + geom.height() - h / 2); + break; + case SizeHandleRect::LeftBottom: + hndl->move(geom.x() - w / 2, geom.y() + geom.height() - h / 2); + break; + case SizeHandleRect::Left: + hndl->move(geom.x() - w / 2, geom.y() + geom.height() / 2 - h / 2); + break; + default: + break; + } + } +} + +void FormResizer::update() +{ + const Handles::iterator hend = m_handles.end(); + for (Handles::iterator it = m_handles.begin(); it != hend; ++it) { + (*it)->update(); + } +} + +void FormResizer::setState(SelectionHandleState st) +{ + if (debugFormResizer) + qDebug() << "FormResizer::setState " << st; + + const Handles::iterator hend = m_handles.end(); + for (Handles::iterator it = m_handles.begin(); it != hend; ++it) + (*it)->setState(st); +} + +void FormResizer::setFormWindow(QDesignerFormWindowInterface *fw) +{ + if (debugFormResizer) + qDebug() << "FormResizer::setFormWindow " << fw; + QVBoxLayout *layout = qobject_cast(m_frame->layout()); + Q_ASSERT(layout); + if (layout->count()) + delete layout->takeAt(0); + m_formWindow = fw; + + if (m_formWindow) + layout->addWidget(m_formWindow); + mainContainerChanged(); + connect(fw, SIGNAL(mainContainerChanged(QWidget*)), this, SLOT(mainContainerChanged())); +} + +void FormResizer::resizeEvent(QResizeEvent *event) +{ + if (debugFormResizer) + qDebug() << ">FormResizer::resizeEvent" << event->size(); + updateGeometry(); + QWidget::resizeEvent(event); + if (debugFormResizer) + qDebug() << "lineWidth(); + const QMargins frameMargins = m_frame->contentsMargins(); + const int margin = 2* SELECTION_MARGIN; + QSize size = QSize( margin, margin ); + size += QSize( qMax( frameMargins.left(), lineWidth ), qMax( frameMargins.top(), lineWidth ) ); + size += QSize( qMax( frameMargins.right(), lineWidth ), qMax( frameMargins.bottom(), lineWidth ) ); + return size; +} + +QWidget *FormResizer::mainContainer() +{ + if (m_formWindow) + return m_formWindow->mainContainer(); + return 0; +} + +void FormResizer::mainContainerChanged() +{ + const QSize maxWidgetSize = QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + if (const QWidget *mc = mainContainer()) { + // Set Maximum size which is not handled via a hint (as opposed to minimum size) + const QSize maxWidgetSize = QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + const QSize formMaxSize = mc->maximumSize(); + QSize newMaxSize = maxWidgetSize; + if (formMaxSize != maxWidgetSize) + newMaxSize = formMaxSize + decorationSize(); + if (debugFormResizer) + qDebug() << "FormResizer::mainContainerChanged" << mc << " Size " << mc->size()<< newMaxSize; + setMaximumSize(newMaxSize); + resize(decorationSize() + mc->size()); + } else { + setMaximumSize(maxWidgetSize); + } +} diff --git a/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/formresizer.h b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/formresizer.h new file mode 100644 index 0000000..c7bd689 --- /dev/null +++ b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/formresizer.h @@ -0,0 +1,99 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ +#ifndef FORMRESIZER_H +#define FORMRESIZER_H + +#include "namespace_global.h" + +#include "widgethostconstants.h" + +#include +#include + +QT_FORWARD_DECLARE_CLASS(QDesignerFormWindowInterface) +QT_FORWARD_DECLARE_CLASS(QFrame) + +namespace SharedTools { +namespace Internal { + +class SizeHandleRect; + +/* A window to embed a form window interface as follows: + * + * Widget + * | + * +---+----+ + * | | + * | | + * Handles QVBoxLayout [margin: SELECTION_MARGIN] + * | + * Frame [margin: lineWidth] + * | + * QVBoxLayout + * | + * QDesignerFormWindowInterface + * + * Can be embedded into a QScrollArea. */ + +class FormResizer : public QWidget +{ + Q_OBJECT +public: + + FormResizer(QWidget *parent = 0); + + void updateGeometry(); + void setState(SelectionHandleState st); + void update(); + + void setFormWindow(QDesignerFormWindowInterface *fw); + +signals: + void formWindowSizeChanged(const QRect &oldGeo, const QRect &newGeo); + +protected: + virtual void resizeEvent(QResizeEvent *event); + +private slots: + void mainContainerChanged(); + +private: + QSize decorationSize() const; + QWidget *mainContainer(); + + QFrame *m_frame; + typedef QVector Handles; + Handles m_handles; + QDesignerFormWindowInterface * m_formWindow; +}; + +} +} // namespace SharedTools + +#endif // FORMRESIZER_H diff --git a/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/sizehandlerect.cpp b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/sizehandlerect.cpp new file mode 100644 index 0000000..4247769 --- /dev/null +++ b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/sizehandlerect.cpp @@ -0,0 +1,188 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ +#include "sizehandlerect.h" +#include "widgethostconstants.h" + +#include + +#include +#include +#include +#include + +enum { debugSizeHandle = 0 }; + +using namespace SharedTools::Internal; + +SizeHandleRect::SizeHandleRect(QWidget *parent, Direction d, QWidget *resizable) : + QWidget(parent), + m_dir(d), + m_resizable(resizable), + m_state(SelectionHandleOff) +{ + setBackgroundRole(QPalette::Text); + setAutoFillBackground(true); + + setFixedSize(SELECTION_HANDLE_SIZE, SELECTION_HANDLE_SIZE); + setMouseTracking(false); + updateCursor(); +} + +void SizeHandleRect::updateCursor() +{ + switch (m_dir) { + case Right: + case RightTop: + setCursor(Qt::SizeHorCursor); + return; + case RightBottom: + setCursor(Qt::SizeFDiagCursor); + return; + case LeftBottom: + case Bottom: + setCursor(Qt::SizeVerCursor); + return; + default: + break; + } + + setCursor(Qt::ArrowCursor); +} + +void SizeHandleRect::paintEvent(QPaintEvent *) +{ + switch (m_state) { + case SelectionHandleOff: + break; + case SelectionHandleInactive: { + QPainter p(this); + p.setPen(Qt::red); + p.drawRect(0, 0, width() - 1, height() - 1); + } + break; + case SelectionHandleActive: { + QPainter p(this); + p.setPen(Qt::blue); + p.drawRect(0, 0, width() - 1, height() - 1); + } + break; + } +} + +void SizeHandleRect::mousePressEvent(QMouseEvent *e) +{ + e->accept(); + + if (e->button() != Qt::LeftButton) + return; + + m_startSize = m_curSize = m_resizable->size(); + m_startPos = m_curPos = m_resizable->mapFromGlobal(e->globalPos()); + if (debugSizeHandle) + qDebug() << "SizeHandleRect::mousePressEvent" << m_startSize << m_startPos << m_curPos; + +} + +void SizeHandleRect::mouseMoveEvent(QMouseEvent *e) +{ + if (!(e->buttons() & Qt::LeftButton)) + return; + + // Try resize with delta against start position. + // We don't take little deltas in consecutive move events as this + // causes the handle and the mouse cursor to become out of sync + // once a min/maxSize limit is hit. When the cursor reenters the valid + // areas, it will now snap to it. + m_curPos = m_resizable->mapFromGlobal(e->globalPos()); + QSize delta = QSize(m_curPos.x() - m_startPos.x(), m_curPos.y() - m_startPos.y()); + switch (m_dir) { + case Right: + case RightTop: // Only width + delta.setHeight(0); + break; + case RightBottom: // All dimensions + break; + case LeftBottom: + case Bottom: // Only height + delta.setWidth(0); + break; + default: + delta = QSize(0, 0); + break; + } + if (delta != QSize(0, 0)) + tryResize(delta); +} + +void SizeHandleRect::mouseReleaseEvent(QMouseEvent *e) +{ + if (e->button() != Qt::LeftButton) + return; + + e->accept(); + if (m_startSize != m_curSize) { + const QRect startRect = QRect(0, 0, m_startPos.x(), m_startPos.y()); + const QRect newRect = QRect(0, 0, m_curPos.x(), m_curPos.y()); + if (debugSizeHandle) + qDebug() << "SizeHandleRect::mouseReleaseEvent" << startRect << newRect; + emit mouseButtonReleased(startRect, newRect); + } +} + +void SizeHandleRect::tryResize(const QSize &delta) +{ + // Try resize with delta against start position + QSize newSize = m_startSize + delta; + newSize = newSize.expandedTo(m_resizable->minimumSizeHint()); + newSize = newSize.expandedTo(m_resizable->minimumSize()); + newSize = newSize.boundedTo(m_resizable->maximumSize()); + if (newSize == m_resizable->size()) + return; + if (debugSizeHandle) + qDebug() << "SizeHandleRect::tryResize by (" << m_startSize << '+' << delta << ')' << newSize; + m_resizable->resize(newSize); + m_curSize = m_resizable->size(); +} + +void SizeHandleRect::setState(SelectionHandleState st) +{ + if (st == m_state) + return; + switch (st) { + case SelectionHandleOff: + hide(); + break; + case SelectionHandleInactive: + case SelectionHandleActive: + show(); + raise(); + break; + } + m_state = st; +} diff --git a/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/sizehandlerect.h b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/sizehandlerect.h new file mode 100644 index 0000000..c916b00 --- /dev/null +++ b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/sizehandlerect.h @@ -0,0 +1,82 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ +#ifndef SIZEHANDLERECT_H +#define SIZEHANDLERECT_H + +#include "namespace_global.h" + +#include "widgethostconstants.h" + +#include +#include + +namespace SharedTools { +namespace Internal { + +class SizeHandleRect : public QWidget +{ + Q_OBJECT +public: + enum Direction { LeftTop, Top, RightTop, Right, RightBottom, Bottom, LeftBottom, Left }; + + SizeHandleRect(QWidget *parent, Direction d, QWidget *resizable); + + Direction dir() const { return m_dir; } + void updateCursor(); + void setState(SelectionHandleState st); + +signals: + + void mouseButtonReleased(const QRect &, const QRect &); + +protected: + void paintEvent(QPaintEvent *e); + void mousePressEvent(QMouseEvent *e); + void mouseMoveEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + +private: + void tryResize(const QSize &delta); + +private: + const Direction m_dir; + QPoint m_startPos; + QPoint m_curPos; + QSize m_startSize; + QSize m_curSize; + QWidget *m_resizable; + SelectionHandleState m_state; +}; + +} +} // namespace SharedTools + + +#endif // SIZEHANDLERECT_H + diff --git a/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/widgethost.cpp b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/widgethost.cpp new file mode 100644 index 0000000..b78eb4b --- /dev/null +++ b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/widgethost.cpp @@ -0,0 +1,111 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#include "widgethost.h" +#include "formresizer.h" +#include "widgethostconstants.h" + +#include +#include + +#include +#include +#include +#include +#include + +using namespace SharedTools; + +// ---------- WidgetHost +WidgetHost::WidgetHost(QWidget *parent, QDesignerFormWindowInterface *formWindow) : + QScrollArea(parent), + m_formWindow(0), + m_formResizer(new Internal::FormResizer) +{ + setWidget(m_formResizer); + // Re-set flag (gets cleared by QScrollArea): Make the resize grip of a mainwindow form find the resizer as resizable window. + m_formResizer->setWindowFlags(m_formResizer->windowFlags() | Qt::SubWindow); + setFormWindow(formWindow); +} + +WidgetHost::~WidgetHost() +{ + if (m_formWindow) + delete m_formWindow; +} + +void WidgetHost::setFormWindow(QDesignerFormWindowInterface *fw) +{ + m_formWindow = fw; + if (!fw) + return; + + m_formResizer->setFormWindow(fw); + + setBackgroundRole(QPalette::Base); + m_formWindow->setAutoFillBackground(true); + m_formWindow->setBackgroundRole(QPalette::Background); + + connect(m_formResizer, SIGNAL(formWindowSizeChanged(QRect, QRect)), + this, SLOT(fwSizeWasChanged(QRect, QRect))); + connect(m_formWindow, SIGNAL(destroyed(QObject*)), this, SLOT(formWindowDeleted(QObject*))); +} + +QSize WidgetHost::formWindowSize() const +{ + if (!m_formWindow || !m_formWindow->mainContainer()) + return QSize(); + return m_formWindow->mainContainer()->size(); +} + +void WidgetHost::fwSizeWasChanged(const QRect &, const QRect &) +{ + // newGeo is the mouse coordinates, thus moving the Right will actually emit wrong height + emit formWindowSizeChanged(formWindowSize().width(), formWindowSize().height()); +} + +void WidgetHost::formWindowDeleted(QObject *object) +{ + if (object == m_formWindow) m_formWindow = 0; +} + +void WidgetHost::updateFormWindowSelectionHandles(bool active) +{ + Internal::SelectionHandleState state = Internal::SelectionHandleOff; + const QDesignerFormWindowCursorInterface *cursor = m_formWindow->cursor(); + if (cursor->isWidgetSelected(m_formWindow->mainContainer())) + state = active ? Internal::SelectionHandleActive : Internal::SelectionHandleInactive; + + m_formResizer->setState(state); +} + +QWidget *WidgetHost::integrationContainer() const +{ + return m_formResizer; +} diff --git a/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/widgethost.h b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/widgethost.h new file mode 100644 index 0000000..82b9fef --- /dev/null +++ b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/widgethost.h @@ -0,0 +1,80 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#ifndef WIDGETHOST_H +#define WIDGETHOST_H + +#include "namespace_global.h" + +#include + +QT_FORWARD_DECLARE_CLASS(QDesignerFormWindowInterface) + +namespace SharedTools { + +namespace Internal { + class FormResizer; +} + +/* A scroll area that embeds a Designer form window */ + +class WidgetHost : public QScrollArea +{ + Q_OBJECT +public: + WidgetHost(QWidget *parent = 0, QDesignerFormWindowInterface *formWindow = 0); + virtual ~WidgetHost(); + // Show handles if active and main container is selected. + void updateFormWindowSelectionHandles(bool active); + + inline QDesignerFormWindowInterface *formWindow() const { return m_formWindow; } + + QWidget *integrationContainer() const; + +protected: + void setFormWindow(QDesignerFormWindowInterface *fw); + +signals: + void formWindowSizeChanged(int, int); + +private slots: + void fwSizeWasChanged(const QRect &, const QRect &); + void formWindowDeleted(QObject* object); + +private: + QSize formWindowSize() const; + + QDesignerFormWindowInterface *m_formWindow; + Internal::FormResizer *m_formResizer; + QSize m_oldFakeWidgetSize; +}; + +} // namespace SharedTools + +#endif // WIDGETHOST_H diff --git a/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/widgethostconstants.h b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/widgethostconstants.h new file mode 100644 index 0000000..b1f7fff --- /dev/null +++ b/limereport/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/widgethostconstants.h @@ -0,0 +1,41 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#ifndef WIDGETHOST_CONSTANTS_H +#define WIDGETHOST_CONSTANTS_H + +namespace SharedTools { + namespace Internal { + enum { SELECTION_HANDLE_SIZE = 6, SELECTION_MARGIN = 10 }; + enum SelectionHandleState { SelectionHandleOff, SelectionHandleInactive, SelectionHandleActive }; + } +} + +#endif // WIDGETHOST_CONSTANTS_H + diff --git a/limereport/dialogdesigner/3rdparty/qtcreator/namespace_global.h b/limereport/dialogdesigner/3rdparty/qtcreator/namespace_global.h new file mode 100644 index 0000000..7b6ba3f --- /dev/null +++ b/limereport/dialogdesigner/3rdparty/qtcreator/namespace_global.h @@ -0,0 +1,48 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#ifndef NAMESPACE_GLOBAL_H +#define NAMESPACE_GLOBAL_H + +#include + +#if QT_VERSION < 0x040400 +# define QT_ADD_NAMESPACE(name) ::name +# define QT_USE_NAMESPACE +# define QT_BEGIN_NAMESPACE +# define QT_END_NAMESPACE +# define QT_BEGIN_INCLUDE_NAMESPACE +# define QT_END_INCLUDE_NAMESPACE +# define QT_BEGIN_MOC_NAMESPACE +# define QT_END_MOC_NAMESPACE +# define QT_FORWARD_DECLARE_CLASS(name) class name; +# define QT_MANGLE_NAMESPACE(name) name +#endif + +#endif // NAMESPACE_GLOBAL_H diff --git a/limereport/dialogdesigner/dialogdesigner.pri b/limereport/dialogdesigner/dialogdesigner.pri new file mode 100644 index 0000000..37a1ea1 --- /dev/null +++ b/limereport/dialogdesigner/dialogdesigner.pri @@ -0,0 +1,17 @@ +include(../../common.pri) +include($$PWD/3rdparty/qtcreator/designerintegrationv2/designerintegration.pri) +INCLUDEPATH *= $$PWD/3rdparty/designer +greaterThan(QT_MAJOR_VERSION, 4) { + contains(QT,uitools){ + DEFINES += HAVE_QTDESIGNER_INTEGRATION + } +} +lessThan(QT_MAJOR_VERSION, 5){ + contains(CONFIG,uitools){ + DEFINES += HAVE_QTDESIGNER_INTEGRATION + } +} +QT += designer designercomponents-private + +SOURCES += $$PWD/lrdialogdesigner.cpp +HEADERS += $$PWD/lrdialogdesigner.h diff --git a/limereport/dialogdesigner/lrdialogdesigner.cpp b/limereport/dialogdesigner/lrdialogdesigner.cpp new file mode 100644 index 0000000..cc5d258 --- /dev/null +++ b/limereport/dialogdesigner/lrdialogdesigner.cpp @@ -0,0 +1,171 @@ +#include "lrdialogdesigner.h" + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "pluginmanager_p.h" +//#include + +#include "widgethost.h" + +namespace LimeReport{ + +DialogDesigner::DialogDesigner(QObject *parent) : QObject(parent) +{ + QDesignerComponents::initializeResources(); + m_formEditor = QDesignerComponents::createFormEditor(this); + QDesignerComponents::initializePlugins(m_formEditor); + QDesignerComponents::createTaskMenu(m_formEditor, this); + + foreach ( QObject* o, QPluginLoader::staticInstances() << m_formEditor->pluginManager()->instances() ) + { + if ( QDesignerFormEditorPluginInterface* fep = qobject_cast( o ) ) + { + // initialize plugin if needed + if ( !fep->isInitialized() ) + fep->initialize( m_formEditor ); + + // set action chackable +// fep->action()->setCheckable( true ); + +// // add action mode to group +// aModes->addAction( fep->action() ); + } + } + + + m_widgetBox = QDesignerComponents::createWidgetBox(m_formEditor, 0); + m_widgetBox->setWindowTitle(tr("Widget Box")); + m_widgetBox->setObjectName(QLatin1String("WidgetBox")); + m_formEditor->setWidgetBox(m_widgetBox); + m_formEditor->setTopLevel(m_widgetBox); + m_designerToolWindows.append(m_widgetBox); + connect(m_widgetBox, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)) ); + + m_objectInspector = QDesignerComponents::createObjectInspector(m_formEditor, 0); + m_objectInspector->setWindowTitle(tr("Object Inspector")); + m_objectInspector->setObjectName(QLatin1String("ObjectInspector")); + m_formEditor->setObjectInspector(m_objectInspector); + m_designerToolWindows.append(m_objectInspector); + connect(m_objectInspector, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)) ); + + m_propertyEditor = QDesignerComponents::createPropertyEditor(m_formEditor, 0); + m_propertyEditor->setWindowTitle(tr("Property Editor")); + m_propertyEditor->setObjectName(QLatin1String("PropertyEditor")); + m_formEditor->setPropertyEditor(m_propertyEditor); + m_designerToolWindows.append(m_propertyEditor); + connect(m_propertyEditor, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)) ); + + m_signalSlotEditor = QDesignerComponents::createSignalSlotEditor(m_formEditor, 0); + m_signalSlotEditor->setWindowTitle(tr("Signals && Slots Editor")); + m_signalSlotEditor->setObjectName(QLatin1String("SignalsAndSlotsEditor")); + + m_designerToolWindows.append(m_signalSlotEditor); + connect(m_signalSlotEditor, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)) ); + + m_resourcesEditor = QDesignerComponents::createResourceEditor(m_formEditor, 0); + m_resourcesEditor->setWindowTitle(tr("Resource Editor")); + m_resourcesEditor->setObjectName(QLatin1String("ResourceEditor")); + m_designerToolWindows.append(m_resourcesEditor); + connect(m_resourcesEditor, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)) ); + + m_actionEditor = QDesignerComponents::createActionEditor(m_formEditor, 0); + m_actionEditor->setWindowTitle(tr("Action Editor")); + m_actionEditor->setObjectName("ActionEditor"); + m_formEditor->setActionEditor(m_actionEditor); + m_designerToolWindows.append(m_actionEditor); + connect(m_formEditor, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)) ); + + m_designerIntegration = new QDesignerIntegration(m_formEditor,this); + m_formEditor->setIntegration(m_designerIntegration); + +} + +DialogDesigner::~DialogDesigner() +{ + for (int i = 0; iformWindowManager()->createFormWindow(0, Qt::Window); + wnd->setContents(content); + m_formEditor->formWindowManager()->setActiveFormWindow(wnd); + m_formEditor->objectInspector()->setFormWindow(wnd); + wnd->editWidgets(); + + SharedTools::WidgetHost *placeholder = new SharedTools::WidgetHost(0,wnd); + placeholder->setFrameStyle( QFrame::NoFrame | QFrame::Plain ); + placeholder->setFocusProxy( wnd ); + + return placeholder; + +} + +void DialogDesigner::setActiveEditor(QWidget *widget) +{ + SharedTools::WidgetHost* wh = dynamic_cast(widget); + if (wh){ + m_formEditor->formWindowManager()->setActiveFormWindow(wh->formWindow()); + } + +} + +QWidget* DialogDesigner::widgetBox() const +{ + return m_widgetBox; +} + +QWidget* DialogDesigner::actionEditor() const +{ + return m_actionEditor; +} + +QWidget* DialogDesigner::propertyEditor() const +{ + return m_propertyEditor; +} + +QWidget* DialogDesigner::objectInspector() const +{ + return m_objectInspector; +} + +QWidget *DialogDesigner::signalSlotEditor() const +{ + return m_signalSlotEditor; +} + +QWidget *DialogDesigner::resourcesEditor() const +{ + return m_resourcesEditor; +} + +void DialogDesigner::objectDestroyed(QObject *object) +{ + for ( int i = 0; i +#include + +class QDesignerFormEditorInterface; +class QDesignerFormWindowInterface; +class QDesignerIntegrationInterface; +class QDesignerWidgetBoxInterface; +class QDesignerActionEditorInterface; +class QDesignerPropertyEditorInterface; +class QDesignerObjectInspectorInterface; +class QDesignerFormWindowManagerInterface; + +namespace LimeReport{ + +class DialogDesigner : public QObject +{ + Q_OBJECT +public: + explicit DialogDesigner(QObject *parent = 0); + ~DialogDesigner(); + QWidget* createFormEditor(const QString& content); + void setActiveEditor(QWidget* widget); + QWidget* widgetBox() const; + QWidget* actionEditor() const; + QWidget* propertyEditor() const; + QWidget* objectInspector() const; + QWidget* signalSlotEditor() const; + QWidget* resourcesEditor() const; +private slots: + void objectDestroyed(QObject* object); +private: + QDesignerFormEditorInterface* m_formEditor; + QDesignerIntegrationInterface* m_designerIntegration; + QDesignerWidgetBoxInterface* m_widgetBox; + QDesignerActionEditorInterface* m_actionEditor; + QDesignerPropertyEditorInterface* m_propertyEditor; + QDesignerObjectInspectorInterface* m_objectInspector; + QWidget* m_signalSlotEditor; + QWidget* m_resourcesEditor; + QVector m_designerToolWindows; +}; + +} // namespace LimeReport + +#endif // DIALOGDESIGNER_H diff --git a/limereport/limereport.pri b/limereport/limereport.pri index 7f621e9..41b3e3f 100644 --- a/limereport/limereport.pri +++ b/limereport/limereport.pri @@ -1,5 +1,9 @@ include(../common.pri) +contains(CONFIG,dialogdesigner){ + include($$REPORT_PATH/dialogdesigner/dialogdesigner.pri) +} + DEFINES += INSPECT_BASEDESIGN INCLUDEPATH += \ @@ -19,6 +23,15 @@ SOURCES += \ $$REPORT_PATH/bands/lrgroupbands.cpp \ $$REPORT_PATH/bands/lrsubdetailband.cpp \ $$REPORT_PATH/bands/lrtearoffband.cpp \ + $$REPORT_PATH/databrowser/lrdatabrowser.cpp \ + $$REPORT_PATH/databrowser/lrsqleditdialog.cpp \ + $$REPORT_PATH/databrowser/lrconnectiondialog.cpp \ + $$REPORT_PATH/databrowser/lrvariabledialog.cpp \ + $$REPORT_PATH/databrowser/lrdatabrowsertree.cpp \ + $$REPORT_PATH/serializators/lrxmlqrectserializator.cpp \ + $$REPORT_PATH/serializators/lrxmlbasetypesserializators.cpp \ + $$REPORT_PATH/serializators/lrxmlreader.cpp \ + $$REPORT_PATH/serializators/lrxmlwriter.cpp \ $$REPORT_PATH/objectinspector/propertyItems/lrstringpropitem.cpp \ $$REPORT_PATH/objectinspector/propertyItems/lrrectproptem.cpp \ $$REPORT_PATH/objectinspector/propertyItems/lrintpropitem.cpp \ @@ -44,16 +57,8 @@ SOURCES += \ $$REPORT_PATH/objectinspector/lrobjectitemmodel.cpp \ $$REPORT_PATH/objectinspector/lrobjectpropitem.cpp \ $$REPORT_PATH/objectinspector/lrpropertydelegate.cpp \ - $$REPORT_PATH/objectsbrowser/lrobjectbrowser.cpp \ - $$REPORT_PATH/databrowser/lrdatabrowser.cpp \ - $$REPORT_PATH/databrowser/lrsqleditdialog.cpp \ - $$REPORT_PATH/databrowser/lrconnectiondialog.cpp \ - $$REPORT_PATH/databrowser/lrvariabledialog.cpp \ - $$REPORT_PATH/databrowser/lrdatabrowsertree.cpp \ - $$REPORT_PATH/serializators/lrxmlqrectserializator.cpp \ - $$REPORT_PATH/serializators/lrxmlbasetypesserializators.cpp \ - $$REPORT_PATH/serializators/lrxmlreader.cpp \ - $$REPORT_PATH/serializators/lrxmlwriter.cpp \ + $$REPORT_PATH/objectsbrowser/lrobjectbrowser.cpp \ + $$REPORT_PATH/scriptbrowser/lrscriptbrowser.cpp \ $$REPORT_PATH/items/lrsubitemparentpropitem.cpp \ $$REPORT_PATH/items/lralignpropitem.cpp \ $$REPORT_PATH/items/lrhorizontallayout.cpp \ @@ -88,8 +93,8 @@ SOURCES += \ $$REPORT_PATH/lrgroupfunctions.cpp \ $$REPORT_PATH/lrsimplecrypt.cpp \ $$REPORT_PATH/lraboutdialog.cpp \ - $$REPORT_PATH/lrsettingdialog.cpp \ - $$REPORT_PATH/scriptbrowser/lrscriptbrowser.cpp + $$REPORT_PATH/lrsettingdialog.cpp + contains(CONFIG, zint){ SOURCES += $$REPORT_PATH/items/lrbarcodeitem.cpp @@ -145,6 +150,7 @@ HEADERS += \ $$REPORT_PATH/objectinspector/lrobjectpropitem.h \ $$REPORT_PATH/objectinspector/lrpropertydelegate.h \ $$REPORT_PATH/objectsbrowser/lrobjectbrowser.h \ + $$REPORT_PATH/scriptbrowser/lrscriptbrowser.h \ $$REPORT_PATH/items/editors/lritemeditorwidget.h \ $$REPORT_PATH/items/editors/lrfonteditorwidget.h \ $$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.h \ @@ -187,8 +193,8 @@ HEADERS += \ $$REPORT_PATH/lraboutdialog.h \ $$REPORT_PATH/lrcallbackdatasourceintf.h \ $$REPORT_PATH/lrsettingdialog.h \ - $$REPORT_PATH/lrpreviewreportwidget_p.h \ - $$REPORT_PATH/scriptbrowser/lrscriptbrowser.h + $$REPORT_PATH/lrpreviewreportwidget_p.h + contains(CONFIG,zint){ HEADERS += $$REPORT_PATH/items/lrbarcodeitem.h diff --git a/limereport/lrreportdesignwidget.cpp b/limereport/lrreportdesignwidget.cpp index 6a6ff0c..6acb22a 100644 --- a/limereport/lrreportdesignwidget.cpp +++ b/limereport/lrreportdesignwidget.cpp @@ -33,6 +33,7 @@ #include "lrreportengine_p.h" #include "lrbasedesignintf.h" #include "lrsettingdialog.h" +#include "dialogdesigner/lrdialogdesigner.h" #include #include @@ -46,10 +47,8 @@ namespace LimeReport { -// ReportDesignIntf - ReportDesignWidget::ReportDesignWidget(ReportEnginePrivate *report, QMainWindow *mainWindow, QWidget *parent) : - QWidget(parent), m_mainWindow(mainWindow), m_verticalGridStep(10), m_horizontalGridStep(10), m_useGrid(false) + QWidget(parent), m_dialogDesigner(new DialogDesigner(this)), m_mainWindow(mainWindow), m_verticalGridStep(10), m_horizontalGridStep(10), m_useGrid(false) { m_tabWidget = new QTabWidget(this); m_tabWidget->setTabPosition(QTabWidget::South); @@ -73,7 +72,6 @@ ReportDesignWidget::ReportDesignWidget(ReportEnginePrivate *report, QMainWindow connect(m_report,SIGNAL(cleared()),this,SIGNAL(cleared())); connect(m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentTabChanged(int))); - //m_instance=this; m_scriptEditor->setPlainText(report->scriptContext()->initScript()); m_zoomer = new GraphicsViewZoomer(activeView()); #ifdef Q_OS_WIN @@ -81,6 +79,39 @@ ReportDesignWidget::ReportDesignWidget(ReportEnginePrivate *report, QMainWindow #endif } +DialogDesigner *ReportDesignWidget::dialogDesigner() const +{ + return m_dialogDesigner; +} + +QWidget *ReportDesignWidget::toolWindow(ReportDesignWidget::ToolWindowType windowType) +{ + switch (windowType) { + case WidgetBox: + return dialogDesigner()->widgetBox(); + case PropertyEditor: + return dialogDesigner()->propertyEditor(); + case ObjectInspector: + return dialogDesigner()->objectInspector(); + case ActionEditor: + return dialogDesigner()->actionEditor(); + case ResourceEditor: + return dialogDesigner()->resourcesEditor(); + case SignalSlotEditor: + return dialogDesigner()->signalSlotEditor(); + default: + return 0; + } +} + +ReportDesignWidget::EditorTabType ReportDesignWidget::activeTabType() +{ + QString tabType = m_tabWidget->tabWhatsThis(m_tabWidget->currentIndex()); + if ( tabType.compare("dialog") == 0) return Dialog; + if ( tabType.compare("script") == 0) return Script; + return Page; +} + bool ReportDesignWidget::useMagnet() const { return m_useMagnet; @@ -139,6 +170,7 @@ void ReportDesignWidget::loadState(QSettings* settings) void ReportDesignWidget::createTabs(){ + int pageIndex = -1; for (int i = 0; ipageCount();++i){ QGraphicsView* view = new QGraphicsView(qobject_cast(this)); view->setBackgroundBrush(QBrush(Qt::gray)); @@ -152,11 +184,22 @@ void ReportDesignWidget::createTabs(){ view->centerOn(0,0); view->scale(0.5,0.5); connectPage(m_report->pageAt(i)); - m_tabWidget->addTab(view,QIcon(),tr("Page")+QString::number(i+1)); + pageIndex = m_tabWidget->addTab(view,QIcon(),m_report->pageAt(i)->pageItem()->objectName()); + m_tabWidget->setTabWhatsThis(pageIndex, "page"); } +#ifdef HAVE_QTDESIGNER_INTEGRATION + QWidget* dialogEditor; + foreach(DialogDescriber::Ptr dialogDesc, m_report->scriptContext()->dialogDescribers()){ + dialogEditor = m_dialogDesigner->createFormEditor(dialogDesc->description()); + pageIndex = m_tabWidget->addTab(dialogEditor,QIcon(),dialogDesc->name()); + m_tabWidget->setTabWhatsThis(pageIndex,"dialog"); + } +#endif m_scriptEditor = new QTextEdit(this); - m_tabWidget->addTab(m_scriptEditor,QIcon(),tr("Script")); + pageIndex = m_tabWidget->addTab(m_scriptEditor,QIcon(),tr("Script")); + m_tabWidget->setTabWhatsThis(pageIndex,"script"); m_tabWidget->setCurrentIndex(0); + } ReportDesignWidget::~ReportDesignWidget() @@ -189,7 +232,6 @@ void ReportDesignWidget::connectPage(PageDesignIntf *page) connect(page, SIGNAL(pageUpdateFinished(LimeReport::PageDesignIntf*)), this, SIGNAL(activePageUpdated(LimeReport::PageDesignIntf*))); - //activeView()->centerOn(0,0); emit activePageChanged(); } @@ -605,6 +647,9 @@ void ReportDesignWidget::slotCurrentTabChanged(int index) } m_zoomer->setView(view); } + if (activeTabType() == Dialog){ + m_dialogDesigner->setActiveEditor(m_tabWidget->widget(index)); + } emit activePageChanged(); } diff --git a/limereport/lrreportdesignwidget.h b/limereport/lrreportdesignwidget.h index 28a1998..d624617 100644 --- a/limereport/lrreportdesignwidget.h +++ b/limereport/lrreportdesignwidget.h @@ -48,6 +48,7 @@ namespace LimeReport { class ReportEnginePrivate; class DataBrowser; class ReportDesignWindow; +class DialogDesigner; class ReportDesignWidget : public QWidget { @@ -55,8 +56,20 @@ class ReportDesignWidget : public QWidget Q_PROPERTY(QObject* datasourcesManager READ dataManager()) friend class ReportDesignWindow; public: + enum ToolWindowType{ + WidgetBox = 1, + ObjectInspector = 2, + ActionEditor = 3, + SignalSlotEditor = 4, + PropertyEditor = 5, + ResourceEditor = 6 + }; + enum EditorTabType{ + Page, + Dialog, + Script + }; ~ReportDesignWidget(); -// static ReportDesignWidget* instance(){return m_instance;} void createStartPage(); void clear(); DataSourceManager* dataManager(); @@ -76,7 +89,6 @@ public: QList selectedItems(); QStringList datasourcesNames(); void scale( qreal sx, qreal sy); -// void setDatabrowser(DataBrowser* databrowser); ReportEnginePrivate* report(){return m_report;} QString reportFileName(); bool isNeedToSave(); @@ -88,7 +100,9 @@ public: bool useGrid(){ return m_useGrid;} bool useMagnet() const; void setUseMagnet(bool useMagnet); - + DialogDesigner *dialogDesigner() const; + QWidget* toolWindow(ToolWindowType windowType); + EditorTabType activeTabType(); public slots: void saveToFile(const QString&); bool save(); @@ -155,6 +169,7 @@ private: ReportEnginePrivate* m_report; QGraphicsView *m_view; QTextEdit* m_scriptEditor; + DialogDesigner* m_dialogDesigner; QMainWindow *m_mainWindow; QTabWidget* m_tabWidget; GraphicsViewZoomer* m_zoomer; @@ -163,7 +178,6 @@ private: int m_horizontalGridStep; bool m_useGrid; bool m_useMagnet; -// static ReportDesignWidget* m_instance; }; } diff --git a/limereport/lrreportdesignwindow.cpp b/limereport/lrreportdesignwindow.cpp index 358aa6b..8bdb62d 100644 --- a/limereport/lrreportdesignwindow.cpp +++ b/limereport/lrreportdesignwindow.cpp @@ -73,6 +73,14 @@ ReportDesignWindow::ReportDesignWindow(ReportEnginePrivate *report, QWidget *par createDataWindow(); createScriptWindow(); createObjectsBrowser(); +#ifdef HAVE_QTDESIGNER_INTEGRATION + createDialogWidgetBox(); + createDialogPropertyEditor(); + createDialogObjectInspector(); + createDialogActionEditor(); + createDialogResourceEditor(); + createDialogSignalSlotEditor(); +#endif m_instance=this; m_statusBar=new QStatusBar(this); m_lblReportName = new QLabel(report->reportFileName(),this); @@ -82,6 +90,8 @@ ReportDesignWindow::ReportDesignWindow(ReportEnginePrivate *report, QWidget *par restoreSetting(); m_hideLeftPanel->setChecked(isDockAreaVisible(Qt::LeftDockWidgetArea)); m_hideRightPanel->setChecked(isDockAreaVisible(Qt::RightDockWidgetArea)); + m_editorTabType = ReportDesignWidget::Page; + showDefaultEditors(); } ReportDesignWindow::~ReportDesignWindow() @@ -475,7 +485,6 @@ void ReportDesignWindow::createObjectInspector() m_objectInspector->setModel(m_propertyModel); m_objectInspector->setAlternatingRowColors(true); m_objectInspector->setRootIsDecorated(!m_propertyModel->subclassesAsLevel()); - QDockWidget *objectDoc = new QDockWidget(this); QWidget* w = new QWidget(objectDoc); QVBoxLayout* l = new QVBoxLayout(w); @@ -485,6 +494,7 @@ void ReportDesignWindow::createObjectInspector() objectDoc->setWindowTitle(tr("Object Inspector")); objectDoc->setWidget(w); objectDoc->setObjectName("objectInspector"); + m_pageEditors.append(objectDoc); addDockWidget(Qt::LeftDockWidgetArea,objectDoc); } @@ -497,9 +507,73 @@ void ReportDesignWindow::createObjectsBrowser() doc->setObjectName("structureDoc"); addDockWidget(Qt::RightDockWidgetArea,doc); m_objectsBrowser->setMainWindow(this); + m_pageEditors.append(doc); m_objectsBrowser->setReportEditor(m_reportDesignWidget); } +#ifdef HAVE_QTDESIGNER_INTEGRATION + +void ReportDesignWindow::createDialogWidgetBox() +{ + QDockWidget *doc = new QDockWidget(this); + doc->setWindowTitle(tr("Widget Box")); + doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::WidgetBox)); + doc->setObjectName("WidgetBox"); + addDockWidget(Qt::LeftDockWidgetArea,doc); + m_dialogEditors.append(doc); +} + +void ReportDesignWindow::createDialogPropertyEditor() +{ + QDockWidget *doc = new QDockWidget(this); + doc->setWindowTitle(tr("Property Editor")); + doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::PropertyEditor)); + doc->setObjectName("PropertyEditor"); + addDockWidget(Qt::RightDockWidgetArea,doc); + m_dialogEditors.append(doc); +} + +void ReportDesignWindow::createDialogObjectInspector() +{ + QDockWidget *doc = new QDockWidget(this); + doc->setWindowTitle(tr("Object Inspector")); + doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ObjectInspector)); + doc->setObjectName("ObjectInspector"); + addDockWidget(Qt::RightDockWidgetArea,doc); + m_dialogEditors.append(doc); +} + +void ReportDesignWindow::createDialogActionEditor() +{ + QDockWidget *doc = new QDockWidget(this); + doc->setWindowTitle(tr("Action Editor")); + doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ActionEditor)); + doc->setObjectName("ActionEditor"); + addDockWidget(Qt::BottomDockWidgetArea,doc); + m_dialogEditors.append(doc); +} + +void ReportDesignWindow::createDialogResourceEditor() +{ + QDockWidget *doc = new QDockWidget(this); + doc->setWindowTitle(tr("Resource Editor")); + doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ResourceEditor)); + doc->setObjectName("ResourceEditor"); + addDockWidget(Qt::BottomDockWidgetArea,doc); + m_dialogEditors.append(doc); +} + +void ReportDesignWindow::createDialogSignalSlotEditor() +{ + QDockWidget *doc = new QDockWidget(this); + doc->setWindowTitle(tr("SignalSlot Editor")); + doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::SignalSlotEditor)); + doc->setObjectName("SignalSlotEditor"); + addDockWidget(Qt::BottomDockWidgetArea,doc); + m_dialogEditors.append(doc); +} + +#endif void ReportDesignWindow::createDataWindow() { QDockWidget *dataDoc = new QDockWidget(this); @@ -510,6 +584,7 @@ void ReportDesignWindow::createDataWindow() addDockWidget(Qt::LeftDockWidgetArea,dataDoc); m_dataBrowser->setSettings(settings()); m_dataBrowser->setMainWindow(this); + m_pageEditors.append(dataDoc); m_dataBrowser->setReportEditor(m_reportDesignWidget); } @@ -522,6 +597,7 @@ void ReportDesignWindow::createScriptWindow() dataDoc->setObjectName("scriptDoc"); addDockWidget(Qt::LeftDockWidgetArea,dataDoc); m_scriptBrowser->setReportEditor(m_reportDesignWidget); + m_pageEditors.append(dataDoc); #ifdef HAVE_UI_LOADER m_scriptBrowser->updateDialogsTree(); #endif @@ -544,6 +620,8 @@ void ReportDesignWindow::startNewReport() m_newPageFooter->setEnabled(true); m_newReportHeader->setEnabled(true); m_newReportFooter->setEnabled(true); + m_editorTabType = ReportDesignWidget::Page; + showDefaultEditors(); } void ReportDesignWindow::writePosition() @@ -557,7 +635,16 @@ void ReportDesignWindow::writePosition() void ReportDesignWindow::writeState() { settings()->beginGroup("DesignerWindow"); - settings()->setValue("State",saveState()); + switch (m_editorTabType) { + case ReportDesignWidget::Page: + settings()->setValue("PageEditorsState", saveState()); + settings()->setValue("DialogEditorsState", m_dialogEditorsState); + break; + default: + settings()->setValue("DialogEditorsState", saveState()); + settings()->setValue("PageEditorsState", m_pageEditorsState); + break; + } settings()->setValue("InspectorFirsColumnWidth",m_objectInspector->columnWidth(0)); settings()->endGroup(); settings()->beginGroup("RecentFiles"); @@ -650,9 +737,15 @@ void ReportDesignWindow::restoreSetting() resize(screenWidth*0.8, screenHeight*0.8); move(x, y); } - v = settings()->value("State"); + v = settings()->value("PageEditorsState"); if (v.isValid()){ + m_pageEditorsState = v.toByteArray(); restoreState(v.toByteArray()); + m_editorTabType = ReportDesignWidget::Page; + } + v = settings()->value("DialogEditorsState"); + if (v.isValid()){ + m_dialogEditorsState = v.toByteArray(); } v = settings()->value("InspectorFirsColumnWidth"); if (v.isValid()){ @@ -954,6 +1047,8 @@ void ReportDesignWindow::slotLoadReport() unsetCursor(); setWindowTitle(m_reportDesignWidget->report()->reportName() + " - Lime Report Designer"); addRecentFile(fileName); + m_editorTabType = ReportDesignWidget::Page; + showDefaultEditors(); } } @@ -1120,11 +1215,48 @@ void ReportDesignWindow::updateAvaibleBands(){ } } + +void ReportDesignWindow::showDefaultEditors(){ + foreach (QDockWidget* w, m_pageEditors) { + w->setVisible(m_editorTabType != ReportDesignWidget::Dialog); + } + foreach (QDockWidget* w, m_dialogEditors) { + w->setVisible(m_editorTabType == ReportDesignWidget::Dialog); + } +} + void ReportDesignWindow::slotActivePageChanged() { m_propertyModel->setObject(0); updateRedoUndo(); updateAvaibleBands(); + + switch (m_editorTabType) { + case ReportDesignWidget::Dialog: + m_dialogEditorsState = saveState(); + break; + default: + m_pageEditorsState = saveState(); + break; + } + + m_editorTabType = m_reportDesignWidget->activeTabType(); + + switch (m_editorTabType) { + case ReportDesignWidget::Dialog: + if (!m_dialogEditorsState.isEmpty()) + restoreState(m_dialogEditorsState); + else + showDefaultEditors(); + break; + default: + if (!m_pageEditors.isEmpty()) + restoreState(m_pageEditorsState); + else + showDefaultEditors(); + break; + } + } void ReportDesignWindow::renderStarted() diff --git a/limereport/lrreportdesignwindow.h b/limereport/lrreportdesignwindow.h index 147f47f..ec37638 100644 --- a/limereport/lrreportdesignwindow.h +++ b/limereport/lrreportdesignwindow.h @@ -126,6 +126,7 @@ protected: void hideDockWidgets(Qt::DockWidgetArea area, bool value); bool isDockAreaVisible(Qt::DockWidgetArea area); private: + void initReportEditor(ReportEnginePrivate* report); void createActions(); void createBandsButton(); void createMainMenu(); @@ -134,9 +135,16 @@ private: void createItemsActions(); void createObjectInspector(); void createObjectsBrowser(); - void initReportEditor(ReportEnginePrivate* report); void createDataWindow(); void createScriptWindow(); +#ifdef HAVE_QTDESIGNER_INTEGRATION + void createDialogWidgetBox(); + void createDialogPropertyEditor(); + void createDialogObjectInspector(); + void createDialogActionEditor(); + void createDialogResourceEditor(); + void createDialogSignalSlotEditor(); +#endif void updateRedoUndo(); void updateAvaibleBands(); void startNewReport(); @@ -146,6 +154,7 @@ private: void removeNotExistedRecentFiles(); void removeNotExistedRecentFilesFromMenu(const QString& fileName); void addRecentFile(const QString& fileName); + void showDefaultEditors(); private: static ReportDesignWindow* m_instance; QStatusBar* m_statusBar; @@ -235,6 +244,12 @@ private: QProgressDialog* m_progressDialog; bool m_showProgressDialog; QMap m_recentFiles; + QVector m_pageEditors; + QVector m_dialogEditors; + ReportDesignWidget::EditorTabType m_editorTabType; + QByteArray m_pageEditorsState; + QByteArray m_dialogEditorsState; + }; class ObjectNameValidator : public ValidatorIntf{ diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index 2476930..4c23026 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -341,7 +341,7 @@ void registerChildObjects(ScriptEngineType* se, ScriptValueType* sv){ void ReportRender::initDialogs(){ if (m_scriptEngineContext){ ScriptEngineType* se = ScriptEngineManager::instance().scriptEngine(); - foreach(DialogDescriber::Ptr dialog, m_scriptEngineContext->dialogsDescriber()){ + foreach(DialogDescriber::Ptr dialog, m_scriptEngineContext->dialogDescribers()){ ScriptValueType sv = se->newQObject(m_scriptEngineContext->getDialog(dialog->name())); #ifdef USE_QJSENGINE registerChildObjects(se,&sv); diff --git a/limereport/lrscriptenginemanager.h b/limereport/lrscriptenginemanager.h index 726013b..36ecda2 100644 --- a/limereport/lrscriptenginemanager.h +++ b/limereport/lrscriptenginemanager.h @@ -144,21 +144,21 @@ public: #endif explicit ScriptEngineContext(QObject* parent=0):QObject(parent){} #ifdef HAVE_UI_LOADER - void addDialog(const QString& name, const QByteArray &description); + void addDialog(const QString& name, const QByteArray &description); bool previewDialog(const QString& dialogName); bool containsDialog(const QString& dialogName); - const QVector& dialogsDescriber(){return m_dialogs;} + const QVector& dialogDescribers(){return m_dialogs;} void deleteDialog(const QString& dialogName); QDialog *getDialog(const QString &dialogName); #endif - void clear(); + void clear(); QString initScript() const; - void setInitScript(const QString& initScript); + void setInitScript(const QString& initScript); protected: QObject* createElement(const QString& collectionName,const QString& elementType); - int elementsCount(const QString& collectionName); + int elementsCount(const QString& collectionName); QObject* elementAt(const QString& collectionName,int index); - void collectionLoadFinished(const QString &collectionName); + void collectionLoadFinished(const QString &collectionName); #ifdef HAVE_UI_LOADER QDialog *createDialog(DialogDescriber *cont); QDialog *findDialog(const QString &dialogName); diff --git a/limereport/scriptbrowser/lrscriptbrowser.cpp b/limereport/scriptbrowser/lrscriptbrowser.cpp index 8e6dcc3..1bd052d 100644 --- a/limereport/scriptbrowser/lrscriptbrowser.cpp +++ b/limereport/scriptbrowser/lrscriptbrowser.cpp @@ -117,7 +117,7 @@ void ScriptBrowser::updateDialogsTree() { ui->twDialogs->clear(); ScriptEngineContext* sc = reportEditor()->scriptContext(); - foreach(DialogDescriber::Ptr dc, sc->dialogsDescriber()){ + foreach(DialogDescriber::Ptr dc, sc->dialogDescribers()){ QTreeWidgetItem* dialogItem = new QTreeWidgetItem(ui->twDialogs,QStringList(dc->name())); dialogItem->setIcon(0,QIcon(":/scriptbrowser/images/dialog")); fillDialog(dialogItem,dc->description()); From 0692435b26861b4eb9dcffa8c6703a76bfa64abd Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Tue, 11 Apr 2017 11:23:34 +0300 Subject: [PATCH 6/9] Dialog designers tool bar integration has been added --- limereport/dialogdesigner/dialogdesigner.pri | 3 + limereport/dialogdesigner/dialogdesigner.qrc | 9 ++ .../dialogdesigner/images/buddytool.png | Bin 0 -> 997 bytes limereport/dialogdesigner/images/editform.png | Bin 0 -> 349 bytes .../dialogdesigner/images/signalslottool.png | Bin 0 -> 1128 bytes .../dialogdesigner/images/tabordertool.png | Bin 0 -> 1205 bytes .../dialogdesigner/images/widgettool.png | Bin 0 -> 1039 bytes .../dialogdesigner/lrdialogdesigner.cpp | 99 +++++++++++++++--- limereport/dialogdesigner/lrdialogdesigner.h | 14 ++- limereport/lrreportdesignwidget.cpp | 48 ++++++++- limereport/lrreportdesignwidget.h | 12 ++- limereport/lrreportdesignwindow.cpp | 27 ++++- limereport/lrreportdesignwindow.h | 7 ++ limereport/lrscriptenginemanager.cpp | 11 ++ limereport/lrscriptenginemanager.h | 3 +- 15 files changed, 209 insertions(+), 24 deletions(-) create mode 100644 limereport/dialogdesigner/dialogdesigner.qrc create mode 100644 limereport/dialogdesigner/images/buddytool.png create mode 100644 limereport/dialogdesigner/images/editform.png create mode 100644 limereport/dialogdesigner/images/signalslottool.png create mode 100644 limereport/dialogdesigner/images/tabordertool.png create mode 100644 limereport/dialogdesigner/images/widgettool.png diff --git a/limereport/dialogdesigner/dialogdesigner.pri b/limereport/dialogdesigner/dialogdesigner.pri index 37a1ea1..df76e68 100644 --- a/limereport/dialogdesigner/dialogdesigner.pri +++ b/limereport/dialogdesigner/dialogdesigner.pri @@ -15,3 +15,6 @@ QT += designer designercomponents-private SOURCES += $$PWD/lrdialogdesigner.cpp HEADERS += $$PWD/lrdialogdesigner.h + +RESOURCES += \ + $$PWD/dialogdesigner.qrc diff --git a/limereport/dialogdesigner/dialogdesigner.qrc b/limereport/dialogdesigner/dialogdesigner.qrc new file mode 100644 index 0000000..67c62fb --- /dev/null +++ b/limereport/dialogdesigner/dialogdesigner.qrc @@ -0,0 +1,9 @@ + + + images/buddytool.png + images/editform.png + images/signalslottool.png + images/tabordertool.png + images/widgettool.png + + diff --git a/limereport/dialogdesigner/images/buddytool.png b/limereport/dialogdesigner/images/buddytool.png new file mode 100644 index 0000000000000000000000000000000000000000..4cd968bbf5fb473cecf134e7c1dc0793e869445d GIT binary patch literal 997 zcmVM&= zaCqIkO%%LMHg(=I2^41ZLv&gA?K~%)&gM4jz?bvB&pGG&dCq&D!z&VrM8Qnb|5Pvl zku6b^8jVKu_V!|Ma1c734t;%n{C!|xfNNxA1pWQ}d~A6R^`xq*Dsqw91q=-hp{1n- zjg5^^sZ?ldYePdr16ONnD>^zl_;XWJ6Q4&hnoCMZNN@}o9v+6OUImRt!_CxcHSfuY zVx;cwZXPEPy*D>Evt;U#n3(7opx5iUnYK%d_V#wZn07%i%9x(Jy1IB=t=8~3#Ylo6 zI0vAt$gHfa3<`w;6%`fe>FMF7v>O`l?Cj({#mStKNlr>~44^}#tt*vEgocJfB9UOH z$8PusMME5!jv&&hOs0$_Wg8$5CEh4!K;8)YMd78QZpdA@__JsLlf# zl)(GPD|#j4keoZukdl((9H6eQj+f$ci5@wf3B1i`eHQQ{19)-{i%T*WpM~juBqUK+ zAr6Uf449ahfL5!u)ICWO#n!ZxvTPaPT_K>1!Q!(R{46;SNPS_Bae*n#6Yib|vDMwL z*)CvaW(HKMq~!|~5-kTB6+l_6wdB6Q1s6~=$1+H|7q)v#zKEmq3he+sfGSC^H}LEY z1_Of6$=D8_0_AZly6y+WZ^G(kj@txNmNyvSlPw4b%+Ah2H>3ld1(}oh4m2ge%Y;9= z;SUJb<`xKpnq)pUAr=6ckByCCa&i)*qoW8tp983F;#*}r7W4K1Nv^Qh%!v$=?fVym z1Lo%DU^I>`$;e@Miz^Wpn+wy6IDEZi-`oO8c7-X|&kDi;^YimO^O=tyK?goPJ&mcU zDcn=MVvrmxSpI4X$-;etN!TmDD3bN<8#4Y{7QEK$zbC} z0jSOmLqXhr4iP!?!=XB-QZyCrgE?!9ZSyNEUVH$xx5FWX?ONHvdKYA^XfiD_Jq&*2)<;3$TJbVi36-_g=il`qIOwd2kX!xaZ$hv=M+6gnf=5 z%-sAu5Vb{-5Keg6z6ToxtcEP8Gx3I*Up#5&CjSdyHKgEj;JW7j1y~JP&z$rdsg5DL TV66v=00000NkvXXu0mjfW+uQs literal 0 HcmV?d00001 diff --git a/limereport/dialogdesigner/images/editform.png b/limereport/dialogdesigner/images/editform.png new file mode 100644 index 0000000000000000000000000000000000000000..452fcd8878b7c7999b5317aae0cb90c28df36a36 GIT binary patch literal 349 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAH3s;Exc>kD-yxy_$O8fhL*Fs( z!rTArAO26TYTokr|C4Y3r{DNL<@)~%ENYmvXLW(Yb#V6h5A=elF{r5}E)%Jgjs8 literal 0 HcmV?d00001 diff --git a/limereport/dialogdesigner/images/signalslottool.png b/limereport/dialogdesigner/images/signalslottool.png new file mode 100644 index 0000000000000000000000000000000000000000..e80fd1caa625d6fa6342bec58bc5619386b21b7c GIT binary patch literal 1128 zcmV-u1eg1XP)cij(J$Niew-Fe^V>79p}CBfF#Kb$!;@Xr6oIsZ9~ zbnN2g!X37hN<@?QD9@FMS-QHNbHDQdnYPE<4jlUQhdo-#v^F=Rb->(gnJ9`0f&hSY zI!&om!We_K7NwN$0KL7vbar-j0S^XflUsfE!c|7cMrmDlmAxQXj6O$|&=&2aAGZH}F|O#iK$G&W``#@;ZFV;UM7`~->d z0w|7RwAPCQuACb?`{J`Z*uQUw=S@$~as1>(B4!9eyt#;=#G!OVCX>Qi>*1Mf#=l<_ zaHF58@;t0sv62tp%hS@FUKKtqnVMZ{4BMcQ1miXq_pXi`WE|&%HU}MbU000q% zk~D$j_~4zFXm5RtTZ08Y`QikroFmidIQ-oo^!zo#XkikioHwri2p$UX4?E|Wn~e!1 zn@qBwmF>$J9GT(Z;op*JPIIMi80X;cTjL;p_Y1X{3|`a%^&l;EeAJca~;^EqDjO1raQ`Fbz*syU^0x&r6 zW>I7jarE`{a<4EASUjNmPn6W+5)nkmr&0my)~%(jwTX194jm}Uy$D$k`YrjzDWtf%a>_RX!^pwsMfIt4q2=Kgt9{qXmBY{%f3bP(3D5 uf*=5X8s)Qs!JF5X4Cvmyy`_t#srw(dSG7JJtV|{V0000}MF0#M1Cu_l5A*Z$SYBQhmX?;VxUe9(MHMfom^nUMU0s!!IeEUgC^f|E z^@4hL8Qf}VL2qv_1_uXWx7#HqJv}{exm>ud*1osYV zu~;xLFaU?cA+ULPcv!?4Q$WYslxFN9+N{03J-UHeIkSmVbES!HW^QzJR3_x!>2wOL zp$TKwxYZDCZEevFtX8WOQh;KdUJFu$rdpVJ?)3mV&!dfL(ACuyK1&KxM8g~f^pQ+V zOvs)llarGeA0Nla$cWV1Y_{kI9UUFg%p$(Q*w~l|vysAFb&dv+=g)e5gx%fU(G7mN zX2aW`Hz7W&K}|G)6W{%bxC0ktf5YlT?UmcueY8<>g=Z}yMpGUo&9n)RDXPJlpRG9d zm01Kh;qh-<;c}0m?8i3j{^Sa3e(S*XRtK8f-BLqS-g$jIgmKI_;MKeMheMiKOp~dp zDO@%W$Xjslne?F3F(Nf>J#P4XUdij}X~4frR0CeQhGwTUb237M{lzz7s4i<}w@N*)zU;u<+#C|qb8-4s5Q%9fG2;i2x9gFo z({So$P@qZJV0Ly^rsP+WE5DMADaL1Q33nN= znZl)&^>`^GZ=Li!5u=FSuak@1#vlr>1@X0YO>)P-I41^geG?GE2E3a3n@@wJjC|B| zuAyl-HnsLOlr;yD{cBKG*1xdtV=*}ReLx5s@D8u6tjMc#O)?hXXng<$SA)n85gAA3 zG^UIHNDmFTlCVK>NePTbBQi2FWPRw-?MTh4z;nr&G1-@0iR`K_l(ht9W&M_C_K3lW zO94R}g#IU&_9tha9Ne?Ncz9dFfxkD!?Zu|J)OEJqK`5Vd#)jN;T}VGtfz3PKz*9+w z0y|#G!s*`wf*8n;!C=^+xJU7TVyj}OB1w^~NKw3|NDaX_WoOEVD5|mHonsYpRg;YQ zwbV$?EXCQ@fN-b5M#X)KhZRpMo>e@r*riBNB!+mAxm|ld!UuVk>c^Ht&WCz8s*}L` zrV6~L2pdG0+^e`>@t|U};xWY*#p8-6LNMN{Zp=@-ZR!fwg?iY#L5WsVI7Ib-$w&7< Tg6EMl00000NkvXXu0mjf6WBk& literal 0 HcmV?d00001 diff --git a/limereport/dialogdesigner/images/widgettool.png b/limereport/dialogdesigner/images/widgettool.png new file mode 100644 index 0000000000000000000000000000000000000000..a52224e068c4ac63c6e1ed7c41025d1108e6caaa GIT binary patch literal 1039 zcmV+q1n~QbP)z8wB<%qK}Q^REM+ z&I^UY*xK3}!Z3vEx~SD^sMqTVf9Ltvs&)jhAdBpkOz$F5?sA@59=$lEdbV3qlS4v zp-7Q);0MT$-^9ek1kMaS!k6U;u^6Yq02NUc1LIu=PjT?f~B}@ZgzlFAmWt@qaBAKITLZ_X+fPJ_A8~#t7P?#&K&>iu3S8W|JF52MVZ~N&)rhwPKG=tq{Egu`L51UR9A^|4gOY00I?wLDFZex_Lj4k@8kH9eWsN+9+UoVG+w4kSKB?LXT51x z(Qbo{tMq*i&)!bAiGfZyv!Gk|d8cEF*tGaj6 #include #include +#include +#include #include "pluginmanager_p.h" //#include @@ -30,64 +32,70 @@ DialogDesigner::DialogDesigner(QObject *parent) : QObject(parent) QDesignerComponents::initializePlugins(m_formEditor); QDesignerComponents::createTaskMenu(m_formEditor, this); + m_editWidgetsAction = new QAction(tr("Edit Widgets")); + m_editWidgetsAction->setIcon(QIcon(":/images/images/widgettool.png")); + m_editWidgetsAction->setEnabled(false); + connect(m_editWidgetsAction, SIGNAL(triggered()), this, SLOT(slotEditWidgets())); + connect(m_formEditor->formWindowManager(), SIGNAL(activeFormWindowChanged(QDesignerFormWindowInterface*)), + this, SLOT(slotActiveFormWindowChanged(QDesignerFormWindowInterface*)) ); + + m_modes = new QActionGroup(this); + m_modes->setExclusive(true); + m_modes->addAction(m_editWidgetsAction); + foreach ( QObject* o, QPluginLoader::staticInstances() << m_formEditor->pluginManager()->instances() ) { if ( QDesignerFormEditorPluginInterface* fep = qobject_cast( o ) ) { - // initialize plugin if needed if ( !fep->isInitialized() ) fep->initialize( m_formEditor ); - - // set action chackable -// fep->action()->setCheckable( true ); - -// // add action mode to group -// aModes->addAction( fep->action() ); + fep->action()->setCheckable( true ); + fep->action()->setIcon(QIcon(iconPathByName(fep->action()->objectName()))); + m_modes->addAction(fep->action()); } } - m_widgetBox = QDesignerComponents::createWidgetBox(m_formEditor, 0); m_widgetBox->setWindowTitle(tr("Widget Box")); m_widgetBox->setObjectName(QLatin1String("WidgetBox")); m_formEditor->setWidgetBox(m_widgetBox); m_formEditor->setTopLevel(m_widgetBox); m_designerToolWindows.append(m_widgetBox); - connect(m_widgetBox, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)) ); + connect(m_widgetBox, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)) ); m_objectInspector = QDesignerComponents::createObjectInspector(m_formEditor, 0); m_objectInspector->setWindowTitle(tr("Object Inspector")); m_objectInspector->setObjectName(QLatin1String("ObjectInspector")); m_formEditor->setObjectInspector(m_objectInspector); m_designerToolWindows.append(m_objectInspector); - connect(m_objectInspector, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)) ); + connect(m_objectInspector, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)) ); m_propertyEditor = QDesignerComponents::createPropertyEditor(m_formEditor, 0); m_propertyEditor->setWindowTitle(tr("Property Editor")); m_propertyEditor->setObjectName(QLatin1String("PropertyEditor")); m_formEditor->setPropertyEditor(m_propertyEditor); m_designerToolWindows.append(m_propertyEditor); - connect(m_propertyEditor, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)) ); + connect(m_propertyEditor, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)) ); m_signalSlotEditor = QDesignerComponents::createSignalSlotEditor(m_formEditor, 0); m_signalSlotEditor->setWindowTitle(tr("Signals && Slots Editor")); m_signalSlotEditor->setObjectName(QLatin1String("SignalsAndSlotsEditor")); m_designerToolWindows.append(m_signalSlotEditor); - connect(m_signalSlotEditor, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)) ); + connect(m_signalSlotEditor, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)) ); m_resourcesEditor = QDesignerComponents::createResourceEditor(m_formEditor, 0); m_resourcesEditor->setWindowTitle(tr("Resource Editor")); m_resourcesEditor->setObjectName(QLatin1String("ResourceEditor")); m_designerToolWindows.append(m_resourcesEditor); - connect(m_resourcesEditor, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)) ); + connect(m_resourcesEditor, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)) ); m_actionEditor = QDesignerComponents::createActionEditor(m_formEditor, 0); m_actionEditor->setWindowTitle(tr("Action Editor")); m_actionEditor->setObjectName("ActionEditor"); m_formEditor->setActionEditor(m_actionEditor); m_designerToolWindows.append(m_actionEditor); - connect(m_formEditor, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)) ); + connect(m_formEditor, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)) ); m_designerIntegration = new QDesignerIntegration(m_formEditor,this); m_formEditor->setIntegration(m_designerIntegration); @@ -105,6 +113,28 @@ DialogDesigner::~DialogDesigner() delete m_formEditor; } +void DialogDesigner::initToolBar(QToolBar *tb) +{ + tb->setIconSize(QSize(16,16)); + tb->addAction(m_formEditor->formWindowManager()->actionCopy()); + tb->addAction(m_formEditor->formWindowManager()->actionPaste()); + tb->addAction(m_formEditor->formWindowManager()->actionCut()); + tb->addAction(m_formEditor->formWindowManager()->actionUndo()); + tb->addAction(m_formEditor->formWindowManager()->actionRedo()); + + tb->addActions(m_modes->actions()); + + tb->addAction(m_formEditor->formWindowManager()->actionHorizontalLayout()); + tb->addAction(m_formEditor->formWindowManager()->actionVerticalLayout()); + tb->addAction(m_formEditor->formWindowManager()->actionSplitHorizontal()); + tb->addAction(m_formEditor->formWindowManager()->actionSplitVertical()); + tb->addAction(m_formEditor->formWindowManager()->actionGridLayout()); + m_formEditor->formWindowManager()->actionFormLayout()->setIcon(QIcon(":/images/images/editform.png")); + tb->addAction(m_formEditor->formWindowManager()->actionFormLayout()); + tb->addAction(m_formEditor->formWindowManager()->actionBreakLayout()); + tb->addAction(m_formEditor->formWindowManager()->actionAdjustSize()); +} + QWidget *DialogDesigner::createFormEditor(const QString &content) { QDesignerFormWindowInterface* wnd = m_formEditor->formWindowManager()->createFormWindow(0, Qt::Window); @@ -113,12 +143,22 @@ QWidget *DialogDesigner::createFormEditor(const QString &content) m_formEditor->objectInspector()->setFormWindow(wnd); wnd->editWidgets(); + connect(wnd, SIGNAL(changed()), this, SIGNAL(dialogChanged())); + SharedTools::WidgetHost *placeholder = new SharedTools::WidgetHost(0,wnd); placeholder->setFrameStyle( QFrame::NoFrame | QFrame::Plain ); placeholder->setFocusProxy( wnd ); - return placeholder; + return placeholder; +} +QByteArray DialogDesigner::getDialogDescription(QWidget *form) +{ + SharedTools::WidgetHost* wh = dynamic_cast(form); + if (wh){ + return wh->formWindow()->contents().toUtf8(); + } + return QByteArray(); } void DialogDesigner::setActiveEditor(QWidget *widget) @@ -127,7 +167,6 @@ void DialogDesigner::setActiveEditor(QWidget *widget) if (wh){ m_formEditor->formWindowManager()->setActiveFormWindow(wh->formWindow()); } - } QWidget* DialogDesigner::widgetBox() const @@ -160,7 +199,7 @@ QWidget *DialogDesigner::resourcesEditor() const return m_resourcesEditor; } -void DialogDesigner::objectDestroyed(QObject *object) +void DialogDesigner::slotObjectDestroyed(QObject *object) { for ( int i = 0; iformWindowManager()->formWindowCount(); ++i){ + m_formEditor->formWindowManager()->formWindow(i)->editWidgets(); + } +} + +void DialogDesigner::slotActiveFormWindowChanged(QDesignerFormWindowInterface *formWindow) +{ + if (formWindow){ + m_editWidgetsAction->setEnabled(true); + m_activeWindowName = formWindow->objectName(); + } +} + +QString DialogDesigner::iconPathByName(const QString &name) +{ + if (name.compare("__qt_edit_signals_slots_action") == 0) + return ":/images/images/signalslottool.png"; + if (name.compare("__qt_edit_buddies_action") == 0) + return ":/images/images/buddytool.png"; + if (name.compare("_qt_edit_tab_order_action") == 0) + return ":/images/images/tabordertool.png"; + return ""; +} + } diff --git a/limereport/dialogdesigner/lrdialogdesigner.h b/limereport/dialogdesigner/lrdialogdesigner.h index 2620b71..bebc4dd 100644 --- a/limereport/dialogdesigner/lrdialogdesigner.h +++ b/limereport/dialogdesigner/lrdialogdesigner.h @@ -3,6 +3,7 @@ #include #include +#include class QDesignerFormEditorInterface; class QDesignerFormWindowInterface; @@ -21,7 +22,9 @@ class DialogDesigner : public QObject public: explicit DialogDesigner(QObject *parent = 0); ~DialogDesigner(); + void initToolBar(QToolBar* tb); QWidget* createFormEditor(const QString& content); + QByteArray getDialogDescription(QWidget* form); void setActiveEditor(QWidget* widget); QWidget* widgetBox() const; QWidget* actionEditor() const; @@ -29,8 +32,14 @@ public: QWidget* objectInspector() const; QWidget* signalSlotEditor() const; QWidget* resourcesEditor() const; +signals: + void dialogChanged(); private slots: - void objectDestroyed(QObject* object); + void slotObjectDestroyed(QObject* object); + void slotEditWidgets(); + void slotActiveFormWindowChanged(QDesignerFormWindowInterface *formWindow); +private: + QString iconPathByName(const QString& name); private: QDesignerFormEditorInterface* m_formEditor; QDesignerIntegrationInterface* m_designerIntegration; @@ -41,6 +50,9 @@ private: QWidget* m_signalSlotEditor; QWidget* m_resourcesEditor; QVector m_designerToolWindows; + QAction* m_editWidgetsAction; + QActionGroup* m_modes; + QString m_activeWindowName; }; } // namespace LimeReport diff --git a/limereport/lrreportdesignwidget.cpp b/limereport/lrreportdesignwidget.cpp index 6acb22a..97621ab 100644 --- a/limereport/lrreportdesignwidget.cpp +++ b/limereport/lrreportdesignwidget.cpp @@ -48,7 +48,11 @@ namespace LimeReport { ReportDesignWidget::ReportDesignWidget(ReportEnginePrivate *report, QMainWindow *mainWindow, QWidget *parent) : - QWidget(parent), m_dialogDesigner(new DialogDesigner(this)), m_mainWindow(mainWindow), m_verticalGridStep(10), m_horizontalGridStep(10), m_useGrid(false) + QWidget(parent), +#ifdef HAVE_QTDESIGNER_INTEGRATION + m_dialogDesigner(new DialogDesigner(this)), +#endif + m_mainWindow(mainWindow), m_verticalGridStep(10), m_horizontalGridStep(10), m_useGrid(false) { m_tabWidget = new QTabWidget(this); m_tabWidget->setTabPosition(QTabWidget::South); @@ -74,9 +78,14 @@ ReportDesignWidget::ReportDesignWidget(ReportEnginePrivate *report, QMainWindow m_scriptEditor->setPlainText(report->scriptContext()->initScript()); m_zoomer = new GraphicsViewZoomer(activeView()); + #ifdef Q_OS_WIN m_defaultFont = QFont("Arial",10); #endif + +#ifdef HAVE_QTDESIGNER_INTEGRATION + connect(m_dialogDesigner, SIGNAL(dialogChanged()), this, SLOT(slotDialogChanged())); +#endif } DialogDesigner *ReportDesignWidget::dialogDesigner() const @@ -112,6 +121,20 @@ ReportDesignWidget::EditorTabType ReportDesignWidget::activeTabType() return Page; } +void ReportDesignWidget::initDialogDesignerToolBar(QToolBar *toolBar) +{ + m_dialogDesigner->initToolBar(toolBar); +} + +void ReportDesignWidget::updateDialogs() +{ + for ( int i = 0; icount(); ++i ){ + if (m_tabWidget->tabWhatsThis(i).compare("dialog") == 0){ + m_report->scriptContext()->changeDialog(m_tabWidget->tabText(i), m_dialogDesigner->getDialogDescription(m_tabWidget->widget(i))); + } + } +} + bool ReportDesignWidget::useMagnet() const { return m_useMagnet; @@ -299,7 +322,12 @@ void ReportDesignWidget::slotItemSelected(BaseDesignIntf *item){ } void ReportDesignWidget::saveToFile(const QString &fileName){ + m_report->scriptContext()->setInitScript(m_scriptEditor->toPlainText()); +#ifdef HAVE_QTDESIGNER_INTEGRATION + updateDialogs(); +#endif + if (m_report->saveToFile(fileName)) { m_report->emitSaveFinished(); } @@ -308,6 +336,10 @@ void ReportDesignWidget::saveToFile(const QString &fileName){ bool ReportDesignWidget::save() { m_report->scriptContext()->setInitScript(m_scriptEditor->toPlainText()); +#ifdef HAVE_QTDESIGNER_INTEGRATION + updateDialogs(); +#endif + if (!m_report->reportFileName().isEmpty()){ if (m_report->saveToFile()){ m_report->emitSaveFinished(); @@ -499,12 +531,18 @@ void ReportDesignWidget::setBorders(const BaseDesignIntf::BorderLines& borders) void ReportDesignWidget::previewReport() { report()->scriptContext()->setInitScript(m_scriptEditor->toPlainText()); +#ifdef HAVE_QTDESIGNER_INTEGRATION + updateDialogs(); +#endif report()->previewReport(); } void ReportDesignWidget::printReport() { report()->scriptContext()->setInitScript(m_scriptEditor->toPlainText()); +#ifdef HAVE_QTDESIGNER_INTEGRATION + updateDialogs(); +#endif setCursor(Qt::WaitCursor); report()->printReport(); setCursor(Qt::ArrowCursor); @@ -653,6 +691,14 @@ void ReportDesignWidget::slotCurrentTabChanged(int index) emit activePageChanged(); } +#ifdef HAVE_QTDESIGNER_INTEGRATION + +void ReportDesignWidget::slotDialogChanged() +{ +} + +#endif + bool ReportDesignWidget::eventFilter(QObject *target, QEvent *event) { if (event->type() == QEvent::Wheel){ diff --git a/limereport/lrreportdesignwidget.h b/limereport/lrreportdesignwidget.h index d624617..ee6a157 100644 --- a/limereport/lrreportdesignwidget.h +++ b/limereport/lrreportdesignwidget.h @@ -54,7 +54,6 @@ class ReportDesignWidget : public QWidget { Q_OBJECT Q_PROPERTY(QObject* datasourcesManager READ dataManager()) - friend class ReportDesignWindow; public: enum ToolWindowType{ WidgetBox = 1, @@ -69,6 +68,7 @@ public: Dialog, Script }; + ReportDesignWidget(ReportEnginePrivate* report,QMainWindow *mainWindow,QWidget *parent = 0); ~ReportDesignWidget(); void createStartPage(); void clear(); @@ -103,6 +103,10 @@ public: DialogDesigner *dialogDesigner() const; QWidget* toolWindow(ToolWindowType windowType); EditorTabType activeTabType(); +#ifdef HAVE_QTDESIGNER_INTEGRATION + void initDialogDesignerToolBar(QToolBar* toolBar); + void updateDialogs(); +#endif public slots: void saveToFile(const QString&); bool save(); @@ -135,13 +139,16 @@ public slots: void printReport(); void addPage(); void deleteCurrentPage(); + void slotPagesLoadFinished(); private slots: void slotItemSelected(LimeReport::BaseDesignIntf *item); void slotSelectionChanged(); - void slotPagesLoadFinished(); void slotDatasourceCollectionLoaded(const QString&); void slotSceneRectChanged(QRectF); void slotCurrentTabChanged(int index); +#ifdef HAVE_QTDESIGNER_INTEGRATION + void slotDialogChanged(); +#endif signals: void insertModeStarted(); void itemInserted(LimeReport::PageDesignIntf*,QPointF,const QString&); @@ -164,7 +171,6 @@ protected: void createTabs(); private: bool eventFilter(QObject *target, QEvent *event); - ReportDesignWidget(ReportEnginePrivate* report,QMainWindow *mainWindow,QWidget *parent = 0); private: ReportEnginePrivate* m_report; QGraphicsView *m_view; diff --git a/limereport/lrreportdesignwindow.cpp b/limereport/lrreportdesignwindow.cpp index 8bdb62d..febddfd 100644 --- a/limereport/lrreportdesignwindow.cpp +++ b/limereport/lrreportdesignwindow.cpp @@ -80,6 +80,7 @@ ReportDesignWindow::ReportDesignWindow(ReportEnginePrivate *report, QWidget *par createDialogActionEditor(); createDialogResourceEditor(); createDialogSignalSlotEditor(); + createDialogDesignerToolBar(); #endif m_instance=this; m_statusBar=new QStatusBar(this); @@ -87,11 +88,12 @@ ReportDesignWindow::ReportDesignWindow(ReportEnginePrivate *report, QWidget *par m_statusBar->insertWidget(0,m_lblReportName); setStatusBar(m_statusBar); setWindowTitle("Lime Report Designer"); + showDefaultEditors(); + showDefaultToolBars(); restoreSetting(); m_hideLeftPanel->setChecked(isDockAreaVisible(Qt::LeftDockWidgetArea)); m_hideRightPanel->setChecked(isDockAreaVisible(Qt::RightDockWidgetArea)); m_editorTabType = ReportDesignWidget::Page; - showDefaultEditors(); } ReportDesignWindow::~ReportDesignWindow() @@ -323,6 +325,9 @@ void ReportDesignWindow::createToolBars() addToolBar(m_itemsBordersEditorBar); createReportToolBar(); + + m_pageTools << m_mainToolBar << m_reportToolBar << m_fontEditorBar << m_textAlignmentEditorBar << m_itemsBordersEditorBar; + } void ReportDesignWindow::createItemsActions() @@ -573,6 +578,14 @@ void ReportDesignWindow::createDialogSignalSlotEditor() m_dialogEditors.append(doc); } +void ReportDesignWindow::createDialogDesignerToolBar() +{ + m_dialogDesignerToolBar = addToolBar(tr("Dialog Designer Tools")); + m_dialogDesignerToolBar->setObjectName("DialogDesignerTools"); + m_reportDesignWidget->initDialogDesignerToolBar(m_dialogDesignerToolBar); + m_dialogTools << m_dialogDesignerToolBar; +} + #endif void ReportDesignWindow::createDataWindow() { @@ -622,6 +635,7 @@ void ReportDesignWindow::startNewReport() m_newReportFooter->setEnabled(true); m_editorTabType = ReportDesignWidget::Page; showDefaultEditors(); + showDefaultToolBars(); } void ReportDesignWindow::writePosition() @@ -1048,6 +1062,7 @@ void ReportDesignWindow::slotLoadReport() setWindowTitle(m_reportDesignWidget->report()->reportName() + " - Lime Report Designer"); addRecentFile(fileName); m_editorTabType = ReportDesignWidget::Page; + showDefaultToolBars(); showDefaultEditors(); } } @@ -1215,6 +1230,14 @@ void ReportDesignWindow::updateAvaibleBands(){ } } +void ReportDesignWindow::showDefaultToolBars(){ + foreach (QToolBar* tb, m_pageTools){ + tb->setVisible(m_editorTabType != ReportDesignWidget::Dialog); + } + foreach (QToolBar* tb, m_dialogTools){ + tb->setVisible(m_editorTabType == ReportDesignWidget::Dialog); + } +} void ReportDesignWindow::showDefaultEditors(){ foreach (QDockWidget* w, m_pageEditors) { @@ -1248,12 +1271,14 @@ void ReportDesignWindow::slotActivePageChanged() restoreState(m_dialogEditorsState); else showDefaultEditors(); + showDefaultToolBars(); break; default: if (!m_pageEditors.isEmpty()) restoreState(m_pageEditorsState); else showDefaultEditors(); + showDefaultToolBars(); break; } diff --git a/limereport/lrreportdesignwindow.h b/limereport/lrreportdesignwindow.h index ec37638..0abe16c 100644 --- a/limereport/lrreportdesignwindow.h +++ b/limereport/lrreportdesignwindow.h @@ -144,6 +144,7 @@ private: void createDialogActionEditor(); void createDialogResourceEditor(); void createDialogSignalSlotEditor(); + void createDialogDesignerToolBar(); #endif void updateRedoUndo(); void updateAvaibleBands(); @@ -154,6 +155,7 @@ private: void removeNotExistedRecentFiles(); void removeNotExistedRecentFilesFromMenu(const QString& fileName); void addRecentFile(const QString& fileName); + void showDefaultToolBars(); void showDefaultEditors(); private: static ReportDesignWindow* m_instance; @@ -162,6 +164,9 @@ private: QToolBar* m_fontToolBar; QToolBar* m_reportToolBar; QToolBar* m_alignToolBar; +#ifdef HAVE_QTDESIGNER_INTEGRATION + QToolBar* m_dialogDesignerToolBar; +#endif QToolButton* m_newBandButton; QMenuBar* m_mainMenu; QMenu* m_fileMenu; @@ -249,6 +254,8 @@ private: ReportDesignWidget::EditorTabType m_editorTabType; QByteArray m_pageEditorsState; QByteArray m_dialogEditorsState; + QVector m_pageTools; + QVector m_dialogTools; }; diff --git a/limereport/lrscriptenginemanager.cpp b/limereport/lrscriptenginemanager.cpp index 613b4dc..b57ea88 100644 --- a/limereport/lrscriptenginemanager.cpp +++ b/limereport/lrscriptenginemanager.cpp @@ -1067,6 +1067,17 @@ void ScriptEngineContext::addDialog(const QString& name, const QByteArray& descr m_dialogs.push_back(DialogDescriber::create(name,description)); } +bool ScriptEngineContext::changeDialog(const QString& name, const QByteArray& description) +{ + foreach( DialogDescriber::Ptr describer, m_dialogs){ + if (describer->name().compare(name) == 0){ + describer->setDescription(description); + return true; + } + } + return false; +} + bool ScriptEngineContext::previewDialog(const QString& dialogName) { QDialog* dialog = getDialog(dialogName); diff --git a/limereport/lrscriptenginemanager.h b/limereport/lrscriptenginemanager.h index 36ecda2..af97b63 100644 --- a/limereport/lrscriptenginemanager.h +++ b/limereport/lrscriptenginemanager.h @@ -144,7 +144,8 @@ public: #endif explicit ScriptEngineContext(QObject* parent=0):QObject(parent){} #ifdef HAVE_UI_LOADER - void addDialog(const QString& name, const QByteArray &description); + void addDialog(const QString& name, const QByteArray& description); + bool changeDialog(const QString& name, const QByteArray &description); bool previewDialog(const QString& dialogName); bool containsDialog(const QString& dialogName); const QVector& dialogDescribers(){return m_dialogs;} From 7b04b6efcac7d8140c0755cb60207d2ccf3da205 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Fri, 14 Apr 2017 02:43:34 +0300 Subject: [PATCH 7/9] Dialog Designer intergration has been finished --- limereport/dialogdesigner/dialogdesigner.qrc | 3 + .../dialogdesigner/lrdialogdesigner.cpp | 161 +++++++++++++++--- limereport/dialogdesigner/lrdialogdesigner.h | 43 ++++- limereport/dialogdesigner/templates/Dialog.ui | 18 ++ limereport/images/addDialog.png | Bin 0 -> 332 bytes limereport/images/deleteDialog.png | Bin 0 -> 245 bytes limereport/lrreportdesignwidget.cpp | 161 ++++++++++++++---- limereport/lrreportdesignwidget.h | 24 ++- limereport/lrreportdesignwindow.cpp | 40 ++++- limereport/lrreportdesignwindow.h | 8 + limereport/lrscriptenginemanager.cpp | 49 ++++++ limereport/lrscriptenginemanager.h | 6 + limereport/report.qrc | 2 + limereport/scriptbrowser/lrscriptbrowser.cpp | 8 +- limereport/scriptbrowser/lrscriptbrowser.h | 1 + 15 files changed, 448 insertions(+), 76 deletions(-) create mode 100644 limereport/dialogdesigner/templates/Dialog.ui create mode 100644 limereport/images/addDialog.png create mode 100644 limereport/images/deleteDialog.png diff --git a/limereport/dialogdesigner/dialogdesigner.qrc b/limereport/dialogdesigner/dialogdesigner.qrc index 67c62fb..3911131 100644 --- a/limereport/dialogdesigner/dialogdesigner.qrc +++ b/limereport/dialogdesigner/dialogdesigner.qrc @@ -6,4 +6,7 @@ images/tabordertool.png images/widgettool.png + + templates/Dialog.ui + diff --git a/limereport/dialogdesigner/lrdialogdesigner.cpp b/limereport/dialogdesigner/lrdialogdesigner.cpp index 643cf50..e71fb78 100644 --- a/limereport/dialogdesigner/lrdialogdesigner.cpp +++ b/limereport/dialogdesigner/lrdialogdesigner.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "pluginmanager_p.h" //#include @@ -25,14 +26,14 @@ namespace LimeReport{ -DialogDesigner::DialogDesigner(QObject *parent) : QObject(parent) +DialogDesignerManager::DialogDesignerManager(QObject *parent) : QObject(parent) { QDesignerComponents::initializeResources(); m_formEditor = QDesignerComponents::createFormEditor(this); QDesignerComponents::initializePlugins(m_formEditor); QDesignerComponents::createTaskMenu(m_formEditor, this); - m_editWidgetsAction = new QAction(tr("Edit Widgets")); + m_editWidgetsAction = new QAction(tr("Edit Widgets"), this); m_editWidgetsAction->setIcon(QIcon(":/images/images/widgettool.png")); m_editWidgetsAction->setEnabled(false); connect(m_editWidgetsAction, SIGNAL(triggered()), this, SLOT(slotEditWidgets())); @@ -102,7 +103,7 @@ DialogDesigner::DialogDesigner(QObject *parent) : QObject(parent) } -DialogDesigner::~DialogDesigner() +DialogDesignerManager::~DialogDesignerManager() { for (int i = 0; isetIconSize(QSize(16,16)); + m_formEditor->formWindowManager()->actionCopy()->setIcon(QIcon(":/report/images/copy")); tb->addAction(m_formEditor->formWindowManager()->actionCopy()); + m_formEditor->formWindowManager()->actionPaste()->setIcon(QIcon(":/report/images/paste")); tb->addAction(m_formEditor->formWindowManager()->actionPaste()); + m_formEditor->formWindowManager()->actionCut()->setIcon(QIcon(":/report/images/cut")); tb->addAction(m_formEditor->formWindowManager()->actionCut()); + m_formEditor->formWindowManager()->actionUndo()->setIcon(QIcon(":/report/images/undo")); tb->addAction(m_formEditor->formWindowManager()->actionUndo()); + m_formEditor->formWindowManager()->actionRedo()->setIcon(QIcon(":/report/images/redo")); tb->addAction(m_formEditor->formWindowManager()->actionRedo()); tb->addActions(m_modes->actions()); @@ -135,7 +141,7 @@ void DialogDesigner::initToolBar(QToolBar *tb) tb->addAction(m_formEditor->formWindowManager()->actionAdjustSize()); } -QWidget *DialogDesigner::createFormEditor(const QString &content) +QWidget *DialogDesignerManager::createFormEditor(const QString &content) { QDesignerFormWindowInterface* wnd = m_formEditor->formWindowManager()->createFormWindow(0, Qt::Window); wnd->setContents(content); @@ -143,25 +149,32 @@ QWidget *DialogDesigner::createFormEditor(const QString &content) m_formEditor->objectInspector()->setFormWindow(wnd); wnd->editWidgets(); - connect(wnd, SIGNAL(changed()), this, SIGNAL(dialogChanged())); + DialogDesigner* dialogDesigner = new DialogDesigner(wnd, m_formEditor); - SharedTools::WidgetHost *placeholder = new SharedTools::WidgetHost(0,wnd); - placeholder->setFrameStyle( QFrame::NoFrame | QFrame::Plain ); - placeholder->setFocusProxy( wnd ); + connect(dialogDesigner, SIGNAL(dialogChanged()), this, SLOT(slotDialogChanged())); + connect(dialogDesigner, SIGNAL(dialogNameChanged(QString,QString)), this, SIGNAL(dialogNameChanged(QString,QString))); + connect(dialogDesigner, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*))); + + m_dialogDesigners.append(dialogDesigner); + + return dialogDesigner; - return placeholder; } -QByteArray DialogDesigner::getDialogDescription(QWidget *form) +QByteArray DialogDesignerManager::getDialogDescription(QWidget *form) { - SharedTools::WidgetHost* wh = dynamic_cast(form); - if (wh){ - return wh->formWindow()->contents().toUtf8(); + QByteArray result; + DialogDesigner* dialogDesigner = dynamic_cast(form); + Q_ASSERT(dialogDesigner != NULL); + //SharedTools::WidgetHost* wh = dynamic_cast(form); + if (dialogDesigner){ + result = dialogDesigner->dialogContent(); + //wh->formWindow()->setDirty(false); } - return QByteArray(); + return result; } -void DialogDesigner::setActiveEditor(QWidget *widget) +void DialogDesignerManager::setActiveEditor(QWidget *widget) { SharedTools::WidgetHost* wh = dynamic_cast(widget); if (wh){ @@ -169,52 +182,70 @@ void DialogDesigner::setActiveEditor(QWidget *widget) } } -QWidget* DialogDesigner::widgetBox() const +void DialogDesignerManager::setDirty(bool value) +{ + foreach(DialogDesigner* dialogDesigner, m_dialogDesigners){ + dialogDesigner->setChanged(value); + } +} + +QWidget* DialogDesignerManager::widgetBox() const { return m_widgetBox; } -QWidget* DialogDesigner::actionEditor() const +QWidget* DialogDesignerManager::actionEditor() const { return m_actionEditor; } -QWidget* DialogDesigner::propertyEditor() const +QWidget* DialogDesignerManager::propertyEditor() const { return m_propertyEditor; } -QWidget* DialogDesigner::objectInspector() const +QWidget* DialogDesignerManager::objectInspector() const { return m_objectInspector; } -QWidget *DialogDesigner::signalSlotEditor() const +QWidget *DialogDesignerManager::signalSlotEditor() const { return m_signalSlotEditor; } -QWidget *DialogDesigner::resourcesEditor() const +QWidget *DialogDesignerManager::resourcesEditor() const { return m_resourcesEditor; } -void DialogDesigner::slotObjectDestroyed(QObject *object) +void DialogDesignerManager::slotObjectDestroyed(QObject* object) { + + QList::Iterator it = m_dialogDesigners.begin(); + while(it!=m_dialogDesigners.end()){ + if (*it == object){ + it = m_dialogDesigners.erase(it); + return; + } else { + ++it; + } + } + for ( int i = 0; iformWindowManager()->formWindowCount(); ++i){ m_formEditor->formWindowManager()->formWindow(i)->editWidgets(); } } -void DialogDesigner::slotActiveFormWindowChanged(QDesignerFormWindowInterface *formWindow) +void DialogDesignerManager::slotActiveFormWindowChanged(QDesignerFormWindowInterface *formWindow) { if (formWindow){ m_editWidgetsAction->setEnabled(true); @@ -222,7 +253,15 @@ void DialogDesigner::slotActiveFormWindowChanged(QDesignerFormWindowInterface *f } } -QString DialogDesigner::iconPathByName(const QString &name) +void DialogDesignerManager::slotDialogChanged() +{ + DialogDesigner* dialogDesigner = dynamic_cast(sender()); + if (dialogDesigner){ + emit dialogChanged(dialogDesigner->dialogName()); + } +} + +QString DialogDesignerManager::iconPathByName(const QString &name) { if (name.compare("__qt_edit_signals_slots_action") == 0) return ":/images/images/signalslottool.png"; @@ -233,4 +272,74 @@ QString DialogDesigner::iconPathByName(const QString &name) return ""; } +DialogDesigner::DialogDesigner(QDesignerFormWindowInterface* wnd, QDesignerFormEditorInterface* formEditor, QWidget *parent, Qt::WindowFlags flags) + :QWidget(parent, flags), m_formEditor(formEditor) +{ + m_dialogName = wnd->mainContainer()->objectName(); + connect(wnd, SIGNAL(changed()), this, SIGNAL(dialogChanged())); + connect(wnd->mainContainer(), SIGNAL(objectNameChanged(QString)), this, SLOT(slotMainContainerNameChanged(QString))); + + m_designerHolder = new SharedTools::WidgetHost(this,wnd); + m_designerHolder->setFrameStyle( QFrame::NoFrame | QFrame::Plain ); + m_designerHolder->setFocusProxy( wnd ); + + QVBoxLayout* l = new QVBoxLayout(this); + l->addWidget(m_designerHolder); + setLayout(l); + +} + +DialogDesigner::~DialogDesigner(){} + +QString DialogDesigner::dialogName() const +{ + return m_dialogName; +} + +void DialogDesigner::setDialogName(const QString &dialogName) +{ + m_dialogName = dialogName; +} + +bool DialogDesigner::isChanged() +{ + return m_designerHolder->formWindow()->isDirty(); +} + +void DialogDesigner::setChanged(bool value) +{ + m_designerHolder->formWindow()->setDirty(false); +} + +QByteArray DialogDesigner::dialogContent() +{ + if (m_designerHolder && m_designerHolder->formWindow()) + return m_designerHolder->formWindow()->contents().toUtf8(); + return QByteArray(); +} + +void DialogDesigner::undo() +{ + Q_ASSERT(m_formEditor != NULL); + if (m_formEditor){ + m_formEditor->formWindowManager()->actionUndo()->trigger(); + } +} + +void DialogDesigner::redo() +{ + Q_ASSERT(m_formEditor != NULL); + if (m_formEditor){ + m_formEditor->formWindowManager()->actionRedo()->trigger(); + } +} + +void DialogDesigner::slotMainContainerNameChanged(QString newName) +{ + if (m_dialogName.compare(newName) != 0){ + emit dialogNameChanged(m_dialogName, newName); + m_dialogName = newName; + } +} + } diff --git a/limereport/dialogdesigner/lrdialogdesigner.h b/limereport/dialogdesigner/lrdialogdesigner.h index bebc4dd..8a0bfbe 100644 --- a/limereport/dialogdesigner/lrdialogdesigner.h +++ b/limereport/dialogdesigner/lrdialogdesigner.h @@ -14,18 +14,48 @@ class QDesignerPropertyEditorInterface; class QDesignerObjectInspectorInterface; class QDesignerFormWindowManagerInterface; +namespace SharedTools{ + class WidgetHost; +} + namespace LimeReport{ -class DialogDesigner : public QObject +class DialogDesigner : public QWidget{ + Q_OBJECT +public: + DialogDesigner(QDesignerFormWindowInterface *wnd, QDesignerFormEditorInterface* formEditor, QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags()); + ~DialogDesigner(); + QString dialogName() const; + void setDialogName(const QString &dialogName); + bool isChanged(); + void setChanged(bool value); + QByteArray dialogContent(); +public slots: + void undo(); + void redo(); +signals: + void dialogChanged(); + void dialogNameChanged(QString oldName, QString newName); + +private slots: + void slotMainContainerNameChanged(QString newName); +private: + QString m_dialogName; + SharedTools::WidgetHost* m_designerHolder; + QDesignerFormEditorInterface* m_formEditor; +}; + +class DialogDesignerManager : public QObject { Q_OBJECT public: - explicit DialogDesigner(QObject *parent = 0); - ~DialogDesigner(); + explicit DialogDesignerManager(QObject *parent = 0); + ~DialogDesignerManager(); void initToolBar(QToolBar* tb); QWidget* createFormEditor(const QString& content); QByteArray getDialogDescription(QWidget* form); - void setActiveEditor(QWidget* widget); + void setActiveEditor(QWidget* widget); + void setDirty(bool value); QWidget* widgetBox() const; QWidget* actionEditor() const; QWidget* propertyEditor() const; @@ -33,11 +63,13 @@ public: QWidget* signalSlotEditor() const; QWidget* resourcesEditor() const; signals: - void dialogChanged(); + void dialogChanged(QString dialogName); + void dialogNameChanged(QString oldName, QString newName); private slots: void slotObjectDestroyed(QObject* object); void slotEditWidgets(); void slotActiveFormWindowChanged(QDesignerFormWindowInterface *formWindow); + void slotDialogChanged(); private: QString iconPathByName(const QString& name); private: @@ -53,6 +85,7 @@ private: QAction* m_editWidgetsAction; QActionGroup* m_modes; QString m_activeWindowName; + QList m_dialogDesigners; }; } // namespace LimeReport diff --git a/limereport/dialogdesigner/templates/Dialog.ui b/limereport/dialogdesigner/templates/Dialog.ui new file mode 100644 index 0000000..6eb9e5f --- /dev/null +++ b/limereport/dialogdesigner/templates/Dialog.ui @@ -0,0 +1,18 @@ + + $ClassName$ + + + + 0 + 0 + 400 + 300 + + + + $ClassName$ + + + + + diff --git a/limereport/images/addDialog.png b/limereport/images/addDialog.png new file mode 100644 index 0000000000000000000000000000000000000000..6023700b8d477a8a22e12ced91acbe37d7b7c821 GIT binary patch literal 332 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE(~4_RSXVCc7-eQ3-~9PMKdqdXAw7lL{z#FW zgy`I6?(_OFj6L<7A@^L(+wzzhzRr>Hv6|_;`sKgH7f$o6yVkn8^rG5Ht`3{rug4Zu z<$32h)Zgjj>f}~E$+#xHJ*iQ`daGY_=VGaA_l1{~zMpt{S0KaI3s3aEpSamKC%f?^ zci6-O$E>B!otW18{Br5+&e;k%doMp%Obb*kyu7cqW|7pDi9s)f8t?x3^R+(U=k~w3 aHVhIP!I}+!P0s*5$>8bg=d#Wzp$PzZS%Jj> literal 0 HcmV?d00001 diff --git a/limereport/images/deleteDialog.png b/limereport/images/deleteDialog.png new file mode 100644 index 0000000000000000000000000000000000000000..53914900832bdccb2912a5c7fdb17c0db523f10b GIT binary patch literal 245 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE(~4_RSXVCc7-p*!14`y0f=d z9BA`TymgiR1~1T@1cUl-JnMDUmoDL`YV6I?Hvj^e>C=)De)&5({0PnZuP%B(=zf6* f`-{xkAq))p?}JZWvQW4KbPa>2tDnm{r-UW|gbz>v literal 0 HcmV?d00001 diff --git a/limereport/lrreportdesignwidget.cpp b/limereport/lrreportdesignwidget.cpp index 97621ab..ec1332c 100644 --- a/limereport/lrreportdesignwidget.cpp +++ b/limereport/lrreportdesignwidget.cpp @@ -50,9 +50,9 @@ namespace LimeReport { ReportDesignWidget::ReportDesignWidget(ReportEnginePrivate *report, QMainWindow *mainWindow, QWidget *parent) : QWidget(parent), #ifdef HAVE_QTDESIGNER_INTEGRATION - m_dialogDesigner(new DialogDesigner(this)), + m_dialogDesignerManager(new DialogDesignerManager(this)), #endif - m_mainWindow(mainWindow), m_verticalGridStep(10), m_horizontalGridStep(10), m_useGrid(false) + m_mainWindow(mainWindow), m_verticalGridStep(10), m_horizontalGridStep(10), m_useGrid(false), m_dialogChanged(false) { m_tabWidget = new QTabWidget(this); m_tabWidget->setTabPosition(QTabWidget::South); @@ -75,6 +75,7 @@ ReportDesignWidget::ReportDesignWidget(ReportEnginePrivate *report, QMainWindow connect(m_report,SIGNAL(pagesLoadFinished()),this,SLOT(slotPagesLoadFinished())); connect(m_report,SIGNAL(cleared()),this,SIGNAL(cleared())); connect(m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentTabChanged(int))); + connect(m_report->scriptContext(), SIGNAL(dialogDeleted(QString)), this, SLOT(slotDialogDeleted(QString))); m_scriptEditor->setPlainText(report->scriptContext()->initScript()); m_zoomer = new GraphicsViewZoomer(activeView()); @@ -84,35 +85,49 @@ ReportDesignWidget::ReportDesignWidget(ReportEnginePrivate *report, QMainWindow #endif #ifdef HAVE_QTDESIGNER_INTEGRATION - connect(m_dialogDesigner, SIGNAL(dialogChanged()), this, SLOT(slotDialogChanged())); + connect(m_dialogDesignerManager, SIGNAL(dialogChanged(QString)), + this, SLOT(slotDialogChanged(QString))); + connect(m_dialogDesignerManager, SIGNAL(dialogNameChanged(QString,QString)), + this, SLOT(slotDialogNameChanged(QString,QString))); #endif } -DialogDesigner *ReportDesignWidget::dialogDesigner() const +#ifdef HAVE_QTDESIGNER_INTEGRATION +DialogDesignerManager *ReportDesignWidget::dialogDesignerManager() const { - return m_dialogDesigner; + return m_dialogDesignerManager; } +QString ReportDesignWidget::activeDialogName() +{ + if (activeDialogPage()) + return activeDialogPage()->dialogName(); + return ""; +} + + QWidget *ReportDesignWidget::toolWindow(ReportDesignWidget::ToolWindowType windowType) { switch (windowType) { case WidgetBox: - return dialogDesigner()->widgetBox(); + return dialogDesignerManager()->widgetBox(); case PropertyEditor: - return dialogDesigner()->propertyEditor(); + return dialogDesignerManager()->propertyEditor(); case ObjectInspector: - return dialogDesigner()->objectInspector(); + return dialogDesignerManager()->objectInspector(); case ActionEditor: - return dialogDesigner()->actionEditor(); + return dialogDesignerManager()->actionEditor(); case ResourceEditor: - return dialogDesigner()->resourcesEditor(); + return dialogDesignerManager()->resourcesEditor(); case SignalSlotEditor: - return dialogDesigner()->signalSlotEditor(); + return dialogDesignerManager()->signalSlotEditor(); default: return 0; } } +#endif + ReportDesignWidget::EditorTabType ReportDesignWidget::activeTabType() { QString tabType = m_tabWidget->tabWhatsThis(m_tabWidget->currentIndex()); @@ -121,20 +136,24 @@ ReportDesignWidget::EditorTabType ReportDesignWidget::activeTabType() return Page; } +#ifdef HAVE_QTDESIGNER_INTEGRATION + void ReportDesignWidget::initDialogDesignerToolBar(QToolBar *toolBar) { - m_dialogDesigner->initToolBar(toolBar); + m_dialogDesignerManager->initToolBar(toolBar); } void ReportDesignWidget::updateDialogs() { for ( int i = 0; icount(); ++i ){ if (m_tabWidget->tabWhatsThis(i).compare("dialog") == 0){ - m_report->scriptContext()->changeDialog(m_tabWidget->tabText(i), m_dialogDesigner->getDialogDescription(m_tabWidget->widget(i))); + m_report->scriptContext()->changeDialog(m_tabWidget->tabText(i), m_dialogDesignerManager->getDialogDescription(m_tabWidget->widget(i))); } } } +#endif + bool ReportDesignWidget::useMagnet() const { return m_useMagnet; @@ -210,21 +229,38 @@ void ReportDesignWidget::createTabs(){ pageIndex = m_tabWidget->addTab(view,QIcon(),m_report->pageAt(i)->pageItem()->objectName()); m_tabWidget->setTabWhatsThis(pageIndex, "page"); } -#ifdef HAVE_QTDESIGNER_INTEGRATION - QWidget* dialogEditor; - foreach(DialogDescriber::Ptr dialogDesc, m_report->scriptContext()->dialogDescribers()){ - dialogEditor = m_dialogDesigner->createFormEditor(dialogDesc->description()); - pageIndex = m_tabWidget->addTab(dialogEditor,QIcon(),dialogDesc->name()); - m_tabWidget->setTabWhatsThis(pageIndex,"dialog"); - } -#endif + m_scriptEditor = new QTextEdit(this); pageIndex = m_tabWidget->addTab(m_scriptEditor,QIcon(),tr("Script")); m_tabWidget->setTabWhatsThis(pageIndex,"script"); m_tabWidget->setCurrentIndex(0); +#ifdef HAVE_QTDESIGNER_INTEGRATION + QWidget* dialogDesigner; + foreach(DialogDescriber::Ptr dialogDesc, m_report->scriptContext()->dialogDescribers()){ + dialogDesigner = m_dialogDesignerManager->createFormEditor(dialogDesc->description()); + pageIndex = m_tabWidget->addTab(dialogDesigner,QIcon(),dialogDesc->name()); + m_tabWidget->setTabWhatsThis(pageIndex,"dialog"); + + } +#endif + } +#ifdef HAVE_QTDESIGNER_INTEGRATION +void ReportDesignWidget::createNewDialogTab(const QString& dialogName, const QByteArray& description) +{ + QWidget* dialogDesigner = m_dialogDesignerManager->createFormEditor(description); + int pageIndex = m_tabWidget->addTab(dialogDesigner,QIcon(),dialogName); + m_tabWidget->setTabWhatsThis(pageIndex,"dialog"); +} + +DialogDesigner*ReportDesignWidget::activeDialogPage() +{ + return dynamic_cast(m_tabWidget->currentWidget()); +} +#endif + ReportDesignWidget::~ReportDesignWidget() { delete m_zoomer; @@ -301,6 +337,8 @@ PageDesignIntf * ReportDesignWidget::activePage() return 0; } + + QList ReportDesignWidget::selectedItems(){ return activePage()->selectedItems(); } @@ -321,16 +359,26 @@ void ReportDesignWidget::slotItemSelected(BaseDesignIntf *item){ emit itemSelected(item); } -void ReportDesignWidget::saveToFile(const QString &fileName){ +bool ReportDesignWidget::saveToFile(const QString &fileName){ + bool result = false; m_report->scriptContext()->setInitScript(m_scriptEditor->toPlainText()); #ifdef HAVE_QTDESIGNER_INTEGRATION updateDialogs(); #endif if (m_report->saveToFile(fileName)) { - m_report->emitSaveFinished(); + m_report->emitSaveFinished(); + result = true; } + +#ifdef HAVE_QTDESIGNER_INTEGRATION + if (result){ + m_dialogChanged = false; + m_dialogDesignerManager->setDirty(false); + } +#endif + return result; } bool ReportDesignWidget::save() @@ -340,24 +388,32 @@ bool ReportDesignWidget::save() updateDialogs(); #endif + bool result = false; + if (!m_report->reportFileName().isEmpty()){ if (m_report->saveToFile()){ m_report->emitSaveFinished(); - return true; + result = true; } } else { m_report->emitSaveReport(); if (m_report->isSaved()) { m_report->emitSaveFinished(); - return true; + result = true; } - if (m_report->saveToFile(QFileDialog::getSaveFileName(this,tr("Report file name"),"","Report files (*.lrxml);; All files (*)"))){ + else if (m_report->saveToFile(QFileDialog::getSaveFileName(this,tr("Report file name"),"","Report files (*.lrxml);; All files (*)"))){ m_report->emitSaveFinished(); - return true; + result = true; }; } - return false; +#ifdef HAVE_QTDESIGNER_INTEGRATION + if (result){ + m_dialogChanged = false; + m_dialogDesignerManager->setDirty(false); + } +#endif + return result; } bool ReportDesignWidget::loadFromFile(const QString &fileName) @@ -367,6 +423,7 @@ bool ReportDesignWidget::loadFromFile(const QString &fileName) //connectPage(m_report->pageAt(0)); m_scriptEditor->setPlainText(m_report->scriptContext()->initScript()); emit loaded(); + m_dialogChanged = false; return true; } else { QMessageBox::critical(this,tr("Error"),tr("Wrong file format")); @@ -390,7 +447,7 @@ QString ReportDesignWidget::reportFileName() bool ReportDesignWidget::isNeedToSave() { if(m_report) - return m_report->isNeedToSave(); + return (m_report->isNeedToSave() || m_dialogChanged); return false; } @@ -409,12 +466,20 @@ void ReportDesignWidget::undo() { if (activePage()) activePage()->undo(); +#ifdef HAVE_QTDESIGNER_INTEGRATION + if (activeDialogPage()) + activeDialogPage()->undo(); +#endif } void ReportDesignWidget::redo() { if (activePage()) activePage()->redo(); +#ifdef HAVE_QTDESIGNER_INTEGRATION + if (activeDialogPage()) + activeDialogPage()->redo(); +#endif } void ReportDesignWidget::copy() @@ -667,6 +732,16 @@ void ReportDesignWidget::slotPagesLoadFinished() emit loaded(); } +void ReportDesignWidget::slotDialogDeleted(QString dialogName) +{ + for (int i = 0; icount(); ++i ){ + if (m_tabWidget->tabText(i).compare(dialogName) == 0){ + delete m_tabWidget->widget(i); + break; + } + } +} + void ReportDesignWidget::slotDatasourceCollectionLoaded(const QString & /*collectionName*/) { } @@ -685,16 +760,40 @@ void ReportDesignWidget::slotCurrentTabChanged(int index) } m_zoomer->setView(view); } +#ifdef HAVE_QTDESIGNER_INTEGRATION if (activeTabType() == Dialog){ - m_dialogDesigner->setActiveEditor(m_tabWidget->widget(index)); + m_dialogDesignerManager->setActiveEditor(m_tabWidget->widget(index)); } + updateDialogs(); +#endif emit activePageChanged(); } #ifdef HAVE_QTDESIGNER_INTEGRATION -void ReportDesignWidget::slotDialogChanged() +void ReportDesignWidget::addNewDialog() { + QFile templateUi(":/templates/templates/Dialog.ui"); + templateUi.open(QIODevice::ReadOnly|QIODevice::Text); + QString templateStr = templateUi.readAll(); + QString dialogName = m_report->scriptContext()->getNewDialogName(); + templateStr.replace("$ClassName$", dialogName); + m_report->scriptContext()->addDialog(dialogName,templateStr.toUtf8()); + createNewDialogTab(dialogName, templateStr.toUtf8()); +} + +void ReportDesignWidget::slotDialogChanged(QString ) +{ + m_dialogChanged = true; +} + +void ReportDesignWidget::slotDialogNameChanged(QString oldName, QString newName) +{ + for (int i = 0; i < m_tabWidget->count(); ++i){ + if (m_tabWidget->tabText(i).compare(oldName) == 0) + m_tabWidget->setTabText(i, newName); + } + m_report->scriptContext()->changeDialogName(oldName, newName); } #endif diff --git a/limereport/lrreportdesignwidget.h b/limereport/lrreportdesignwidget.h index ee6a157..455b685 100644 --- a/limereport/lrreportdesignwidget.h +++ b/limereport/lrreportdesignwidget.h @@ -48,6 +48,7 @@ namespace LimeReport { class ReportEnginePrivate; class DataBrowser; class ReportDesignWindow; +class DialogDesignerManager; class DialogDesigner; class ReportDesignWidget : public QWidget @@ -100,15 +101,17 @@ public: bool useGrid(){ return m_useGrid;} bool useMagnet() const; void setUseMagnet(bool useMagnet); - DialogDesigner *dialogDesigner() const; - QWidget* toolWindow(ToolWindowType windowType); EditorTabType activeTabType(); #ifdef HAVE_QTDESIGNER_INTEGRATION void initDialogDesignerToolBar(QToolBar* toolBar); void updateDialogs(); + DialogDesignerManager *dialogDesignerManager() const; + QString activeDialogName(); + DialogDesigner* activeDialogPage(); + QWidget* toolWindow(ToolWindowType windowType); #endif public slots: - void saveToFile(const QString&); + bool saveToFile(const QString&); bool save(); bool loadFromFile(const QString&); void deleteSelectedItems(); @@ -140,6 +143,10 @@ public slots: void addPage(); void deleteCurrentPage(); void slotPagesLoadFinished(); + void slotDialogDeleted(QString dialogName); +#ifdef HAVE_QTDESIGNER_INTEGRATION + void addNewDialog(); +#endif private slots: void slotItemSelected(LimeReport::BaseDesignIntf *item); void slotSelectionChanged(); @@ -147,7 +154,8 @@ private slots: void slotSceneRectChanged(QRectF); void slotCurrentTabChanged(int index); #ifdef HAVE_QTDESIGNER_INTEGRATION - void slotDialogChanged(); + void slotDialogChanged(QString); + void slotDialogNameChanged(QString oldName, QString newName); #endif signals: void insertModeStarted(); @@ -169,13 +177,18 @@ signals: void pageDeleted(); protected: void createTabs(); +#ifdef HAVE_QTDESIGNER_INTEGRATION + void createNewDialogTab(const QString& dialogName,const QByteArray& description); +#endif private: bool eventFilter(QObject *target, QEvent *event); private: ReportEnginePrivate* m_report; QGraphicsView *m_view; QTextEdit* m_scriptEditor; - DialogDesigner* m_dialogDesigner; +#ifdef HAVE_QTDESIGNER_INTEGRATION + DialogDesignerManager* m_dialogDesignerManager; +#endif QMainWindow *m_mainWindow; QTabWidget* m_tabWidget; GraphicsViewZoomer* m_zoomer; @@ -184,6 +197,7 @@ private: int m_horizontalGridStep; bool m_useGrid; bool m_useMagnet; + bool m_dialogChanged; }; } diff --git a/limereport/lrreportdesignwindow.cpp b/limereport/lrreportdesignwindow.cpp index febddfd..b2df5a1 100644 --- a/limereport/lrreportdesignwindow.cpp +++ b/limereport/lrreportdesignwindow.cpp @@ -211,11 +211,6 @@ void ReportDesignWindow::createActions() m_testAction->setIcon(QIcon(":/report/images/pin")); connect(m_testAction,SIGNAL(triggered()),this,SLOT(slotTest())); -// m_printReportAction = new QAction(tr("Print Report"),this); -// m_printReportAction->setIcon(QIcon(":/report/images/print")); -// m_printReportAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_P)); -// connect(m_printReportAction,SIGNAL(triggered()),this,SLOT(slotPrintReport())); - m_editLayoutMode = new QAction(tr("Edit layouts mode"),this); m_editLayoutMode->setIcon(QIcon(":/report/images/editlayout")); m_editLayoutMode->setCheckable(true); @@ -231,15 +226,22 @@ void ReportDesignWindow::createActions() m_hideLeftPanel = new QAction(tr("Hide left panel"),this); m_hideLeftPanel->setCheckable(true); -// m_hideLeftPanel->setChecked(true); m_hideLeftPanel->setIcon(QIcon(":/report/images/hideLeftPanel")); connect(m_hideLeftPanel,SIGNAL(toggled(bool)), this, SLOT(slotHideLeftPanel(bool))); m_hideRightPanel = new QAction(tr("Hide right panel"),this); m_hideRightPanel->setCheckable(true); -// m_hideRightPanel->setChecked(true); m_hideRightPanel->setIcon(QIcon(":/report/images/hideRightPanel")); connect(m_hideRightPanel,SIGNAL(toggled(bool)), this, SLOT(slotHideRightPanel(bool))); +#ifdef HAVE_QTDESIGNER_INTEGRATION + m_deleteDialogAction = new QAction(tr("Delete dialog"), this); + m_deleteDialogAction->setIcon(QIcon(":/report//images/deleteDialog")); + connect(m_deleteDialogAction, SIGNAL(triggered()), this, SLOT(slotDeleteDialog())); + + m_addNewDialogAction = new QAction(tr("Add new dialog"), this); + m_addNewDialogAction->setIcon(QIcon(":/report//images/addDialog")); + connect(m_addNewDialogAction, SIGNAL(triggered()), this, SLOT(slotAddNewDialog())); +#endif } void ReportDesignWindow::createReportToolBar() @@ -252,7 +254,6 @@ void ReportDesignWindow::createReportToolBar() m_reportToolBar->setObjectName("reportTools"); createItemsActions(); m_reportToolBar->addSeparator(); - //m_reportToolBar->addAction(m_editLayoutMode); m_reportToolBar->addAction(m_addHLayout); m_reportToolBar->addSeparator(); m_reportToolBar->addAction(m_deleteItemAction); @@ -286,6 +287,9 @@ void ReportDesignWindow::createToolBars() m_mainToolBar->addAction(m_newPageAction); m_mainToolBar->addAction(m_deletePageAction); +#ifdef HAVE_QTDESIGNER_INTEGRATION + m_mainToolBar->addAction(m_addNewDialogAction); +#endif m_mainToolBar->addSeparator(); m_mainToolBar->addAction(m_copyAction); @@ -582,6 +586,11 @@ void ReportDesignWindow::createDialogDesignerToolBar() { m_dialogDesignerToolBar = addToolBar(tr("Dialog Designer Tools")); m_dialogDesignerToolBar->setObjectName("DialogDesignerTools"); + m_dialogDesignerToolBar->addAction(m_saveReportAction); + m_dialogDesignerToolBar->addAction(m_previewReportAction); + m_dialogDesignerToolBar->addSeparator(); + m_dialogDesignerToolBar->addAction(m_deleteDialogAction); + m_dialogDesignerToolBar->addSeparator(); m_reportDesignWidget->initDialogDesignerToolBar(m_dialogDesignerToolBar); m_dialogTools << m_dialogDesignerToolBar; } @@ -1257,6 +1266,7 @@ void ReportDesignWindow::slotActivePageChanged() switch (m_editorTabType) { case ReportDesignWidget::Dialog: m_dialogEditorsState = saveState(); + m_scriptBrowser->updateDialogsTree(); break; default: m_pageEditorsState = saveState(); @@ -1388,6 +1398,20 @@ void ReportDesignWindow::slotPageDeleted() m_deletePageAction->setEnabled(m_reportDesignWidget->report()->pageCount()>1); } +#ifdef HAVE_QTDESIGNER_INTEGRATION +void ReportDesignWindow::slotDeleteDialog() +{ + if ( m_editorTabType == ReportDesignWidget::Dialog ){ + m_reportDesignWidget->report()->scriptContext()->deleteDialog(m_reportDesignWidget->activeDialogName()); + } +} + +void ReportDesignWindow::slotAddNewDialog() +{ + m_reportDesignWidget->addNewDialog(); +} +#endif + void ReportDesignWindow::closeEvent(QCloseEvent * event) { if (checkNeedToSave()){ diff --git a/limereport/lrreportdesignwindow.h b/limereport/lrreportdesignwindow.h index 0abe16c..c3e2578 100644 --- a/limereport/lrreportdesignwindow.h +++ b/limereport/lrreportdesignwindow.h @@ -119,6 +119,10 @@ private slots: void slotLoadRecentFile(const QString fileName); void slotPageAdded(PageDesignIntf* ); void slotPageDeleted(); +#ifdef HAVE_QTDESIGNER_INTEGRATION + void slotDeleteDialog(); + void slotAddNewDialog(); +#endif protected: void closeEvent(QCloseEvent *event); void resizeEvent(QResizeEvent *); @@ -217,6 +221,10 @@ private: QAction* m_addHLayout; QAction* m_hideLeftPanel; QAction* m_hideRightPanel; +#ifdef HAVE_QTDESIGNER_INTEGRATION + QAction* m_deleteDialogAction; + QAction* m_addNewDialogAction; +#endif QMenu* m_recentFilesMenu; QSignalMapper* m_bandsAddSignalsMap; diff --git a/limereport/lrscriptenginemanager.cpp b/limereport/lrscriptenginemanager.cpp index b57ea88..785640a 100644 --- a/limereport/lrscriptenginemanager.cpp +++ b/limereport/lrscriptenginemanager.cpp @@ -1065,6 +1065,7 @@ void DialogDescriber::setDescription(const QByteArray &description) void ScriptEngineContext::addDialog(const QString& name, const QByteArray& description) { m_dialogs.push_back(DialogDescriber::create(name,description)); + emit dialogAdded(name); } bool ScriptEngineContext::changeDialog(const QString& name, const QByteArray& description) @@ -1072,6 +1073,37 @@ bool ScriptEngineContext::changeDialog(const QString& name, const QByteArray& de foreach( DialogDescriber::Ptr describer, m_dialogs){ if (describer->name().compare(name) == 0){ describer->setDescription(description); + { + QList::Iterator it = m_createdDialogs.begin(); + while(it!=m_createdDialogs.end()){ + if ((*it)->objectName()==name){ + it = m_createdDialogs.erase(it); + } else { + ++it; + } + } + } + return true; + } + } + return false; +} + +bool ScriptEngineContext::changeDialogName(const QString& oldName, const QString& newName) +{ + foreach( DialogDescriber::Ptr describer, m_dialogs){ + if (describer->name().compare(oldName) == 0){ + describer->setName(newName); + { + QList::Iterator it = m_createdDialogs.begin(); + while(it!=m_createdDialogs.end()){ + if ((*it)->objectName()==oldName){ + it = m_createdDialogs.erase(it); + } else { + ++it; + } + } + } return true; } } @@ -1106,6 +1138,7 @@ void ScriptEngineContext::deleteDialog(const QString& dialogName) while(it!=m_dialogs.end()){ if ((*it)->name()==dialogName){ it = m_dialogs.erase(it); + emit dialogDeleted(dialogName); } else { ++it; } @@ -1188,6 +1221,10 @@ QDialog* ScriptEngineContext::createDialog(DialogDescriber* cont) buffer.open(QIODevice::ReadOnly); QDialog* dialog = dynamic_cast(loader.load(&buffer)); m_createdDialogs.push_back(QSharedPointer(dialog)); + if (cont->name().compare(dialog->objectName())){ + cont->setName(dialog->objectName()); + emit dialogNameChanged(dialog->objectName()); + } return dialog; } @@ -1225,6 +1262,18 @@ QDialog* ScriptEngineContext::getDialog(const QString& dialogName) } return 0; } + +QString ScriptEngineContext::getNewDialogName() +{ + QString result = "Dialog"; + int index = m_dialogs.size() - 1; + while (containsDialog(result)){ + index++; + result = QString("Dialog%1").arg(index); + } + return result; +} + #endif QString ScriptEngineContext::initScript() const { diff --git a/limereport/lrscriptenginemanager.h b/limereport/lrscriptenginemanager.h index af97b63..235599a 100644 --- a/limereport/lrscriptenginemanager.h +++ b/limereport/lrscriptenginemanager.h @@ -146,15 +146,21 @@ public: #ifdef HAVE_UI_LOADER void addDialog(const QString& name, const QByteArray& description); bool changeDialog(const QString& name, const QByteArray &description); + bool changeDialogName(const QString& oldName, const QString& newName); bool previewDialog(const QString& dialogName); bool containsDialog(const QString& dialogName); const QVector& dialogDescribers(){return m_dialogs;} void deleteDialog(const QString& dialogName); QDialog *getDialog(const QString &dialogName); + QString getNewDialogName(); #endif void clear(); QString initScript() const; void setInitScript(const QString& initScript); +signals: + void dialogNameChanged(QString dialogName); + void dialogDeleted(QString dialogName); + void dialogAdded(QString dialogName); protected: QObject* createElement(const QString& collectionName,const QString& elementType); int elementsCount(const QString& collectionName); diff --git a/limereport/report.qrc b/limereport/report.qrc index 6548420..1e7c5d6 100644 --- a/limereport/report.qrc +++ b/limereport/report.qrc @@ -175,5 +175,7 @@ images/addBand2.png images/edit_control_4_24.png images/logo_32x32_1.png + images/addDialog.png + images/deleteDialog.png diff --git a/limereport/scriptbrowser/lrscriptbrowser.cpp b/limereport/scriptbrowser/lrscriptbrowser.cpp index 1bd052d..1ef6b73 100644 --- a/limereport/scriptbrowser/lrscriptbrowser.cpp +++ b/limereport/scriptbrowser/lrscriptbrowser.cpp @@ -59,6 +59,7 @@ void ScriptBrowser::setReportEditor(ReportDesignWidget* report) m_report=report; connect(m_report,SIGNAL(cleared()),this,SLOT(slotClear())); connect(m_report,SIGNAL(loaded()),this,SLOT(slotUpdate())); + connect(m_report->scriptContext(), SIGNAL(dialogAdded(QString)), this, SLOT(slotDialogAdded(QString))); updateFunctionTree(); } @@ -138,6 +139,11 @@ void ScriptBrowser::slotUpdate() updateFunctionTree(); } +void ScriptBrowser::slotDialogAdded(QString) +{ + updateDialogsTree(); +} + #ifdef HAVE_UI_LOADER void ScriptBrowser::on_tbAddDialog_clicked() { @@ -157,7 +163,7 @@ void ScriptBrowser::on_tbAddDialog_clicked() if (!m_report->scriptContext()->containsDialog(dialog->objectName())){ file.seek(0); m_report->scriptContext()->addDialog(dialog->objectName(),file.readAll()); - updateDialogsTree(); + //updateDialogsTree(); } else { QMessageBox::critical(this,tr("Error"),tr("Dialog with name: %1 already exists").arg(dialog->objectName())); } diff --git a/limereport/scriptbrowser/lrscriptbrowser.h b/limereport/scriptbrowser/lrscriptbrowser.h index 3214617..dd7d9ae 100644 --- a/limereport/scriptbrowser/lrscriptbrowser.h +++ b/limereport/scriptbrowser/lrscriptbrowser.h @@ -62,6 +62,7 @@ protected: private slots: void slotClear(); void slotUpdate(); + void slotDialogAdded(QString); #ifdef HAVE_UI_LOADER void on_tbAddDialog_clicked(); void on_tbRunDialog_clicked(); From 02a8ef8b5c760228aa4ead8e45a11ded3b067f3a Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Tue, 18 Apr 2017 20:00:59 +0300 Subject: [PATCH 8/9] Crash on destroy has been fixed --- .../dialogdesigner/lrdialogdesigner.cpp | 2 +- limereport/lrreportdesignwidget.cpp | 1 + limereport/lrreportdesignwindow.cpp | 63 +++++++++++-------- limereport/lrreportdesignwindow.h | 1 + 4 files changed, 40 insertions(+), 27 deletions(-) diff --git a/limereport/dialogdesigner/lrdialogdesigner.cpp b/limereport/dialogdesigner/lrdialogdesigner.cpp index e71fb78..6a33752 100644 --- a/limereport/dialogdesigner/lrdialogdesigner.cpp +++ b/limereport/dialogdesigner/lrdialogdesigner.cpp @@ -96,7 +96,7 @@ DialogDesignerManager::DialogDesignerManager(QObject *parent) : QObject(parent) m_actionEditor->setObjectName("ActionEditor"); m_formEditor->setActionEditor(m_actionEditor); m_designerToolWindows.append(m_actionEditor); - connect(m_formEditor, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)) ); + connect(m_actionEditor, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)) ); m_designerIntegration = new QDesignerIntegration(m_formEditor,this); m_formEditor->setIntegration(m_designerIntegration); diff --git a/limereport/lrreportdesignwidget.cpp b/limereport/lrreportdesignwidget.cpp index ec1332c..7c7c2bc 100644 --- a/limereport/lrreportdesignwidget.cpp +++ b/limereport/lrreportdesignwidget.cpp @@ -253,6 +253,7 @@ void ReportDesignWidget::createNewDialogTab(const QString& dialogName, const QBy QWidget* dialogDesigner = m_dialogDesignerManager->createFormEditor(description); int pageIndex = m_tabWidget->addTab(dialogDesigner,QIcon(),dialogName); m_tabWidget->setTabWhatsThis(pageIndex,"dialog"); + m_tabWidget->setCurrentIndex(pageIndex); } DialogDesigner*ReportDesignWidget::activeDialogPage() diff --git a/limereport/lrreportdesignwindow.cpp b/limereport/lrreportdesignwindow.cpp index b2df5a1..b44eff7 100644 --- a/limereport/lrreportdesignwindow.cpp +++ b/limereport/lrreportdesignwindow.cpp @@ -78,8 +78,8 @@ ReportDesignWindow::ReportDesignWindow(ReportEnginePrivate *report, QWidget *par createDialogPropertyEditor(); createDialogObjectInspector(); createDialogActionEditor(); - createDialogResourceEditor(); createDialogSignalSlotEditor(); + createDialogResourceEditor(); createDialogDesignerToolBar(); #endif m_instance=this; @@ -330,7 +330,9 @@ void ReportDesignWindow::createToolBars() createReportToolBar(); - m_pageTools << m_mainToolBar << m_reportToolBar << m_fontEditorBar << m_textAlignmentEditorBar << m_itemsBordersEditorBar; + m_pageTools << m_mainToolBar << m_reportToolBar << m_fontEditorBar + << m_textAlignmentEditorBar << m_itemsAlignmentEditorBar + << m_itemsBordersEditorBar; } @@ -544,42 +546,45 @@ void ReportDesignWindow::createDialogPropertyEditor() void ReportDesignWindow::createDialogObjectInspector() { - QDockWidget *doc = new QDockWidget(this); - doc->setWindowTitle(tr("Object Inspector")); - doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ObjectInspector)); - doc->setObjectName("ObjectInspector"); - addDockWidget(Qt::RightDockWidgetArea,doc); - m_dialogEditors.append(doc); + QDockWidget *dock = new QDockWidget(this); + dock->setWindowTitle(tr("Object Inspector")); + dock->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ObjectInspector)); + dock->setObjectName("ObjectInspector"); + addDockWidget(Qt::RightDockWidgetArea,dock); + m_dialogEditors.append(dock); } void ReportDesignWindow::createDialogActionEditor() { - QDockWidget *doc = new QDockWidget(this); - doc->setWindowTitle(tr("Action Editor")); - doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ActionEditor)); - doc->setObjectName("ActionEditor"); - addDockWidget(Qt::BottomDockWidgetArea,doc); - m_dialogEditors.append(doc); + QDockWidget *dock = new QDockWidget(this); + dock->setWindowTitle(tr("Action Editor")); + dock->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ActionEditor)); + dock->setObjectName("ActionEditor"); + addDockWidget(Qt::BottomDockWidgetArea,dock); + m_dialogEditors.append(dock); + m_docksToTabify.append(dock); } void ReportDesignWindow::createDialogResourceEditor() { - QDockWidget *doc = new QDockWidget(this); - doc->setWindowTitle(tr("Resource Editor")); - doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ResourceEditor)); - doc->setObjectName("ResourceEditor"); - addDockWidget(Qt::BottomDockWidgetArea,doc); - m_dialogEditors.append(doc); + QDockWidget *dock = new QDockWidget(this); + dock->setWindowTitle(tr("Resource Editor")); + dock->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ResourceEditor)); + dock->setObjectName("ResourceEditor"); + addDockWidget(Qt::BottomDockWidgetArea,dock); + m_dialogEditors.append(dock); + m_docksToTabify.append(dock); } void ReportDesignWindow::createDialogSignalSlotEditor() { - QDockWidget *doc = new QDockWidget(this); - doc->setWindowTitle(tr("SignalSlot Editor")); - doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::SignalSlotEditor)); - doc->setObjectName("SignalSlotEditor"); - addDockWidget(Qt::BottomDockWidgetArea,doc); - m_dialogEditors.append(doc); + QDockWidget *dock = new QDockWidget(this); + dock->setWindowTitle(tr("SignalSlot Editor")); + dock->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::SignalSlotEditor)); + dock->setObjectName("SignalSlotEditor"); + addDockWidget(Qt::BottomDockWidgetArea,dock); + m_dialogEditors.append(dock); + m_docksToTabify.append(dock); } void ReportDesignWindow::createDialogDesignerToolBar() @@ -1252,9 +1257,15 @@ void ReportDesignWindow::showDefaultEditors(){ foreach (QDockWidget* w, m_pageEditors) { w->setVisible(m_editorTabType != ReportDesignWidget::Dialog); } +#ifdef HAVE_QTDESIGNER_INTEGRATION foreach (QDockWidget* w, m_dialogEditors) { w->setVisible(m_editorTabType == ReportDesignWidget::Dialog); } + for ( int i = 0; i < m_docksToTabify.size() - 1; ++i){ + tabifyDockWidget(m_docksToTabify.at(i),m_docksToTabify.at(i+1)); + } + m_docksToTabify.at(0)->raise(); +#endif } void ReportDesignWindow::slotActivePageChanged() diff --git a/limereport/lrreportdesignwindow.h b/limereport/lrreportdesignwindow.h index c3e2578..658c984 100644 --- a/limereport/lrreportdesignwindow.h +++ b/limereport/lrreportdesignwindow.h @@ -259,6 +259,7 @@ private: QMap m_recentFiles; QVector m_pageEditors; QVector m_dialogEditors; + QVector m_docksToTabify; ReportDesignWidget::EditorTabType m_editorTabType; QByteArray m_pageEditorsState; QByteArray m_dialogEditorsState; From 3bdec95a8c87bd6a7053f60ad6a72b4dce3dd82f Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Tue, 18 Apr 2017 21:47:35 +0300 Subject: [PATCH 9/9] Icons have been changed --- limereport/images/copy3.png | Bin 0 -> 778 bytes limereport/images/paste2.png | Bin 0 -> 749 bytes limereport/images/save.png | Bin 868 -> 536 bytes limereport/images/toBack.png | Bin 591 -> 334 bytes limereport/images/toBottom.png | Bin 518 -> 295 bytes limereport/images/toCenter.png | Bin 505 -> 302 bytes limereport/images/toFront.png | Bin 634 -> 359 bytes limereport/images/toLeft1.png | Bin 503 -> 297 bytes limereport/images/toRight.png | Bin 504 -> 299 bytes limereport/images/toSameHeight.png | Bin 459 -> 239 bytes limereport/images/toSameWidth.png | Bin 453 -> 235 bytes limereport/images/toTop.png | Bin 516 -> 292 bytes limereport/images/toVCernter.png | Bin 518 -> 297 bytes limereport/images/zoom_in1.png | Bin 845 -> 467 bytes limereport/images/zoom_out1.png | Bin 849 -> 466 bytes limereport/report.qrc | 6 ++++-- 16 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 limereport/images/copy3.png create mode 100644 limereport/images/paste2.png diff --git a/limereport/images/copy3.png b/limereport/images/copy3.png new file mode 100644 index 0000000000000000000000000000000000000000..928dcf115df53f384e4c35ee17bd4f9dff61f145 GIT binary patch literal 778 zcmV+l1NHogP)i$__4I7)RUV~Impfj3HaCSiy` zSAjN4b|+tlK30GwRqPkJm- zd@Vm=B>(^a?eXbjnl@sXHTe4W{{H;?{QBPJ*x=~f`1$tp`SPyOtCPZ#p~#=i-OBm< z_uAvp^Y-x5=FnoXTwuIaV6|6pwP}j6hw=66R)00^^XkXm!eg>rcg|{b$!KD?Sy!b{ zkFSjE^yJ#)(%$FST7o(0@8iGOxM8nbWxQZ+!(?H$SyZV{VVhjn;?3jj+wAn_D1@&-rwog)a1vEynp0*t-jQ$ ztI3&js%TP}OgV%!HFh$Eq;|&Gx76gu&)>qg(V?--nzPNFu*{p7yM>UmeT=Spg{XA3 z%cjoZzslRZvd^2X%ayImmafc~ugsUL$&R2b7^U|?WiWMT#Z7FGr*;4lXR3r;RD*V2jyB4EdB z&j%JT7la773ki#eA`AG7OGpNQ1*D+@kx|hxU;$ZkIFJJiC?EtB!2-$%0Tr--8bUxF zETD-H&;kqSAOv*50{RF61F(RRF%+1Xt^^CffhELqNC3zM0Ou+xf3QClbpQYW07*qo IM6N<$f}JjCdH?_b literal 0 HcmV?d00001 diff --git a/limereport/images/paste2.png b/limereport/images/paste2.png new file mode 100644 index 0000000000000000000000000000000000000000..11399d9e72e17ecf3ab7ddfd13cd1c059f70a7d1 GIT binary patch literal 749 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl47#|1tgt+=uYGWe%L=_wDhUate&0dQYatMU=Gw(J|h+=64785-e49~V-Q|%2GkN-XA)L# z5>jUzT5lXuX9PsSwT3_xRBHf2HTprdAOzGNTn7{ZvJHZ34MOS-oKjV*Puf)-w*^X7 z9kVMxY+JhDreu$G`9YhKy*9-=tqZnU{{R2Kc(--o4y%GKmbn`&{{R2?>-Uem&6YXq zEwWad-+FV?XQ7APEUWk>Q9CYe{r2li-bRa@wHBGH%+i;c9l3ijYfn!Yh_fFq@bSZ0%dFBeUv?Zn~3rzOj+>x>^He+v6?xCcZO`)C>U9UVi`{eEI z*PoweEHg`6WSTtRBx$zs=!u3`pPo2- zZ-4!kaVka3!^&3QV>z{kD@7T?4r|#}rePV9bti;&f zu;`YMEhm>=e0&HPS*P#sK5}dG@!MNZ-`jcS!S2I1H|@Hx>g>b4!07Hz`S%n^F_r}R z1v5B2yO9RsBze2LFm$lWdH^|`1s;*b3=G`DAk4@xYmNj^kiEpy*OmPti;$qK?oRGS zwLqa}PZ!4!iOas{PYX2}@U%WGQw%M*5-6ar@qjhN;pH~zT5-9q>!weAjQ^~DGCN0! zMOD+#>(oY{J1@@s-f}6}%XjNF<`>gu{bYQ4UQ+DXHQjK&Yg_8-?;dLrOz7^e*ly2| z#8Aqja;%hTj%1L-u?ft2JmCj=AL>;_9}IZ3@%ZP|)vuoYW#7%FrYmc5Dgx*n22WQ% Jmvv4FO#o1iOb`G7 literal 0 HcmV?d00001 diff --git a/limereport/images/save.png b/limereport/images/save.png index e6fe0b29ab08185a4ce50d74e389ac9a045a8078..2b31666d2e6aedb9c9ce84d613ba2900800dec1c 100644 GIT binary patch delta 146 zcmaFDHiKn?GCyN{fKP~P^+~(rS!O`Au`rBLu2A7cI0FL%V@Z%-FoVOh8)+a;lDE4H zLkFv@$K>aXav={{gaow=ytwiv0OgE4T^vIsE+;3XIJ2$c;pxd?5?%CbDcQ0<=y?y)k-BVz+uixL`Ai%-J_mP>irLFa}n~R(4@gv8Mwl}c| z2?;f0oSev;6D=)wR{nHQ3ux%o-MnDKiWMt%EHN<_);MtBNE^!x z31Fy2Y}b7JOZjvu(4VR$t`Q|Ei6yC4iOEH&K$^kGz|c(B&_LJFEX2sj%D~*p$VA(~ m*vi15?q$_R6dk$wDVb@NxHa%^Im8Rpz~JfX=d#Wzp$PyXu&4+C diff --git a/limereport/images/toBack.png b/limereport/images/toBack.png index 883ae1944f0af2822390ed87dda98a80a4c6f0ef..1fc9fe18ba9cec3679f1ebf0723920306f07dd65 100644 GIT binary patch delta 146 zcmX@la*k<&3ipHnpAgs5{WjGn?Iz}R$!)yvmcqcmz*rLG7tG-B>_!@hljQC0!qCAg z>oM7YQ7-Z!i;$o>zj9*&D~Qgf&g;-d9PoRM^zV=jVPj z;F~P=Z~hcJDOo;Vvs;}Y KUMwFx^mZVxG7o`Fz1|tJQGhIUiT|=`FBO@yVb1Neg pZ3AN~1B1GkRU1(>mdKI%cPYCIBYfm(>6O diff --git a/limereport/images/toBottom.png b/limereport/images/toBottom.png index 73c104df84f076788ab923b074a5f385cc38e861..3f9fe616b73e0785d11d73b37c94737f4754f852 100644 GIT binary patch delta 130 zcmZo;SUkfCW9u1u7*vUjLaBYoMte@D9&Y3;5$%Y fz_Vf@BM&RX{jZ#=F&WHRKs^keu6{1-oD!Mk04(LhAK4%hK3dfhF?ITh8GMBr3MTP zuM!v-tY$DUh!@P+6=(yLs1EQ6aRt(TmD(p>uAiu1BzI-bne#va#*!evUYjlCPTZko7XuKocxi!hJu=Z~5|gBa30T^vIsF87}Ec*5;4|d1}wjbelYS8EsoMgg$Leg2|6w`u7GL9Wm3o@-+ z>LeJKWx7RN<4v$HW6@MSP#Nn|n9|Na9AIl)k5nV~E7%n p87_R;IFr+SDhH!l&bLR~#2BvnGS9y~eHF-522WQ%mvv4FO#pfQEsFpE delta 344 zcmZ3-^pkmliZ4sLqpu?a!^VE@KZ&di3=9g%9znhg3{`3j3=J&|48MRv4KElNN(~qo zUL`OvSj}Ky5HFasE6@fgQ61nD;tHhg6IJ{wwI6=IGSMhs?xptC3ZNKcNswPKgTu2M zX&_FLx4VnR-VIwfP24Y6|A3oCm`C>WM@^tv43VBLjv*44lM@;k+}KPSln$^k7ci!Y zg_)J{`Kd7K<;j)t#kDZVbDQsPP?*H9OOj=6YLe6C!zwB|N?K}qikhtA6Q)g^IypSR zg+oL0bl1uit5zC6G-z(v%CN+kMf~LJyn{eXR7+eVN>UO_QmvAUQsaO$gOP!unXaLM zuAy0ok&%^wxs{QLwt=ygfkEBNs*NZ*a`RI%(<*Um;NNnH7pQ^3)78&qol`;+0MZp_ AHvj+t diff --git a/limereport/images/toFront.png b/limereport/images/toFront.png index 8d04661a1d71b5cfea0797c69e5f467f62845027..f6666ba4754138e1b2c8310e44a01729cff412f6 100644 GIT binary patch delta 135 zcmeyx@|mdKI;Vst06M57-2eap delta 437 zcmaFP^owPJiVI7+qpu?a!^VE@KZ&di3=9g%9znhg3{`3j3=J&|48MRv4KElNN(~qo zUL`OvSj}Ky5HFasE6@fgu`$3W#1%+S)Ld6@-_8*TWXhHV`2{ol!UG;3Dqaj!$e85q z?jl#jrJxPua29w(7Bet#3xhBt!>leJhGoZY62~0=*1@5ysSd(a_My$QHjy(^6hvT{nXU4u-~UX2QnY+Q!m8%XO@+ zt=ZMZt<7T^+NZbo&!0YBTu(tkLqkDDM~6jRKu}azTwGkRk=vu8u}|+#ny03xXQrfW zE%S=miRX+=OpM$LH+Qa_Y1!4#y0lfaivi@ilL9W&Ytk+NS*j(j5hZCUi6yC4$wjF^ ziowXh&`j6RK-bVL#K_3Xz}(8nMBBjF%D|xRWz|NQ4zPyY{FKbJO57Uww;bXHYGCkm L^>bP0l+XkKS&4|h diff --git a/limereport/images/toLeft1.png b/limereport/images/toLeft1.png index 18900601dbdd6256f2cdff28811d15b05f360562..88cc447cf31f2f3f3f706d7aaa8bf8dca05bc722 100644 GIT binary patch delta 135 zcmey)ypm~x3SUKlPl)To&sXddRs1ToCl=<*?c;ZBWME)mED7=pW^j0RBMrn!@^*J& z=wOxgnD|f5=OK%b5R(R5?K4xLl$NK9V~E7%5i9$Q^DK{|Bmi|Wc)I$ztaD0e0sw(tDy0Ab delta 342 zcmZ3<^qqNviZ4sLqpu?a!^VE@KZ&di3=9g%9znhg3{`3j3=J&|48MRv4KElNN(~qo zUL`OvSj}Ky5HFasE6@fgQ61nD;tHhg6IJ{wwI6=IGSMhs?xptC3ZNKcNswPKgTu2M zX&_FLx4VnR-VIwfP24Y6|A3oCm`C>WM@^tv4B?(Gjv*44lM@nB9GD|mW+X7^9XNC7 z)Uk61J5>%GJ$v}v!ES*E$q%223%Ce5m^ZUzE6!?Qayq26DCv>Vq@V)EOvy;gN>&%;;J*%SxEf_(L=|!?H6hiYKRU+61&hwZt`|BqgyV)hf9tHL)ZnmBGls&`j6R zK-bVL#K_3Xz}(8nMBBjF%D|xRWz|L$9l7}_nQ4`{HSlja#0%8G;OXk;vd$@?2>>LJ BZ%F_E diff --git a/limereport/images/toRight.png b/limereport/images/toRight.png index e4946f435e93f52dac919883ea80454b0f60e8c9..14b348f5b6609be9b8e9399c05e6fe1590df96de 100644 GIT binary patch delta 137 zcmeytyqal(3SUKlPl#*B`5^m56~9XDiG}%c^Xz{;U|?WiED7=pW^j0RBMrn!@^*J& z=wOxgnD|f5?;(qj5R=lg75v&jDIHH2#}J9j$q5dOJv=-StTPfA^b|N5mvAhY?RX+e nP0d8tK>1;tkm3QCSz8%q&SBM*VfKjv>SOS9^>bP0l+XkKvy3T& delta 343 zcmZ3@^n-bViZ4sLqpu?a!^VE@KZ&di3=9g%9znhg3{`3j3=J&|48MRv4KElNN(~qo zUL`OvSj}Ky5HFasE6@fgQ61nD;tHhg6IJ{wwL8uSO*G1vE2=&b3KU~33GxeOaCmkj z4a7^T>Yws0lQSA;QzeF+}2Wa)JY64-ZcS>x={jy#r?s zojP{zV5h)?q{OGs9=eJ>cr5rnKLeIG2rCv?&#|D_V7B$x+FE_=@U_r zhfH3lv{og3%6e76sCH=$E5n*{7Ts{AoiRW=R7+eVN>UO_QmvAUQWIlKQW=a449#>6 z4Rj67LX3>849u;JOtcM*tqct6URG^H(UF^&n0}NOI69~X5kN^t{3lp3g)B@;EM+4~I2LRDf0g2WD R!3zKY002ovPDHLkV1mXuA@KkJ delta 349 zcmaFQc$#^FiZ4sLqpu?a!^VE@KZ&di3=9g%9znhg3{`3j3=J&|48MRv4KElNN(~qo zUL`OvSj}Ky5HFasE6@fg;St~y;tHhg6IJ{wweNmBJJHBSE-tD2HBgMPB*-tA!Qt7B zG!Q4r+ucQ+``V2Di9K@l54c%`d1OC-)C8Kv5a;RQ7$R{w_q;b>g8~oB1+6gGkOTbR z?N`mTc)2LiY{K+QVv;dSCJSz47Ffm*5PE3OnuZ;&PF|cFcn&}!E=o*@Z7#Ud^m|Gc{Xd4(?85q>PtlEgABh@N5KP5A*61N8aEr)o48W=oX L{an^LB{Ts5i^gXUX8ODtJRZEw0v+$hS*(7`I}G4ZsV<3ko9 zA!ZZq^lobg1_pUg7sn8Z%gG5T4valK5iBz%Ft{{G@^y$gm?sxRaWiZzVDznJICc)G Ol)=;0&t;ucLK6U}%^|q} delta 346 zcmaFOc$9g9N&ri`qpu?a!^VE@KZ&di3=9g%9znhg3{`3j3=J&|48MRv4KElNN(~qo zUL`OvSj}Ky5HFasE6@fg;St~y;tHhg6IJ{wwX09swVm^wXlf}pMvC-_I>m4#PBYxdk_T-M2~`G4jTpz|42OI#yLQW8s2t&)pU6JtwK8H@}J z&2$Y7bPdfyjEt-d%&m+}v<-}{3=HaCR&7Mlk(-~AnO2Eg1OJvoyg&^Mp00i_>zopr E0Qp#PV*mgE diff --git a/limereport/images/toTop.png b/limereport/images/toTop.png index 7b91b8eef064047b131a9cbdd1911fa8d707398c..58c25e4d6f2d5adba6b3ea712e688b453e51385a 100644 GIT binary patch delta 133 zcmZo+S;90yMX(~kC&cyP=ganqDt?vPO=mnNmgLB-d-Eonfq{XsB*-tA!Qt7BG!Q4r z+uensgH_gJ;y*d}hb%%uEF$$DwkAL+RZkbk5Q)pl2@dQ%84Zlw2~3O@tU?KCX=zQt iCE^a{>}}qiYz&jPF>>Buu5tuwVDNPHb6Mw<&;$T?Whk)# delta 358 zcmZ3&)WR}BC4eQ}(btiIVPik{pF~y$1_p&>k04(LhAK4%hK3dfhF?ITh8GMBr3MTP zuM!v-tY$DUh!@P+6=(yLs1EQ6aRt)$i7I}T+D&IX9)7+&(KJV{X8ZKRKw-v`AirP+ zhi5m^K%69RcNdMl8@6tmxL>aR0XK^4s3S=_o@<{1O+Q!UAKjVMV; zEJ?LWE=mPb3`PcqX1az3x`t*UMn+Z!=2k`~+6Kl}1_pI6t2Tmlz%=CMr(~v8;?}^w S&vtbH diff --git a/limereport/images/toVCernter.png b/limereport/images/toVCernter.png index 3e0689bcef591e42209b8c82098ddd4aa3ca0699..79f2fe054a75acafed01d40cc0a19dee83a3df58 100644 GIT binary patch delta 135 zcmZo;S;;g(g|8yOC&ab;La1M*cGDS;iG}%czh3{p$-uzCSQ6wH%;50sMjD8dGHkQd*uajv*44lM@t}44N3a7=(p|l{Z=VFgOV+Dkw0d l9n>s3bKn_Y$@EEF4Bbo&U;FRpbO3cRc)I$ztaD0e0stK#EEoU) delta 357 zcmZ3<)W$MF#g`@B(btiIVPik{pF~y$1_p&>k04(LhAK4%hK3dfhF?ITh8GMBr3MTP zuM!v-tY$DUh!@P+6=(yLs1EQ6aRt(TmD){bJi0H0PBhAwyLjV@El`ZHB*-tA!Qt7B zG!Q4r+ucQD?}n|LChnK3f56Qm%p?2xqbATShBQwX#}J9jQ_s2cH8}7vJ8b%LuR8kI z|9XyTMGSrqx|dE=b`7*^nZVAW_~PA?EUN?7_u~VNO z4UL!*+Ut6GTg|1f%n4H_CC(B*uq%(}ccIPyiuzyX>dH4*;=k_`-UYNVTeZYBq9i4; zB-JXpC>2OC7#SFv=^7g78k&U|8Ce;aTN#;X8yH&|7}UM2+6dHv(2$#-l9^VCTLb@= RL%cu@44$rjF6*2UngE5ic}D;M diff --git a/limereport/images/zoom_in1.png b/limereport/images/zoom_in1.png index 4e6fc7a9a55818197bcfc2f37563bc7b1fe4de63..f1d1b62ec47c175ad4824232c7df1ced2ea12103 100644 GIT binary patch delta 427 zcmV;c0aX6Y2GawO85#xv001BJ|6u?C00v@9M??Th0D1sG#JX33lj{KuRoTr}jz{@@F`+t7_=XrTgVooHFV{1Tm zyuv^S&;i}htPfEq&4KrUe{<$X#?Y)Pz>*g%2ZAJ{DGqm!SXo}>?emqv&j4U=b9>|Q z;ri)bnlbh}Kx}J=Lb^EBx?C$^-Cl`p$mi0tqO%h|IE&hOAzefc1nv5n25KaMS2*;n z-=&2CR3$#uS>%;m6IF?GaZ>{byC>)Xn5~9gT*)=3a-jnqw}B2|f41wMS8(XM+u#JC z*Y8rUmFz>&S-e88-?a@S#}obntSdvFTO(gN5JZh6P?b1ltAW|BJK>C>SyjmiM^Zxo zzFx3R7X67nHw+VS9=HR($KN~<5-@<@4Yw~xu%TJvdZ%8aOw2h0UKoBS_+J>{57+R7 Vr8R_-5&!@I07*qo1w^hwV1l}aynFxv literal 845 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstU$g(vPY0F z14ES>14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>`T@Ck7RDoCDXhK9DD zU-0DJy~l5FpSyQp?*7Kq*%ojGcV1ll_4~)CZ|`1xeDd)1%^T0o9=@?DZH^UC!PavN z{{H>*^~a|xPfnb=vwPXmzSLP3zyJLH{`1T6TibVCS_b5nEcN~Q=f{qVOETx$WzTc? z^5etCGqX}=TbzGz`1$+$+b%4exwjT*RNexYo6pbRe0FZ<#igr`Pt2HW3lz+nXSe0t zJfO*kZfx9fVe!2EjX*=HPl8a&Y)c?JWtKVIoe;*G&(H6^xcvUh>*wzuTz`7{{QZNU zzP&woW5b(I&!4=#d*{WaGk5nLzPWk#<(2ndUA^}7^zmEU_FY|b;o;$vcXl4QwjLNb zDSI{?22!3SL4Lsul~4XYzWVLZ^#?ajzqnTZ{q&pfzrVk^aJS~-r@#L`UHS3u@4vTS zKK}UmODRS*L#FG01ahK@^*J&=wOxg z0CG4BJR*x37`TN&n2}-D90{Nxdx@v7EBga(7GWOQ&mT2`vBz-0)5S4F;&O5V1GAf2 zntz&@8=FMJ*A|8_i}}5CnV7^-l{Cd1Y_o_rZxw)Otv;PIomiNKD4!ThGN=_SFSEq zZmzGTD>gCwY@0XF?UQ3&*q6G*sWf^bn4dLwR3Gx$kxo8$JggD-O6%zMbq7< zFJHcR@!}=tC+^AG%pnIZU*>(MJ3&muuGu=^2y-VtLqxu^fQ8l)V5($LEpd$~Nl7e8 zwMs5Z1yT$~28L$3h6cKZW+6sKRtDx)Mkd+@##ROfbuX(nqG-s?PsvQH#I1pU%OPH% O1_n=8KbLh*2~7ZG>y``v diff --git a/limereport/images/zoom_out1.png b/limereport/images/zoom_out1.png index cce6ea29053eb2f9da890f09efdbdd43f9cb0dd5..04db40649174825046d7b455a6bac81d1779746a 100644 GIT binary patch delta 451 zcmV;!0X+WE2GRqN8Gi-<001BJ|6u?C00v@9M??Th0D1sG#JX3300009a7bBm000XU z000XU0RWnu7ytkO2XskIMF-&o5)vyCgg2mU0004BNklGAgYVXOnE?RS9W_AZ5N$yd6nmoe{e zM7Zj<6LS0#34cce$pD3HiAXpq!kjxd5>Vo4Cc%{-6PR~i8%0h5aCDyVk?Z+3ik#x= zPDk8#3v_@j!)kG?o>0%X13NIRme_W@7Bm3EZcen|%4>lFy?&RfUJfKz^)kJFSA;d+ zAbICNiKkKI6o%Epu$v=tOdj%Lg#c(&OlhV`jLAcm*F1jr_Vu5LH058Y0mL)I(On@T tF(uSu@;gW*G_8Q}EGqkc14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>|BWU zo6pYu{rl(Zk55;goH%u7_oSUAX>+Xq|NsB}=a=KRw(q>Sq+p@j&p$tQTwIc~zzJv+ z(2z}M=VZ*WIecUD^Y{0+U0AsAP&?45?D-Bio}K}kw)5iB)yF4g&vyh0X3cZha&G>K z+dB{4*a#G#x4$uCt}W1=nRD$@W?NLBv;!iDGvMT#&(9ydxpnu&<@aA+KY#z=_KS<_qEgn48?f7ArVBEud} z7sn8Z%gG5qkdpK*AuTbbfiaAqBcb)vO`98*7CU!TRxDJik^95c6K3sVk7#X6EAYsOsBl>_ z%`Ad-a(iE1NQqC*oOyOfc$oQ}l^_3TaS;wS=I1Z&u-4I8yCyg1txd#3CAn{WeGb#D zEUO*nJUYbmsk^;>^5n_w?04LG)+q?4FizkI;pW-F`12h@K$o)cTF<0Vpg&YgTq8?+%fw`5DiMD~Um4QLs%c_ki8glbfGSez?YvA8< Rh!?1V!PC{xWt~$(697hElh^images/hlayuot_3_24.png images/addBand1.png images/delete1.png - images/copy2.png + images/copy2.png images/new_leaf1.png - images/paste1.png + images/paste1.png images/zoom_in1.png images/zoom_out1.png images/folder3.png @@ -177,5 +177,7 @@ images/logo_32x32_1.png images/addDialog.png images/deleteDialog.png + images/copy3.png + images/paste2.png