mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-24 20:44:39 +03:00
createPreviewWidget(QWidget* parent=0) method has been added to ReportEngine
This commit is contained in:
parent
a7192c350c
commit
cdd46ff863
@ -37,6 +37,7 @@
|
|||||||
#include "lrglobal.h"
|
#include "lrglobal.h"
|
||||||
#include "lrdatasourcemanagerintf.h"
|
#include "lrdatasourcemanagerintf.h"
|
||||||
#include "lrscriptenginemanagerintf.h"
|
#include "lrscriptenginemanagerintf.h"
|
||||||
|
#include "lrpreviewreportwidget.h"
|
||||||
|
|
||||||
class QPrinter;
|
class QPrinter;
|
||||||
|
|
||||||
@ -75,7 +76,6 @@ public:
|
|||||||
void setShowProgressDialog(bool value);
|
void setShowProgressDialog(bool value);
|
||||||
IDataSourceManager* dataManager();
|
IDataSourceManager* dataManager();
|
||||||
IScriptEngineManager* scriptManager();
|
IScriptEngineManager* scriptManager();
|
||||||
|
|
||||||
bool loadFromFile(const QString& fileName);
|
bool loadFromFile(const QString& fileName);
|
||||||
bool loadFromByteArray(QByteArray *data);
|
bool loadFromByteArray(QByteArray *data);
|
||||||
bool loadFromString(const QString& data);
|
bool loadFromString(const QString& data);
|
||||||
@ -88,6 +88,7 @@ public:
|
|||||||
void setCurrentReportsDir(const QString& dirName);
|
void setCurrentReportsDir(const QString& dirName);
|
||||||
void setReportName(const QString& name);
|
void setReportName(const QString& name);
|
||||||
QString reportName();
|
QString reportName();
|
||||||
|
PreviewReportWidget *createPreviewWidget(QWidget *parent = 0);
|
||||||
signals:
|
signals:
|
||||||
void renderStarted();
|
void renderStarted();
|
||||||
void renderFinished();
|
void renderFinished();
|
||||||
|
@ -47,6 +47,8 @@
|
|||||||
#include "serializators/lrxmlreader.h"
|
#include "serializators/lrxmlreader.h"
|
||||||
#include "lrreportrender.h"
|
#include "lrreportrender.h"
|
||||||
#include "lrpreviewreportwindow.h"
|
#include "lrpreviewreportwindow.h"
|
||||||
|
#include "lrpreviewreportwidget.h"
|
||||||
|
#include "lrpreviewreportwidget_p.h"
|
||||||
|
|
||||||
namespace LimeReport{
|
namespace LimeReport{
|
||||||
|
|
||||||
@ -312,6 +314,22 @@ void ReportEnginePrivate::previewReport()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PreviewReportWidget* ReportEnginePrivate::createPreviewWidget(QWidget* parent){
|
||||||
|
|
||||||
|
PreviewReportWidget* widget = new PreviewReportWidget(this, parent);
|
||||||
|
try{
|
||||||
|
dataManager()->setDesignTime(false);
|
||||||
|
ReportPages pages = renderToPages();
|
||||||
|
dataManager()->setDesignTime(true);
|
||||||
|
if (pages.count()>0)
|
||||||
|
widget->d_ptr->setPages(pages);
|
||||||
|
} catch (ReportError &exception){
|
||||||
|
saveError(exception.what());
|
||||||
|
showError(exception.what());
|
||||||
|
}
|
||||||
|
return widget;
|
||||||
|
}
|
||||||
|
|
||||||
PageDesignIntf* ReportEnginePrivate::createPreviewScene(QObject* parent){
|
PageDesignIntf* ReportEnginePrivate::createPreviewScene(QObject* parent){
|
||||||
PageDesignIntf* result = 0;
|
PageDesignIntf* result = 0;
|
||||||
try {
|
try {
|
||||||
@ -595,6 +613,12 @@ void ReportEngine::designReport()
|
|||||||
d->designReport();
|
d->designReport();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PreviewReportWidget* ReportEngine::createPreviewWidget(QWidget *parent)
|
||||||
|
{
|
||||||
|
Q_D(ReportEngine);
|
||||||
|
return d->createPreviewWidget(parent);
|
||||||
|
}
|
||||||
|
|
||||||
void ReportEngine::setShowProgressDialog(bool value)
|
void ReportEngine::setShowProgressDialog(bool value)
|
||||||
{
|
{
|
||||||
Q_D(ReportEngine);
|
Q_D(ReportEngine);
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "lrglobal.h"
|
#include "lrglobal.h"
|
||||||
#include "lrdatasourcemanagerintf.h"
|
#include "lrdatasourcemanagerintf.h"
|
||||||
#include "lrscriptenginemanagerintf.h"
|
#include "lrscriptenginemanagerintf.h"
|
||||||
|
#include "lrpreviewreportwidget.h"
|
||||||
|
|
||||||
class QPrinter;
|
class QPrinter;
|
||||||
|
|
||||||
@ -75,7 +76,6 @@ public:
|
|||||||
void setShowProgressDialog(bool value);
|
void setShowProgressDialog(bool value);
|
||||||
IDataSourceManager* dataManager();
|
IDataSourceManager* dataManager();
|
||||||
IScriptEngineManager* scriptManager();
|
IScriptEngineManager* scriptManager();
|
||||||
|
|
||||||
bool loadFromFile(const QString& fileName);
|
bool loadFromFile(const QString& fileName);
|
||||||
bool loadFromByteArray(QByteArray *data);
|
bool loadFromByteArray(QByteArray *data);
|
||||||
bool loadFromString(const QString& data);
|
bool loadFromString(const QString& data);
|
||||||
@ -88,6 +88,7 @@ public:
|
|||||||
void setCurrentReportsDir(const QString& dirName);
|
void setCurrentReportsDir(const QString& dirName);
|
||||||
void setReportName(const QString& name);
|
void setReportName(const QString& name);
|
||||||
QString reportName();
|
QString reportName();
|
||||||
|
PreviewReportWidget *createPreviewWidget(QWidget *parent = 0);
|
||||||
signals:
|
signals:
|
||||||
void renderStarted();
|
void renderStarted();
|
||||||
void renderFinished();
|
void renderFinished();
|
||||||
|
@ -55,6 +55,7 @@ class ReportEnginePrivate : public QObject, public ICollectionContainer
|
|||||||
Q_DECLARE_PUBLIC(ReportEngine)
|
Q_DECLARE_PUBLIC(ReportEngine)
|
||||||
Q_PROPERTY(ACollectionProperty pages READ fakeCollectionReader())
|
Q_PROPERTY(ACollectionProperty pages READ fakeCollectionReader())
|
||||||
Q_PROPERTY(QObject* datasourcesManager READ dataManager())
|
Q_PROPERTY(QObject* datasourcesManager READ dataManager())
|
||||||
|
friend class PreviewReportWidget;
|
||||||
public:
|
public:
|
||||||
static void printReport(ItemsReaderIntf::Ptr reader, QPrinter &printer);
|
static void printReport(ItemsReaderIntf::Ptr reader, QPrinter &printer);
|
||||||
static void printReport(ReportPages pages, QPrinter &printer, const PrintRange &printRange);
|
static void printReport(ReportPages pages, QPrinter &printer, const PrintRange &printRange);
|
||||||
@ -93,7 +94,6 @@ public:
|
|||||||
bool isNeedToSave();
|
bool isNeedToSave();
|
||||||
QString lastError();
|
QString lastError();
|
||||||
ReportEngine * q_ptr;
|
ReportEngine * q_ptr;
|
||||||
PageDesignIntf *createPreviewScene(QObject *parent);
|
|
||||||
void emitSaveReport();
|
void emitSaveReport();
|
||||||
bool emitLoadReport();
|
bool emitLoadReport();
|
||||||
bool isSaved();
|
bool isSaved();
|
||||||
@ -102,6 +102,8 @@ public:
|
|||||||
void setReportName(const QString& reportName){ m_reportName=reportName;}
|
void setReportName(const QString& reportName){ m_reportName=reportName;}
|
||||||
QString reportName(){ return m_reportName;}
|
QString reportName(){ return m_reportName;}
|
||||||
bool hasActivePreview(){return m_activePreview;}
|
bool hasActivePreview(){return m_activePreview;}
|
||||||
|
PageDesignIntf *createPreviewScene(QObject *parent);
|
||||||
|
PreviewReportWidget *createPreviewWidget(QWidget *parent);
|
||||||
signals:
|
signals:
|
||||||
void pagesLoadFinished();
|
void pagesLoadFinished();
|
||||||
void datasourceCollectionLoadFinished(const QString& collectionName);
|
void datasourceCollectionLoadFinished(const QString& collectionName);
|
||||||
|
Loading…
Reference in New Issue
Block a user