From e2118385951c98ad9eb3c6fd17e43f6de6e94213 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Tue, 9 Jul 2019 12:28:58 +0300 Subject: [PATCH] Edit mode toollbar has been removed for read only preview mode --- limereport/lrpreviewreportwindow.cpp | 9 +++++++-- limereport/lrpreviewreportwindow.ui | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/limereport/lrpreviewreportwindow.cpp b/limereport/lrpreviewreportwindow.cpp index 2f6f391..ee00a86 100644 --- a/limereport/lrpreviewreportwindow.cpp +++ b/limereport/lrpreviewreportwindow.cpp @@ -189,6 +189,10 @@ void PreviewReportWindow::setMenuVisible(bool value) void PreviewReportWindow::setHideResultEditButton(bool value) { ui->actionEdit_Mode->setVisible(value); + if (!value && ui->editModeTools) { + delete ui->editModeTools; + ui->editModeTools = 0; + } } void PreviewReportWindow::setHidePrintButton(bool value) @@ -292,7 +296,8 @@ void PreviewReportWindow::moveEvent(QMoveEvent* e) void PreviewReportWindow::showEvent(QShowEvent *) { m_fontEditor->setVisible(ui->actionEdit_Mode->isChecked()); - ui->editModeTools->setVisible(false); + if (ui->editModeTools) + ui->editModeTools->setVisible(false); m_textAlignmentEditor->setVisible(ui->actionEdit_Mode->isChecked()); switch (m_previewScaleType) { case FitWidth: @@ -500,7 +505,7 @@ void PreviewReportWindow::on_actionShow_Toolbar_triggered() writeSetting(); } -void PreviewReportWindow::slotCurrentPageChanged(int page) +void PreviewReportWindow::slotCurrentPageChanged(int /*page*/) { slotActivateItemSelectionMode(); } diff --git a/limereport/lrpreviewreportwindow.ui b/limereport/lrpreviewreportwindow.ui index 8ce8873..3db023f 100644 --- a/limereport/lrpreviewreportwindow.ui +++ b/limereport/lrpreviewreportwindow.ui @@ -60,7 +60,7 @@ - toolBar + MainToolBar @@ -98,7 +98,7 @@ true - toolBar_2 + EditModeTools LeftToolBarArea