mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-24 16:44:39 +03:00
Page number changing during scaling page has been fixed
This commit is contained in:
parent
04c3a5a37f
commit
78b298c2d7
@ -126,7 +126,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
|
|||||||
|
|
||||||
LIMEREPORT_VERSION_MAJOR = 1
|
LIMEREPORT_VERSION_MAJOR = 1
|
||||||
LIMEREPORT_VERSION_MINOR = 5
|
LIMEREPORT_VERSION_MINOR = 5
|
||||||
LIMEREPORT_VERSION_RELEASE = 86
|
LIMEREPORT_VERSION_RELEASE = 87
|
||||||
|
|
||||||
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
|
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
|
||||||
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"
|
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"
|
||||||
|
@ -85,6 +85,7 @@ private:
|
|||||||
QColor m_previewPageBackgroundColor;
|
QColor m_previewPageBackgroundColor;
|
||||||
QPrinter* m_defaultPrinter;
|
QPrinter* m_defaultPrinter;
|
||||||
void printPages(QPrinter *printer);
|
void printPages(QPrinter *printer);
|
||||||
|
bool m_scaleChanging;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace LimeReport
|
} // namespace LimeReport
|
||||||
|
@ -89,7 +89,7 @@ PreviewReportWidget::PreviewReportWidget(ReportEngine *report, QWidget *parent)
|
|||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::PreviewReportWidget), d_ptr(new PreviewReportWidgetPrivate(this)),
|
ui(new Ui::PreviewReportWidget), d_ptr(new PreviewReportWidgetPrivate(this)),
|
||||||
m_scaleType(FitWidth), m_scalePercent(0), m_previewPageBackgroundColor(Qt::white),
|
m_scaleType(FitWidth), m_scalePercent(0), m_previewPageBackgroundColor(Qt::white),
|
||||||
m_defaultPrinter(0)
|
m_defaultPrinter(0), m_scaleChanging(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
d_ptr->m_report = report->d_ptr;
|
d_ptr->m_report = report->d_ptr;
|
||||||
@ -299,6 +299,7 @@ void PreviewReportWidget::saveToFile()
|
|||||||
|
|
||||||
void PreviewReportWidget::setScalePercent(int percent)
|
void PreviewReportWidget::setScalePercent(int percent)
|
||||||
{
|
{
|
||||||
|
m_scaleChanging = true;
|
||||||
ui->graphicsView->resetMatrix();
|
ui->graphicsView->resetMatrix();
|
||||||
d_ptr->m_scalePercent = percent;
|
d_ptr->m_scalePercent = percent;
|
||||||
qreal scaleSize = percent/100.0;
|
qreal scaleSize = percent/100.0;
|
||||||
@ -310,6 +311,7 @@ void PreviewReportWidget::setScalePercent(int percent)
|
|||||||
m_scaleType = Percents;
|
m_scaleType = Percents;
|
||||||
m_scalePercent = percent;
|
m_scalePercent = percent;
|
||||||
}
|
}
|
||||||
|
m_scaleChanging = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreviewReportWidget::fitWidth()
|
void PreviewReportWidget::fitWidth()
|
||||||
@ -425,6 +427,7 @@ void PreviewReportWidget::activateCurrentPage()
|
|||||||
|
|
||||||
void PreviewReportWidget::slotSliderMoved(int value)
|
void PreviewReportWidget::slotSliderMoved(int value)
|
||||||
{
|
{
|
||||||
|
if (m_scaleChanging) return;
|
||||||
int curPage = d_ptr->m_currentPage;
|
int curPage = d_ptr->m_currentPage;
|
||||||
if (ui->graphicsView->verticalScrollBar()->minimum()==value){
|
if (ui->graphicsView->verticalScrollBar()->minimum()==value){
|
||||||
d_ptr->m_currentPage = 1;
|
d_ptr->m_currentPage = 1;
|
||||||
|
@ -85,6 +85,7 @@ private:
|
|||||||
QColor m_previewPageBackgroundColor;
|
QColor m_previewPageBackgroundColor;
|
||||||
QPrinter* m_defaultPrinter;
|
QPrinter* m_defaultPrinter;
|
||||||
void printPages(QPrinter *printer);
|
void printPages(QPrinter *printer);
|
||||||
|
bool m_scaleChanging;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace LimeReport
|
} // namespace LimeReport
|
||||||
|
Loading…
Reference in New Issue
Block a user