0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 08:34:38 +03:00

setPreviewWindowIcon, setPreviewWindowTitle added to LimeReport::ReportEngine

This commit is contained in:
Arin Alexander 2016-04-06 23:03:58 +04:00
parent 8aa23b3fb9
commit 225ee41289
4 changed files with 49 additions and 3 deletions

View File

@ -89,6 +89,8 @@ public:
void setReportName(const QString& name);
QString reportName();
PreviewReportWidget *createPreviewWidget(QWidget *parent = 0);
void setPreviewWindowTitle(const QString& title);
void setPreviewWindowIcon(const QIcon& icon);
signals:
void renderStarted();
void renderFinished();

View File

@ -57,7 +57,8 @@ QSettings* ReportEngine::m_settings = 0;
ReportEnginePrivate::ReportEnginePrivate(QObject *parent) :
QObject(parent), m_fileName(""), m_settings(0), m_ownedSettings(false),
m_printer(new QPrinter(QPrinter::HighResolution)), m_printerSelected(false),
m_showProgressDialog(true), m_reportName(""), m_activePreview(0)
m_showProgressDialog(true), m_reportName(""), m_activePreview(0),
m_previewWindowIcon(":/report/images/logo32"), m_previewWindowTitle(tr("Preview"))
{
m_datasources= new DataSourceManager(this);
m_datasources->setObjectName("datasources");
@ -297,7 +298,9 @@ void ReportEnginePrivate::previewReport()
w->setWindowFlags(Qt::Dialog|Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint| Qt::WindowMinMaxButtonsHint);
w->setAttribute(Qt::WA_DeleteOnClose,true);
w->setWindowModality(Qt::ApplicationModal);
w->setWindowIcon(QIcon(":/report/images/main.ico"));
//w->setWindowIcon(QIcon(":/report/images/main.ico"));
w->setWindowIcon(m_previewWindowIcon);
w->setWindowTitle(m_previewWindowTitle);
w->setSettings(settings());
w->setPages(pages);
if (!dataManager()->errorsList().isEmpty()){
@ -379,7 +382,7 @@ void ReportEnginePrivate::designReport()
{
LimeReport::ReportDesignWindow* w = new LimeReport::ReportDesignWindow(this,QApplication::activeWindow(),settings());
w->setAttribute(Qt::WA_DeleteOnClose,true);
w->setWindowIcon(QIcon(":report/images/main"));
w->setWindowIcon(QIcon(":report/images/logo32"));
w->setShowProgressDialog(m_showProgressDialog);
#if defined(Q_OS_MAC)
//w->showModal();
@ -537,6 +540,26 @@ QString ReportEnginePrivate::renderToString()
}else return QString();
}
QString ReportEnginePrivate::previewWindowTitle() const
{
return m_previewWindowTitle;
}
void ReportEnginePrivate::setPreviewWindowTitle(const QString &previewWindowTitle)
{
m_previewWindowTitle = previewWindowTitle;
}
QIcon ReportEnginePrivate::previewWindowIcon() const
{
return m_previewWindowIcon;
}
void ReportEnginePrivate::setPreviewWindowIcon(const QIcon &previewWindowIcon)
{
m_previewWindowIcon = previewWindowIcon;
}
ReportPages ReportEnginePrivate::renderToPages()
{
m_reportRender = ReportRender::Ptr(new ReportRender);
@ -619,6 +642,18 @@ PreviewReportWidget* ReportEngine::createPreviewWidget(QWidget *parent)
return d->createPreviewWidget(parent);
}
void ReportEngine::setPreviewWindowTitle(const QString &title)
{
Q_D(ReportEngine);
d->setPreviewWindowTitle(title);
}
void ReportEngine::setPreviewWindowIcon(const QIcon &icon)
{
Q_D(ReportEngine);
d->setPreviewWindowIcon(icon);
}
void ReportEngine::setShowProgressDialog(bool value)
{
Q_D(ReportEngine);

View File

@ -89,6 +89,8 @@ public:
void setReportName(const QString& name);
QString reportName();
PreviewReportWidget *createPreviewWidget(QWidget *parent = 0);
void setPreviewWindowTitle(const QString& title);
void setPreviewWindowIcon(const QIcon& icon);
signals:
void renderStarted();
void renderFinished();

View File

@ -104,6 +104,11 @@ public:
bool hasActivePreview(){return m_activePreview;}
PageDesignIntf *createPreviewScene(QObject *parent);
PreviewReportWidget *createPreviewWidget(QWidget *parent);
QIcon previewWindowIcon() const;
void setPreviewWindowIcon(const QIcon &previewWindowIcon);
QString previewWindowTitle() const;
void setPreviewWindowTitle(const QString &previewWindowTitle);
signals:
void pagesLoadFinished();
void datasourceCollectionLoadFinished(const QString& collectionName);
@ -146,6 +151,8 @@ private:
QString m_reportsDir;
QString m_reportName;
QMainWindow* m_activePreview;
QIcon m_previewWindowIcon;
QString m_previewWindowTitle;
};
}