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

Page number changing during scaling page has been fixed

This commit is contained in:
Arin Alexander 2021-06-01 23:33:38 +03:00
parent 04c3a5a37f
commit 78b298c2d7
4 changed files with 7 additions and 2 deletions

View File

@ -126,7 +126,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
LIMEREPORT_VERSION_MAJOR = 1
LIMEREPORT_VERSION_MINOR = 5
LIMEREPORT_VERSION_RELEASE = 86
LIMEREPORT_VERSION_RELEASE = 87
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"

View File

@ -85,6 +85,7 @@ private:
QColor m_previewPageBackgroundColor;
QPrinter* m_defaultPrinter;
void printPages(QPrinter *printer);
bool m_scaleChanging;
};
} // namespace LimeReport

View File

@ -89,7 +89,7 @@ PreviewReportWidget::PreviewReportWidget(ReportEngine *report, QWidget *parent)
QWidget(parent),
ui(new Ui::PreviewReportWidget), d_ptr(new PreviewReportWidgetPrivate(this)),
m_scaleType(FitWidth), m_scalePercent(0), m_previewPageBackgroundColor(Qt::white),
m_defaultPrinter(0)
m_defaultPrinter(0), m_scaleChanging(false)
{
ui->setupUi(this);
d_ptr->m_report = report->d_ptr;
@ -299,6 +299,7 @@ void PreviewReportWidget::saveToFile()
void PreviewReportWidget::setScalePercent(int percent)
{
m_scaleChanging = true;
ui->graphicsView->resetMatrix();
d_ptr->m_scalePercent = percent;
qreal scaleSize = percent/100.0;
@ -310,6 +311,7 @@ void PreviewReportWidget::setScalePercent(int percent)
m_scaleType = Percents;
m_scalePercent = percent;
}
m_scaleChanging = false;
}
void PreviewReportWidget::fitWidth()
@ -425,6 +427,7 @@ void PreviewReportWidget::activateCurrentPage()
void PreviewReportWidget::slotSliderMoved(int value)
{
if (m_scaleChanging) return;
int curPage = d_ptr->m_currentPage;
if (ui->graphicsView->verticalScrollBar()->minimum()==value){
d_ptr->m_currentPage = 1;

View File

@ -85,6 +85,7 @@ private:
QColor m_previewPageBackgroundColor;
QPrinter* m_defaultPrinter;
void printPages(QPrinter *printer);
bool m_scaleChanging;
};
} // namespace LimeReport