mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-23 20:22:58 +03:00
createPreviewScene(QObject *parent = 0); from now return QGraphicsScene*
This commit is contained in:
parent
5f56f36a49
commit
ee77ad5e5f
@ -42,6 +42,7 @@
|
|||||||
#include "lrreportdesignwindowintrerface.h"
|
#include "lrreportdesignwindowintrerface.h"
|
||||||
|
|
||||||
class QPrinter;
|
class QPrinter;
|
||||||
|
class QGraphicsScene;
|
||||||
|
|
||||||
namespace LimeReport {
|
namespace LimeReport {
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ public:
|
|||||||
bool printReport(QMap<QString, QPrinter*> printers, bool printToAllPrinters = false);
|
bool printReport(QMap<QString, QPrinter*> printers, bool printToAllPrinters = false);
|
||||||
bool printPages(ReportPages pages, QPrinter *printer);
|
bool printPages(ReportPages pages, QPrinter *printer);
|
||||||
void printToFile(const QString& fileName);
|
void printToFile(const QString& fileName);
|
||||||
PageDesignIntf *createPreviewScene(QObject *parent = 0);
|
QGraphicsScene* createPreviewScene(QObject *parent = 0);
|
||||||
bool printToPDF(const QString& fileName);
|
bool printToPDF(const QString& fileName);
|
||||||
bool exportReport(QString exporterName, const QString &fileName = "", const QMap<QString, QVariant>& params = QMap<QString, QVariant>());
|
bool exportReport(QString exporterName, const QString &fileName = "", const QMap<QString, QVariant>& params = QMap<QString, QVariant>());
|
||||||
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
|
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
|
||||||
|
@ -1767,17 +1767,21 @@ void PageDesignIntf::removeAllItems()
|
|||||||
m_commandsList.clear();
|
m_commandsList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PageDesignIntf::setItemMode(BaseDesignIntf::ItemMode state)
|
void PageDesignIntf::setItemMode(BaseDesignIntf::ItemMode mode)
|
||||||
{
|
{
|
||||||
m_itemMode = state;
|
if (m_itemMode != mode){
|
||||||
// foreach(QGraphicsItem * item, items()) {
|
m_itemMode = mode;
|
||||||
// BaseDesignIntf *reportItem = dynamic_cast<BaseDesignIntf *>(item);
|
if (m_currentPage) {
|
||||||
|
m_currentPage->setItemMode(mode);
|
||||||
// if (reportItem) {
|
} else {
|
||||||
// reportItem->setItemMode(itemMode());
|
foreach(QGraphicsItem * item, items()) {
|
||||||
// }
|
BaseDesignIntf *reportItem = dynamic_cast<BaseDesignIntf *>(item);
|
||||||
// }
|
if (reportItem) {
|
||||||
if (m_currentPage) m_currentPage->setItemMode(state);
|
reportItem->setItemMode(itemMode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseDesignIntf* PageDesignIntf::reportItemByName(const QString &name)
|
BaseDesignIntf* PageDesignIntf::reportItemByName(const QString &name)
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <QFileSystemWatcher>
|
#include <QFileSystemWatcher>
|
||||||
#include <QPluginLoader>
|
#include <QPluginLoader>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QGraphicsScene>
|
||||||
|
|
||||||
#include "time.h"
|
#include "time.h"
|
||||||
|
|
||||||
@ -593,6 +594,7 @@ PageDesignIntf* ReportEnginePrivate::createPreviewScene(QObject* parent){
|
|||||||
ReportPages pages = renderToPages();
|
ReportPages pages = renderToPages();
|
||||||
result = new PageDesignIntf(parent);
|
result = new PageDesignIntf(parent);
|
||||||
result->setPageItems(pages);
|
result->setPageItems(pages);
|
||||||
|
result->setItemMode(PrintMode);
|
||||||
} catch (ReportError &exception){
|
} catch (ReportError &exception){
|
||||||
saveError(exception.what());
|
saveError(exception.what());
|
||||||
showError(exception.what());
|
showError(exception.what());
|
||||||
@ -719,7 +721,7 @@ void ReportEnginePrivate::cancelRender()
|
|||||||
m_reportRendering = false;
|
m_reportRendering = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PageDesignIntf* ReportEngine::createPreviewScene(QObject* parent){
|
QGraphicsScene* ReportEngine::createPreviewScene(QObject* parent){
|
||||||
Q_D(ReportEngine);
|
Q_D(ReportEngine);
|
||||||
return d->createPreviewScene(parent);
|
return d->createPreviewScene(parent);
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include "lrreportdesignwindowintrerface.h"
|
#include "lrreportdesignwindowintrerface.h"
|
||||||
|
|
||||||
class QPrinter;
|
class QPrinter;
|
||||||
|
class QGraphicsScene;
|
||||||
|
|
||||||
namespace LimeReport {
|
namespace LimeReport {
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ public:
|
|||||||
bool printReport(QMap<QString, QPrinter*> printers, bool printToAllPrinters = false);
|
bool printReport(QMap<QString, QPrinter*> printers, bool printToAllPrinters = false);
|
||||||
bool printPages(ReportPages pages, QPrinter *printer);
|
bool printPages(ReportPages pages, QPrinter *printer);
|
||||||
void printToFile(const QString& fileName);
|
void printToFile(const QString& fileName);
|
||||||
PageDesignIntf *createPreviewScene(QObject *parent = 0);
|
QGraphicsScene* createPreviewScene(QObject *parent = 0);
|
||||||
bool printToPDF(const QString& fileName);
|
bool printToPDF(const QString& fileName);
|
||||||
bool exportReport(QString exporterName, const QString &fileName = "", const QMap<QString, QVariant>& params = QMap<QString, QVariant>());
|
bool exportReport(QString exporterName, const QString &fileName = "", const QMap<QString, QVariant>& params = QMap<QString, QVariant>());
|
||||||
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
|
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
|
||||||
|
@ -147,7 +147,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void clearReport();
|
void clearReport();
|
||||||
bool printReport(QPrinter *printer=0);
|
bool printReport(QPrinter* printer=0);
|
||||||
bool printReport(QMap<QString, QPrinter*>printers, bool printToAllPrinters);
|
bool printReport(QMap<QString, QPrinter*>printers, bool printToAllPrinters);
|
||||||
bool printPages(ReportPages pages, QPrinter *printer);
|
bool printPages(ReportPages pages, QPrinter *printer);
|
||||||
void printToFile(const QString& fileName);
|
void printToFile(const QString& fileName);
|
||||||
|
Loading…
Reference in New Issue
Block a user