mirror of
				https://github.com/python-LimeReport/LimeReport.git
				synced 2025-11-04 15:41:22 +03:00 
			
		
		
		
	Page geometry initialization has been fixed
This commit is contained in:
		@@ -717,11 +717,17 @@ QSizeF PageItemDesignIntf::getRectByPageSize(const PageSize& size)
 | 
				
			|||||||
        return QSizeF(printer.paperSize(QPrinter::Millimeter).width() * 10,
 | 
					        return QSizeF(printer.paperSize(QPrinter::Millimeter).width() * 10,
 | 
				
			||||||
                      printer.paperSize(QPrinter::Millimeter).height() * 10);
 | 
					                      printer.paperSize(QPrinter::Millimeter).height() * 10);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #else
 | 
					#else
 | 
				
			||||||
        printer.setPageOrientation((QPageLayout::Orientation)pageOrientation());
 | 
					        QPageSize pageSize = QPageSize((QPageSize::PageSizeId)size);
 | 
				
			||||||
        printer.setPageSize(QPageSize((QPageSize::PageSizeId)size));
 | 
					        qreal width = pageSize.size(QPageSize::Millimeter).width() * 10;
 | 
				
			||||||
        return QSizeF(printer.pageLayout().pageSize().size(QPageSize::Millimeter).width() * 10,
 | 
					        qreal height = pageSize.size(QPageSize::Millimeter).height() * 10;
 | 
				
			||||||
                      printer.pageLayout().pageSize().size(QPageSize::Millimeter).height() * 10);
 | 
					        return QSizeF(pageOrientation() == Portrait ? width : height,
 | 
				
			||||||
 | 
					                      pageOrientation() == Portrait ? height : width);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//        printer.setPageOrientation((QPageLayout::Orientation)pageOrientation());
 | 
				
			||||||
 | 
					//        printer.setPageSize(QPageSize((QPageSize::PageSizeId)size));
 | 
				
			||||||
 | 
					//        return QSizeF(printer.pageLayout().pageSize().size(QPageSize::Millimeter).width() * 10,
 | 
				
			||||||
 | 
					//                      printer.pageLayout().pageSize().size(QPageSize::Millimeter).height() * 10);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -798,6 +804,7 @@ void PageItemDesignIntf::initPageSize(const PageItemDesignIntf::PageSize &size)
 | 
				
			|||||||
    m_sizeChainging = true;
 | 
					    m_sizeChainging = true;
 | 
				
			||||||
    if (m_pageSize != Custom){
 | 
					    if (m_pageSize != Custom){
 | 
				
			||||||
        QSizeF pageSize = getRectByPageSize(size);
 | 
					        QSizeF pageSize = getRectByPageSize(size);
 | 
				
			||||||
 | 
					        qDebug() << pageSize;
 | 
				
			||||||
        setWidth(pageSize.width());
 | 
					        setWidth(pageSize.width());
 | 
				
			||||||
        setHeight(pageSize.height());
 | 
					        setHeight(pageSize.height());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -502,7 +502,7 @@ void ReportDesignWindow::createBandsButton()
 | 
				
			|||||||
    connect(m_newTearOffBand,SIGNAL(triggered()),m_bandsAddSignalsMap,SLOT(map()));
 | 
					    connect(m_newTearOffBand,SIGNAL(triggered()),m_bandsAddSignalsMap,SLOT(map()));
 | 
				
			||||||
    m_bandsAddSignalsMap->setMapping(m_newTearOffBand,BandDesignIntf::TearOffBand);
 | 
					    m_bandsAddSignalsMap->setMapping(m_newTearOffBand,BandDesignIntf::TearOffBand);
 | 
				
			||||||
    m_newBandButton->addAction(m_newTearOffBand);
 | 
					    m_newBandButton->addAction(m_newTearOffBand);
 | 
				
			||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 3)
 | 
					#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 1)
 | 
				
			||||||
    connect(m_bandsAddSignalsMap,SIGNAL(mappedInt(int)),this,SLOT(slotNewBand(int)));
 | 
					    connect(m_bandsAddSignalsMap,SIGNAL(mappedInt(int)),this,SLOT(slotNewBand(int)));
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    connect(m_bandsAddSignalsMap,SIGNAL(mapped(int)),this,SLOT(slotNewBand(int)));
 | 
					    connect(m_bandsAddSignalsMap,SIGNAL(mapped(int)),this,SLOT(slotNewBand(int)));
 | 
				
			||||||
@@ -533,7 +533,7 @@ void ReportDesignWindow::createMainMenu()
 | 
				
			|||||||
    m_infoMenu->addAction(m_aboutAction);
 | 
					    m_infoMenu->addAction(m_aboutAction);
 | 
				
			||||||
    m_recentFilesMenu = m_fileMenu->addMenu(tr("Recent Files"));
 | 
					    m_recentFilesMenu = m_fileMenu->addMenu(tr("Recent Files"));
 | 
				
			||||||
    m_recentFilesSignalMap = new QSignalMapper(this);
 | 
					    m_recentFilesSignalMap = new QSignalMapper(this);
 | 
				
			||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 3)
 | 
					#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 1)
 | 
				
			||||||
    connect(m_recentFilesSignalMap,SIGNAL(mappedString(QString)),this,SLOT(slotLoadRecentFile(QString)));
 | 
					    connect(m_recentFilesSignalMap,SIGNAL(mappedString(QString)),this,SLOT(slotLoadRecentFile(QString)));
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    connect(m_recentFilesSignalMap,SIGNAL(mapped(QString)),this,SLOT(slotLoadRecentFile(QString)));
 | 
					    connect(m_recentFilesSignalMap,SIGNAL(mapped(QString)),this,SLOT(slotLoadRecentFile(QString)));
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user