0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-10-09 05:57:14 +03:00

plugin extracted

This commit is contained in:
Arin Alexander
2017-11-24 00:13:47 +03:00
parent 9e4025f886
commit 0fb1ba1bd8
34 changed files with 3025 additions and 370 deletions

View File

@@ -51,7 +51,7 @@ namespace LimeReport {
// ReportDesignIntf
ReportDesignWidget::ReportDesignWidget(ReportEngine *report, QMainWindow *mainWindow, QWidget *parent) :
ReportDesignWidget::ReportDesignWidget(ReportEnginePrivateInterface* report, QMainWindow *mainWindow, QWidget *parent) :
QWidget(parent),
#ifdef HAVE_QTDESIGNER_INTEGRATION
m_dialogDesignerManager(new DialogDesignerManager(this)),
@@ -72,20 +72,20 @@ ReportDesignWidget::ReportDesignWidget(ReportEngine *report, QMainWindow *mainWi
mainLayout->addWidget(m_tabWidget);
setLayout(mainLayout);
if (!report) {
m_report=new ReportEnginePrivate(this);
m_report->setObjectName("report");
m_report->appendPage("page1");
}
else {
m_report=report->d_ptr;
// if (!report) {
// m_report=new ReportEnginePrivate(this);
// m_report->setObjectName("report");
// m_report->appendPage("page1");
// }
// else {
m_report=report;//report->d_ptr;
if (!m_report->pageCount()) m_report->appendPage("page1");
}
// }
createTabs();
connect(m_report,SIGNAL(pagesLoadFinished()),this,SLOT(slotPagesLoadFinished()));
connect(m_report,SIGNAL(cleared()),this,SIGNAL(cleared()));
connect(dynamic_cast<QObject*>(m_report), SIGNAL(pagesLoadFinished()),this,SLOT(slotPagesLoadFinished()));
connect(dynamic_cast<QObject*>(m_report), SIGNAL(cleared()),this,SIGNAL(cleared()));
connect(m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentTabChanged(int)));
#ifdef HAVE_UI_LOADER
connect(m_report->scriptContext(), SIGNAL(dialogDeleted(QString)), this, SLOT(slotDialogDeleted(QString)));
@@ -241,9 +241,11 @@ void ReportDesignWidget::createTabs(){
view->setFrameShape(QFrame::NoFrame);
view->setScene(m_report->pageAt(i));
foreach(QGraphicsItem* item, m_report->pageAt(i)->selectedItems()){
item->setSelected(false);
}
// foreach(QGraphicsItem* item, m_report->pageAt(i)->selectedItems()){
// item->setSelected(false);
// }
m_report->pageAt(i)->clearSelection();
view->centerOn(0,0);
view->scale(0.5,0.5);
@@ -796,7 +798,8 @@ void ReportDesignWidget::slotCurrentTabChanged(int index)
QGraphicsView* view = dynamic_cast<QGraphicsView*>(m_tabWidget->widget(index));
if (view) {
if (view->scene()){
foreach (QGraphicsItem* item, view->scene()->selectedItems()) item->setSelected(false);
//foreach (QGraphicsItem* item, view->scene()->selectedItems()) item->setSelected(false);
view->scene()->clearSelection();
}
m_zoomer->setView(view);
}
@@ -807,7 +810,7 @@ void ReportDesignWidget::slotCurrentTabChanged(int index)
updateDialogs();
#endif
if (activeTabType() == Translations){
m_traslationEditor->setReportEngine(report());
m_traslationEditor->setReportEngine(dynamic_cast<ITranslationContainer*>(report()));
}
if (activeTabType() == Script){
@@ -816,6 +819,8 @@ void ReportDesignWidget::slotCurrentTabChanged(int index)
}
emit activePageChanged();
if (view) view->centerOn(0,0);
}
#ifdef HAVE_QTDESIGNER_INTEGRATION