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

Page loading has been fixed

This commit is contained in:
Arin Alexander 2016-03-16 00:38:50 +03:00
parent ad138f7257
commit 5597089985
2 changed files with 34 additions and 9 deletions

View File

@ -369,52 +369,70 @@ BandDesignIntf *PageItemDesignIntf::dataBandAt(int index)
void PageItemDesignIntf::setTopMargin(int value)
{
if (m_topMargin!=value){
m_sizeChainging = true;
int oldValue = m_topMargin;
m_topMargin=value;
if (!isLoading()){
updateMarginRect();
notify("topMargin",oldValue,value);
notify("topMargin",oldValue,value);;
}
m_sizeChainging = false;
}
}
void PageItemDesignIntf::setBottomMargin(int value)
{
if (m_bottomMargin!=value){
m_sizeChainging = true;
int oldValue = m_bottomMargin;
m_bottomMargin=value;
if (!isLoading()){
updateMarginRect();
notify("bottomMargin",oldValue,value);
}
m_sizeChainging = false;
}
}
void PageItemDesignIntf::setLeftMargin(int value)
{
if (m_leftMargin!=value){
m_sizeChainging = true;
int oldValue = m_leftMargin;
m_leftMargin=value;
if (!isLoading()){
updateMarginRect();
notify("leftMargin",oldValue,value);
}
m_sizeChainging = false;
}
}
void PageItemDesignIntf::setRightMargin(int value)
{
if (m_rightMargin!=value){
m_sizeChainging = true;
int oldValue = m_rightMargin;
m_rightMargin=value;
if (!isLoading()){
updateMarginRect();
notify("rightMargin",oldValue,value);
}
m_sizeChainging = false;
}
}
void PageItemDesignIntf::setPageOrientation(PageItemDesignIntf::Orientation value)
{
if (!m_sizeChainging && m_pageOrientaion!=value){
m_sizeChainging = true;
PageItemDesignIntf::Orientation oldValue = m_pageOrientaion;
m_pageOrientaion = value;
if (!isLoading()){
qreal tmpWidth = width();
setWidth(height());
setHeight(tmpWidth);
notify("pageOrientation",oldValue,value);
}
m_sizeChainging = false;
}
@ -497,7 +515,7 @@ void PageItemDesignIntf::updateMarginRect()
m_pageRect.adjust(m_leftMargin*mmFactor(),m_topMargin*mmFactor(),
-m_rightMargin*mmFactor(),-m_bottomMargin*mmFactor());
foreach(BandDesignIntf* band,m_bands){
band->setWidth(pageRect().width());
band->setWidth(pageRect().width()/band->columnsCount());
relocateBands();
}
foreach (BaseDesignIntf* item, childBaseItems()) {
@ -551,6 +569,12 @@ int PageItemDesignIntf::gridStep()
else return 2;
}
void PageItemDesignIntf::objectLoadFinished()
{
BaseDesignIntf::objectLoadFinished();
updateMarginRect();
}
PageItemDesignIntf::Ptr PageItemDesignIntf::create(QObject *owner)
{
return PageItemDesignIntf::Ptr(new PageItemDesignIntf(owner));

View File

@ -103,6 +103,7 @@ public:
QList<BandDesignIntf *>& bands();
void setGridStep(int value);
int gridStep();
void objectLoadFinished();
protected slots:
void bandDeleted(QObject* band);
void bandGeometryChanged(QObject* /*object*/, QRectF newGeometry, QRectF oldGeometry);