diff --git a/src/lrpageitemdesignintf.cpp b/src/lrpageitemdesignintf.cpp index e15c953..1109e45 100644 --- a/src/lrpageitemdesignintf.cpp +++ b/src/lrpageitemdesignintf.cpp @@ -369,40 +369,56 @@ BandDesignIntf *PageItemDesignIntf::dataBandAt(int index) void PageItemDesignIntf::setTopMargin(int value) { if (m_topMargin!=value){ + m_sizeChainging = true; int oldValue = m_topMargin; m_topMargin=value; - updateMarginRect(); - notify("topMargin",oldValue,value); + if (!isLoading()){ + updateMarginRect(); + 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; - updateMarginRect(); - notify("bottomMargin",oldValue,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; - updateMarginRect(); - notify("leftMargin",oldValue,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; - updateMarginRect(); - notify("rightMargin",oldValue,value); + if (!isLoading()){ + updateMarginRect(); + notify("rightMargin",oldValue,value); + } + m_sizeChainging = false; } } @@ -410,11 +426,13 @@ void PageItemDesignIntf::setPageOrientation(PageItemDesignIntf::Orientation valu { 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)); diff --git a/src/lrpageitemdesignintf.h b/src/lrpageitemdesignintf.h index 56d90c5..d6afc3f 100644 --- a/src/lrpageitemdesignintf.h +++ b/src/lrpageitemdesignintf.h @@ -103,6 +103,7 @@ public: QList& bands(); void setGridStep(int value); int gridStep(); + void objectLoadFinished(); protected slots: void bandDeleted(QObject* band); void bandGeometryChanged(QObject* /*object*/, QRectF newGeometry, QRectF oldGeometry);