mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-25 00:54:39 +03:00
Finish CH_Private_To_Public
This commit is contained in:
commit
87da477803
@ -12,6 +12,7 @@ class PreviewReportWidget;
|
|||||||
|
|
||||||
class PreviewReportWidgetPrivate;
|
class PreviewReportWidgetPrivate;
|
||||||
class ReportEnginePrivate;
|
class ReportEnginePrivate;
|
||||||
|
class ReportEngine;
|
||||||
|
|
||||||
class LIMEREPORT_EXPORT PreviewReportWidget : public QWidget
|
class LIMEREPORT_EXPORT PreviewReportWidget : public QWidget
|
||||||
{
|
{
|
||||||
@ -20,7 +21,7 @@ class LIMEREPORT_EXPORT PreviewReportWidget : public QWidget
|
|||||||
friend class PreviewReportWindow;
|
friend class PreviewReportWindow;
|
||||||
friend class PreviewReportWidgetPrivate;
|
friend class PreviewReportWidgetPrivate;
|
||||||
public:
|
public:
|
||||||
explicit PreviewReportWidget(ReportEnginePrivate *report, QWidget *parent = 0);
|
explicit PreviewReportWidget(ReportEngine *report, QWidget *parent = 0);
|
||||||
~PreviewReportWidget();
|
~PreviewReportWidget();
|
||||||
public slots:
|
public slots:
|
||||||
void refreshPages();
|
void refreshPages();
|
||||||
|
@ -63,11 +63,15 @@ class DataSourceManager;
|
|||||||
class ReportEnginePrivate;
|
class ReportEnginePrivate;
|
||||||
class PageDesignIntf;
|
class PageDesignIntf;
|
||||||
class PageItemDesignIntf;
|
class PageItemDesignIntf;
|
||||||
|
class ReportDesignWidget;
|
||||||
|
class PreviewReportWidget;
|
||||||
|
|
||||||
typedef QList< QSharedPointer<PageItemDesignIntf> > ReportPages;
|
typedef QList< QSharedPointer<PageItemDesignIntf> > ReportPages;
|
||||||
|
|
||||||
class LIMEREPORT_EXPORT ReportEngine : public QObject{
|
class LIMEREPORT_EXPORT ReportEngine : public QObject{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
friend class ReportDesignWidget;
|
||||||
|
friend class PreviewReportWidget;
|
||||||
public:
|
public:
|
||||||
static void setSettings(QSettings *value){m_settings=value;}
|
static void setSettings(QSettings *value){m_settings=value;}
|
||||||
public:
|
public:
|
||||||
|
@ -60,14 +60,15 @@ PageItemDesignIntf::Ptr PreviewReportWidgetPrivate::currentPage()
|
|||||||
else return PageItemDesignIntf::Ptr(0);
|
else return PageItemDesignIntf::Ptr(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
PreviewReportWidget::PreviewReportWidget(ReportEnginePrivate *report, QWidget *parent) :
|
PreviewReportWidget::PreviewReportWidget(ReportEngine *report, QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::PreviewReportWidget), d_ptr(new PreviewReportWidgetPrivate(this))
|
ui(new Ui::PreviewReportWidget), d_ptr(new PreviewReportWidgetPrivate(this))
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
d_ptr->m_previewPage = report->createPreviewPage();
|
d_ptr->m_report = report->d_ptr;
|
||||||
|
d_ptr->m_previewPage = d_ptr->m_report->createPreviewPage();
|
||||||
d_ptr->m_previewPage->setItemMode( LimeReport::PreviewMode );
|
d_ptr->m_previewPage->setItemMode( LimeReport::PreviewMode );
|
||||||
d_ptr->m_report = report;
|
|
||||||
|
|
||||||
ui->errorsView->setVisible(false);
|
ui->errorsView->setVisible(false);
|
||||||
connect(ui->graphicsView->verticalScrollBar(),SIGNAL(valueChanged(int)), this, SLOT(slotSliderMoved(int)));
|
connect(ui->graphicsView->verticalScrollBar(),SIGNAL(valueChanged(int)), this, SLOT(slotSliderMoved(int)));
|
||||||
|
@ -12,6 +12,7 @@ class PreviewReportWidget;
|
|||||||
|
|
||||||
class PreviewReportWidgetPrivate;
|
class PreviewReportWidgetPrivate;
|
||||||
class ReportEnginePrivate;
|
class ReportEnginePrivate;
|
||||||
|
class ReportEngine;
|
||||||
|
|
||||||
class LIMEREPORT_EXPORT PreviewReportWidget : public QWidget
|
class LIMEREPORT_EXPORT PreviewReportWidget : public QWidget
|
||||||
{
|
{
|
||||||
@ -20,7 +21,7 @@ class LIMEREPORT_EXPORT PreviewReportWidget : public QWidget
|
|||||||
friend class PreviewReportWindow;
|
friend class PreviewReportWindow;
|
||||||
friend class PreviewReportWidgetPrivate;
|
friend class PreviewReportWidgetPrivate;
|
||||||
public:
|
public:
|
||||||
explicit PreviewReportWidget(ReportEnginePrivate *report, QWidget *parent = 0);
|
explicit PreviewReportWidget(ReportEngine *report, QWidget *parent = 0);
|
||||||
~PreviewReportWidget();
|
~PreviewReportWidget();
|
||||||
public slots:
|
public slots:
|
||||||
void refreshPages();
|
void refreshPages();
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
#include "lrreportengine_p.h"
|
#include "lrreportengine_p.h"
|
||||||
#include "lrpreviewreportwidget.h"
|
#include "lrpreviewreportwidget.h"
|
||||||
#include "lrpreviewreportwidget_p.h"
|
#include "lrpreviewreportwidget_p.h"
|
||||||
|
#include "items/editors/lrfonteditorwidget.h"
|
||||||
|
#include "items/editors/lrtextalignmenteditorwidget.h"
|
||||||
|
|
||||||
#include <QPrinter>
|
#include <QPrinter>
|
||||||
#include <QPrintDialog>
|
#include <QPrintDialog>
|
||||||
@ -43,7 +45,7 @@
|
|||||||
|
|
||||||
namespace LimeReport{
|
namespace LimeReport{
|
||||||
|
|
||||||
PreviewReportWindow::PreviewReportWindow(ReportEnginePrivate *report,QWidget *parent, QSettings *settings, Qt::WindowFlags flags) :
|
PreviewReportWindow::PreviewReportWindow(ReportEngine *report, QWidget *parent, QSettings *settings, Qt::WindowFlags flags) :
|
||||||
QMainWindow(parent,flags),
|
QMainWindow(parent,flags),
|
||||||
ui(new Ui::PreviewReportWindow), m_settings(settings), m_ownedSettings(false)
|
ui(new Ui::PreviewReportWindow), m_settings(settings), m_ownedSettings(false)
|
||||||
{
|
{
|
||||||
|
@ -34,15 +34,10 @@
|
|||||||
#include <QDomComment>
|
#include <QDomComment>
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
|
#include <QSettings>
|
||||||
|
#include <QEventLoop>
|
||||||
|
|
||||||
#include "lrpagedesignintf.h"
|
|
||||||
#include "lrreportrender.h"
|
|
||||||
#include "serializators/lrstorageintf.h"
|
|
||||||
#include "serializators/lrxmlreader.h"
|
#include "serializators/lrxmlreader.h"
|
||||||
#include "lrpreviewreportwidget.h"
|
|
||||||
|
|
||||||
#include "items/editors/lrfonteditorwidget.h"
|
|
||||||
#include "items/editors/lrtextalignmenteditorwidget.h"
|
|
||||||
|
|
||||||
namespace LimeReport {
|
namespace LimeReport {
|
||||||
|
|
||||||
@ -50,11 +45,19 @@ namespace Ui {
|
|||||||
class PreviewReportWindow;
|
class PreviewReportWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class PreviewReportWidget;
|
||||||
|
class FontEditorWidget;
|
||||||
|
class TextAlignmentEditorWidget;
|
||||||
|
class ReportEngine;
|
||||||
|
class PageItemDesignIntf;
|
||||||
|
typedef QList< QSharedPointer<PageItemDesignIntf> > ReportPages;
|
||||||
|
|
||||||
|
|
||||||
class PreviewReportWindow : public QMainWindow
|
class PreviewReportWindow : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit PreviewReportWindow(ReportEnginePrivate *report, QWidget *parent = 0, QSettings* settings=0, Qt::WindowFlags flags=0);
|
explicit PreviewReportWindow(ReportEngine *report, QWidget *parent = 0, QSettings* settings=0, Qt::WindowFlags flags=0);
|
||||||
~PreviewReportWindow();
|
~PreviewReportWindow();
|
||||||
void setReportReader(ItemsReaderIntf::Ptr reader);
|
void setReportReader(ItemsReaderIntf::Ptr reader);
|
||||||
void setPages(ReportPages pages);
|
void setPages(ReportPages pages);
|
||||||
|
@ -47,7 +47,9 @@
|
|||||||
|
|
||||||
namespace LimeReport {
|
namespace LimeReport {
|
||||||
|
|
||||||
ReportDesignWidget::ReportDesignWidget(ReportEnginePrivate *report, QMainWindow *mainWindow, QWidget *parent) :
|
// ReportDesignIntf
|
||||||
|
|
||||||
|
ReportDesignWidget::ReportDesignWidget(ReportEngine *report, QMainWindow *mainWindow, QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||||
m_dialogDesignerManager(new DialogDesignerManager(this)),
|
m_dialogDesignerManager(new DialogDesignerManager(this)),
|
||||||
@ -66,7 +68,7 @@ ReportDesignWidget::ReportDesignWidget(ReportEnginePrivate *report, QMainWindow
|
|||||||
m_report->appendPage("page1");
|
m_report->appendPage("page1");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_report=report;
|
m_report=report->d_ptr;
|
||||||
if (!m_report->pageCount()) m_report->appendPage("page1");
|
if (!m_report->pageCount()) m_report->appendPage("page1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +79,8 @@ ReportDesignWidget::ReportDesignWidget(ReportEnginePrivate *report, QMainWindow
|
|||||||
connect(m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentTabChanged(int)));
|
connect(m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentTabChanged(int)));
|
||||||
connect(m_report->scriptContext(), SIGNAL(dialogDeleted(QString)), this, SLOT(slotDialogDeleted(QString)));
|
connect(m_report->scriptContext(), SIGNAL(dialogDeleted(QString)), this, SLOT(slotDialogDeleted(QString)));
|
||||||
|
|
||||||
m_scriptEditor->setPlainText(report->scriptContext()->initScript());
|
//m_instance=this;
|
||||||
|
m_scriptEditor->setPlainText(m_report->scriptContext()->initScript());
|
||||||
m_zoomer = new GraphicsViewZoomer(activeView());
|
m_zoomer = new GraphicsViewZoomer(activeView());
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
@ -69,7 +69,7 @@ public:
|
|||||||
Dialog,
|
Dialog,
|
||||||
Script
|
Script
|
||||||
};
|
};
|
||||||
ReportDesignWidget(ReportEnginePrivate* report,QMainWindow *mainWindow,QWidget *parent = 0);
|
ReportDesignWidget(ReportEngine* report, QMainWindow *mainWindow, QWidget *parent = 0);
|
||||||
~ReportDesignWidget();
|
~ReportDesignWidget();
|
||||||
void createStartPage();
|
void createStartPage();
|
||||||
void clear();
|
void clear();
|
||||||
|
@ -62,7 +62,7 @@ namespace LimeReport{
|
|||||||
|
|
||||||
ReportDesignWindow* ReportDesignWindow::m_instance=0;
|
ReportDesignWindow* ReportDesignWindow::m_instance=0;
|
||||||
|
|
||||||
ReportDesignWindow::ReportDesignWindow(ReportEnginePrivate *report, QWidget *parent, QSettings* settings) :
|
ReportDesignWindow::ReportDesignWindow(ReportEngine *report, QWidget *parent, QSettings* settings) :
|
||||||
QMainWindow(parent), m_textAttibutesIsChanging(false), m_settings(settings), m_ownedSettings(false), m_progressDialog(0), m_showProgressDialog(true)
|
QMainWindow(parent), m_textAttibutesIsChanging(false), m_settings(settings), m_ownedSettings(false), m_progressDialog(0), m_showProgressDialog(true)
|
||||||
{
|
{
|
||||||
initReportEditor(report);
|
initReportEditor(report);
|
||||||
@ -458,7 +458,7 @@ void ReportDesignWindow::createMainMenu()
|
|||||||
m_recentFilesMenu->setDisabled(m_recentFiles.isEmpty());
|
m_recentFilesMenu->setDisabled(m_recentFiles.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportDesignWindow::initReportEditor(ReportEnginePrivate* report)
|
void ReportDesignWindow::initReportEditor(ReportEngine* report)
|
||||||
{
|
{
|
||||||
m_reportDesignWidget=new ReportDesignWidget(report,this,this);
|
m_reportDesignWidget=new ReportDesignWidget(report,this,this);
|
||||||
setCentralWidget(m_reportDesignWidget);
|
setCentralWidget(m_reportDesignWidget);
|
||||||
|
@ -59,7 +59,7 @@ class ReportDesignWindow : public QMainWindow
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit ReportDesignWindow(ReportEnginePrivate* report, QWidget *parent = 0, QSettings* settings=0);
|
explicit ReportDesignWindow(ReportEngine *report, QWidget *parent = 0, QSettings* settings=0);
|
||||||
~ReportDesignWindow();
|
~ReportDesignWindow();
|
||||||
static ReportDesignWindow* instance(){return m_instance;}
|
static ReportDesignWindow* instance(){return m_instance;}
|
||||||
|
|
||||||
@ -139,6 +139,7 @@ private:
|
|||||||
void createItemsActions();
|
void createItemsActions();
|
||||||
void createObjectInspector();
|
void createObjectInspector();
|
||||||
void createObjectsBrowser();
|
void createObjectsBrowser();
|
||||||
|
void initReportEditor(ReportEngine *report);
|
||||||
void createDataWindow();
|
void createDataWindow();
|
||||||
void createScriptWindow();
|
void createScriptWindow();
|
||||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||||
|
@ -381,7 +381,8 @@ void ReportEnginePrivate::previewReport(PreviewHints hints)
|
|||||||
ReportPages pages = renderToPages();
|
ReportPages pages = renderToPages();
|
||||||
dataManager()->setDesignTime(true);
|
dataManager()->setDesignTime(true);
|
||||||
if (pages.count()>0){
|
if (pages.count()>0){
|
||||||
PreviewReportWindow* w = new PreviewReportWindow(this,0,settings());
|
Q_Q(ReportEngine);
|
||||||
|
PreviewReportWindow* w = new PreviewReportWindow(q,0,settings());
|
||||||
w->setWindowFlags(Qt::Dialog|Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint| Qt::WindowMinMaxButtonsHint);
|
w->setWindowFlags(Qt::Dialog|Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint| Qt::WindowMinMaxButtonsHint);
|
||||||
w->setAttribute(Qt::WA_DeleteOnClose,true);
|
w->setAttribute(Qt::WA_DeleteOnClose,true);
|
||||||
w->setWindowModality(Qt::ApplicationModal);
|
w->setWindowModality(Qt::ApplicationModal);
|
||||||
@ -415,7 +416,8 @@ void ReportEnginePrivate::previewReport(PreviewHints hints)
|
|||||||
|
|
||||||
PreviewReportWidget* ReportEnginePrivate::createPreviewWidget(QWidget* parent){
|
PreviewReportWidget* ReportEnginePrivate::createPreviewWidget(QWidget* parent){
|
||||||
|
|
||||||
PreviewReportWidget* widget = new PreviewReportWidget(this, parent);
|
Q_Q(ReportEngine);
|
||||||
|
PreviewReportWidget* widget = new PreviewReportWidget(q, parent);
|
||||||
try{
|
try{
|
||||||
dataManager()->setDesignTime(false);
|
dataManager()->setDesignTime(false);
|
||||||
ReportPages pages = renderToPages();
|
ReportPages pages = renderToPages();
|
||||||
@ -488,7 +490,8 @@ PageDesignIntf* ReportEngine::createPreviewScene(QObject* parent){
|
|||||||
void ReportEnginePrivate::designReport()
|
void ReportEnginePrivate::designReport()
|
||||||
{
|
{
|
||||||
if (!m_designerWindow) {
|
if (!m_designerWindow) {
|
||||||
m_designerWindow = new LimeReport::ReportDesignWindow(this,QApplication::activeWindow(),settings());
|
Q_Q(ReportEngine);
|
||||||
|
m_designerWindow = new LimeReport::ReportDesignWindow(q,QApplication::activeWindow(),settings());
|
||||||
m_designerWindow->setAttribute(Qt::WA_DeleteOnClose,true);
|
m_designerWindow->setAttribute(Qt::WA_DeleteOnClose,true);
|
||||||
m_designerWindow->setWindowIcon(QIcon(":report/images/logo32"));
|
m_designerWindow->setWindowIcon(QIcon(":report/images/logo32"));
|
||||||
m_designerWindow->setShowProgressDialog(m_showProgressDialog);
|
m_designerWindow->setShowProgressDialog(m_showProgressDialog);
|
||||||
|
@ -63,11 +63,15 @@ class DataSourceManager;
|
|||||||
class ReportEnginePrivate;
|
class ReportEnginePrivate;
|
||||||
class PageDesignIntf;
|
class PageDesignIntf;
|
||||||
class PageItemDesignIntf;
|
class PageItemDesignIntf;
|
||||||
|
class ReportDesignWidget;
|
||||||
|
class PreviewReportWidget;
|
||||||
|
|
||||||
typedef QList< QSharedPointer<PageItemDesignIntf> > ReportPages;
|
typedef QList< QSharedPointer<PageItemDesignIntf> > ReportPages;
|
||||||
|
|
||||||
class LIMEREPORT_EXPORT ReportEngine : public QObject{
|
class LIMEREPORT_EXPORT ReportEngine : public QObject{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
friend class ReportDesignWidget;
|
||||||
|
friend class PreviewReportWidget;
|
||||||
public:
|
public:
|
||||||
static void setSettings(QSettings *value){m_settings=value;}
|
static void setSettings(QSettings *value){m_settings=value;}
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user