mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-25 09:04:39 +03:00
Show ToolBar action has been added to preview window
This commit is contained in:
parent
7ce974090e
commit
4970b09327
@ -84,8 +84,10 @@ namespace Const{
|
|||||||
HidePreviewToolBar = 1,
|
HidePreviewToolBar = 1,
|
||||||
HidePreviewMenuBar = 2,
|
HidePreviewMenuBar = 2,
|
||||||
HidePreviewStatusBar = 4,
|
HidePreviewStatusBar = 4,
|
||||||
HideAllPreviewBar=7};
|
HideAllPreviewBar = 7,
|
||||||
|
PreviewBarsUserSetting = 8};
|
||||||
Q_DECLARE_FLAGS(PreviewHints, PreviewHint)
|
Q_DECLARE_FLAGS(PreviewHints, PreviewHint)
|
||||||
|
Q_FLAGS(PreviewHints)
|
||||||
|
|
||||||
class ReportError : public std::runtime_error{
|
class ReportError : public std::runtime_error{
|
||||||
public:
|
public:
|
||||||
|
@ -71,7 +71,7 @@ public:
|
|||||||
bool printReport(QPrinter *printer=0);
|
bool printReport(QPrinter *printer=0);
|
||||||
void printToFile(const QString& fileName);
|
void printToFile(const QString& fileName);
|
||||||
bool printToPDF(const QString& fileName);
|
bool printToPDF(const QString& fileName);
|
||||||
void previewReport(PreviewHints hints = ShowAllPreviewBars);
|
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
|
||||||
void designReport();
|
void designReport();
|
||||||
void setShowProgressDialog(bool value);
|
void setShowProgressDialog(bool value);
|
||||||
IDataSourceManager* dataManager();
|
IDataSourceManager* dataManager();
|
||||||
|
BIN
limereport/images/checked.png
Normal file
BIN
limereport/images/checked.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 749 B |
BIN
limereport/images/not_checked.png
Normal file
BIN
limereport/images/not_checked.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 666 B |
BIN
limereport/images/toolbar.png
Normal file
BIN
limereport/images/toolbar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 346 B |
@ -84,8 +84,10 @@ namespace Const{
|
|||||||
HidePreviewToolBar = 1,
|
HidePreviewToolBar = 1,
|
||||||
HidePreviewMenuBar = 2,
|
HidePreviewMenuBar = 2,
|
||||||
HidePreviewStatusBar = 4,
|
HidePreviewStatusBar = 4,
|
||||||
HideAllPreviewBar=7};
|
HideAllPreviewBar = 7,
|
||||||
|
PreviewBarsUserSetting = 8};
|
||||||
Q_DECLARE_FLAGS(PreviewHints, PreviewHint)
|
Q_DECLARE_FLAGS(PreviewHints, PreviewHint)
|
||||||
|
Q_FLAGS(PreviewHints)
|
||||||
|
|
||||||
class ReportError : public std::runtime_error{
|
class ReportError : public std::runtime_error{
|
||||||
public:
|
public:
|
||||||
|
@ -70,6 +70,7 @@ PreviewReportWindow::PreviewReportWindow(ReportEnginePrivate *report,QWidget *pa
|
|||||||
connect(m_previewReportWidget, SIGNAL(scalePercentChanged(int)), this, SLOT(slotScalePercentChanged(int)));
|
connect(m_previewReportWidget, SIGNAL(scalePercentChanged(int)), this, SLOT(slotScalePercentChanged(int)));
|
||||||
connect(m_scalePercent, SIGNAL(currentIndexChanged(QString)), this, SLOT(scaleComboboxChanged(QString)));
|
connect(m_scalePercent, SIGNAL(currentIndexChanged(QString)), this, SLOT(scaleComboboxChanged(QString)));
|
||||||
restoreSetting();
|
restoreSetting();
|
||||||
|
selectStateIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreviewReportWindow::writeSetting()
|
void PreviewReportWindow::writeSetting()
|
||||||
@ -138,7 +139,8 @@ void PreviewReportWindow::setErrorMessages(const QStringList &value){
|
|||||||
|
|
||||||
void PreviewReportWindow::setToolBarVisible(bool value)
|
void PreviewReportWindow::setToolBarVisible(bool value)
|
||||||
{
|
{
|
||||||
ui->toolBar->setVisible(value);
|
ui->toolBar->setHidden(value);
|
||||||
|
selectStateIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreviewReportWindow::setStatusBarVisible(bool value)
|
void PreviewReportWindow::setStatusBarVisible(bool value)
|
||||||
@ -224,6 +226,15 @@ void PreviewReportWindow::moveEvent(QMoveEvent* e)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PreviewReportWindow::selectStateIcon()
|
||||||
|
{
|
||||||
|
if (ui->toolBar->isHidden()){
|
||||||
|
ui->actionShow_Toolbar->setIcon(QIcon(":/report/images/not_checked.png"));
|
||||||
|
} else {
|
||||||
|
ui->actionShow_Toolbar->setIcon(QIcon(":/report/images/checked.png"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PreviewReportWindow::slotPrint()
|
void PreviewReportWindow::slotPrint()
|
||||||
{
|
{
|
||||||
m_previewReportWidget->print();
|
m_previewReportWidget->print();
|
||||||
@ -327,4 +338,13 @@ void PreviewReportWindow::on_actionShowMessages_toggled(bool value)
|
|||||||
m_previewReportWidget->setErrorsMesagesVisible(value);
|
m_previewReportWidget->setErrorsMesagesVisible(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PreviewReportWindow::on_actionShow_Toolbar_triggered()
|
||||||
|
{
|
||||||
|
setToolBarVisible(!ui->toolBar->isHidden());
|
||||||
|
writeSetting();
|
||||||
|
}
|
||||||
|
|
||||||
}// namespace LimeReport
|
}// namespace LimeReport
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,6 +69,7 @@ protected:
|
|||||||
void closeEvent(QCloseEvent *);
|
void closeEvent(QCloseEvent *);
|
||||||
void resizeEvent(QResizeEvent *e);
|
void resizeEvent(QResizeEvent *e);
|
||||||
void moveEvent(QMoveEvent *e);
|
void moveEvent(QMoveEvent *e);
|
||||||
|
void selectStateIcon();
|
||||||
public slots:
|
public slots:
|
||||||
void slotPrint();
|
void slotPrint();
|
||||||
void slotPriorPage();
|
void slotPriorPage();
|
||||||
@ -89,6 +90,7 @@ private slots:
|
|||||||
void scaleComboboxChanged(QString text);
|
void scaleComboboxChanged(QString text);
|
||||||
void slotScalePercentChanged(int percent);
|
void slotScalePercentChanged(int percent);
|
||||||
void on_actionShowMessages_toggled(bool value);
|
void on_actionShowMessages_toggled(bool value);
|
||||||
|
void on_actionShow_Toolbar_triggered();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ItemsReaderIntf* reader();
|
ItemsReaderIntf* reader();
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>800</width>
|
||||||
<height>21</height>
|
<height>20</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuView">
|
<widget class="QMenu" name="menuView">
|
||||||
@ -44,6 +44,8 @@
|
|||||||
</property>
|
</property>
|
||||||
<addaction name="actionZoomIn"/>
|
<addaction name="actionZoomIn"/>
|
||||||
<addaction name="actionZoomOut"/>
|
<addaction name="actionZoomOut"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionShow_Toolbar"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuReport">
|
<widget class="QMenu" name="menuReport">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@ -254,6 +256,24 @@
|
|||||||
<string>One to one</string>
|
<string>One to one</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionShow_Toolbar">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="report.qrc">
|
||||||
|
<normaloff>:/report/images/toolbar</normaloff>:/report/images/toolbar</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Toolbar</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Show toolbar</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="report.qrc"/>
|
<include location="report.qrc"/>
|
||||||
|
@ -328,9 +328,11 @@ void ReportEnginePrivate::previewReport(PreviewHints hints)
|
|||||||
w->setErrorMessages(dataManager()->errorsList());
|
w->setErrorMessages(dataManager()->errorsList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!hints.testFlag(PreviewBarsUserSetting)){
|
||||||
w->setMenuVisible(!hints.testFlag(HidePreviewMenuBar));
|
w->setMenuVisible(!hints.testFlag(HidePreviewMenuBar));
|
||||||
w->setStatusBarVisible(!hints.testFlag(HidePreviewStatusBar));
|
w->setStatusBarVisible(!hints.testFlag(HidePreviewStatusBar));
|
||||||
w->setToolBarVisible(!hints.testFlag(HidePreviewToolBar));
|
w->setToolBarVisible(!hints.testFlag(HidePreviewToolBar));
|
||||||
|
}
|
||||||
|
|
||||||
m_activePreview = w;
|
m_activePreview = w;
|
||||||
connect(w,SIGNAL(destroyed(QObject*)), this, SLOT(slotPreviewWindowDestroed(QObject*)));
|
connect(w,SIGNAL(destroyed(QObject*)), this, SLOT(slotPreviewWindowDestroed(QObject*)));
|
||||||
|
@ -71,7 +71,7 @@ public:
|
|||||||
bool printReport(QPrinter *printer=0);
|
bool printReport(QPrinter *printer=0);
|
||||||
void printToFile(const QString& fileName);
|
void printToFile(const QString& fileName);
|
||||||
bool printToPDF(const QString& fileName);
|
bool printToPDF(const QString& fileName);
|
||||||
void previewReport(PreviewHints hints = ShowAllPreviewBars);
|
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
|
||||||
void designReport();
|
void designReport();
|
||||||
void setShowProgressDialog(bool value);
|
void setShowProgressDialog(bool value);
|
||||||
IDataSourceManager* dataManager();
|
IDataSourceManager* dataManager();
|
||||||
|
@ -80,7 +80,7 @@ public:
|
|||||||
bool printReport(QPrinter *printer=0);
|
bool printReport(QPrinter *printer=0);
|
||||||
void printToFile(const QString& fileName);
|
void printToFile(const QString& fileName);
|
||||||
bool printToPDF(const QString& fileName);
|
bool printToPDF(const QString& fileName);
|
||||||
void previewReport(PreviewHints hints = ShowAllPreviewBars);
|
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
|
||||||
void designReport();
|
void designReport();
|
||||||
void setSettings(QSettings* value);
|
void setSettings(QSettings* value);
|
||||||
void setShowProgressDialog(bool value){m_showProgressDialog = value;}
|
void setShowProgressDialog(bool value){m_showProgressDialog = value;}
|
||||||
|
@ -165,5 +165,8 @@
|
|||||||
<file>images/FitWidth.png</file>
|
<file>images/FitWidth.png</file>
|
||||||
<file>images/OneToOne.png</file>
|
<file>images/OneToOne.png</file>
|
||||||
<file alias="/images/logo32">images/logo_32x32.png</file>
|
<file alias="/images/logo32">images/logo_32x32.png</file>
|
||||||
|
<file alias="/images/toolbar">images/toolbar.png</file>
|
||||||
|
<file>images/not_checked.png</file>
|
||||||
|
<file>images/checked.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Loading…
Reference in New Issue
Block a user