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

Finish 1.5.19

This commit is contained in:
Arin Alexander 2019-10-14 23:47:34 +03:00
commit 7efd6df9ac
4 changed files with 15 additions and 2 deletions

View File

@ -127,7 +127,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 = 15 LIMEREPORT_VERSION_RELEASE = 19
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}\\\"

View File

@ -280,7 +280,8 @@ void PageDesignIntf::setPageItems(QList<PageItemDesignIntf::Ptr> pages)
{ {
m_currentPage = 0; m_currentPage = 0;
if (!m_pageItem.isNull()) { if (!m_pageItem.isNull()) {
removeItem(m_pageItem.data()); if (m_pageItem->scene() == this)
removeItem(m_pageItem.data());
m_pageItem.clear(); m_pageItem.clear();
} }
int curHeight = 0; int curHeight = 0;
@ -303,6 +304,14 @@ void PageDesignIntf::setPageItems(QList<PageItemDesignIntf::Ptr> pages)
} }
void PageDesignIntf::removePageItem(PageItemDesignIntf::Ptr pageItem)
{
if (m_pageItem == pageItem){
removeItem(m_pageItem.data());
m_pageItem.clear();
}
}
void PageDesignIntf::mousePressEvent(QGraphicsSceneMouseEvent *event) void PageDesignIntf::mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
if (m_insertMode) { if (m_insertMode) {

View File

@ -113,6 +113,7 @@ namespace LimeReport {
PageItemDesignIntf *pageItem(); PageItemDesignIntf *pageItem();
void setPageItem(PageItemDesignIntf::Ptr pageItem); void setPageItem(PageItemDesignIntf::Ptr pageItem);
void setPageItems(QList<PageItemDesignIntf::Ptr> pages); void setPageItems(QList<PageItemDesignIntf::Ptr> pages);
void removePageItem(PageItemDesignIntf::Ptr pageItem);
QList<PageItemDesignIntf::Ptr> pageItems(){return m_reportPages;} QList<PageItemDesignIntf::Ptr> pageItems(){return m_reportPages;}
bool isItemInsertMode(); bool isItemInsertMode();

View File

@ -1772,6 +1772,7 @@ PrintProcessor::PrintProcessor(QPrinter* printer)
bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page) bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page)
{ {
if (!m_firstPage && !m_painter->isActive()) return false; if (!m_firstPage && !m_painter->isActive()) return false;
PageDesignIntf* backupPage = dynamic_cast<PageDesignIntf*>(page->scene());
//LimeReport::PageDesignIntf m_renderPage; //LimeReport::PageDesignIntf m_renderPage;
//m_renderPage.setItemMode(PrintMode); //m_renderPage.setItemMode(PrintMode);
@ -1825,6 +1826,8 @@ bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page)
m_renderPage.render(m_painter); m_renderPage.render(m_painter);
} }
page->setPos(backupPagePos); page->setPos(backupPagePos);
m_renderPage.removePageItem(page);
if (backupPage) backupPage->reactivatePageItem(page);
return true; return true;
} }