diff --git a/common.pri b/common.pri index 8ad66e9..55a62b4 100644 --- a/common.pri +++ b/common.pri @@ -120,7 +120,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 119 +LIMEREPORT_VERSION_RELEASE = 120 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp index 6efe968..e344773 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -1063,6 +1063,7 @@ QVariant BaseDesignIntf::itemChange(QGraphicsItem::GraphicsItemChange change, co if (change == QGraphicsItem::ItemPositionHasChanged) { updateSelectionMarker(); } + if (change == QGraphicsItem::ItemSelectedChange) { turnOnSelectionMarker(value.toBool()); emit itemSelectedHasBeenChanged(this, value.toBool()); @@ -1157,18 +1158,18 @@ void BaseDesignIntf::setItemPos(const QPointF &newPos) QPointF oldPos = pos(); QPointF finalPos = modifyPosForAlignedItem(newPos); QGraphicsItem::setPos(finalPos); - emit posChanged(this, finalPos, oldPos); + emit posChanging(this, finalPos, oldPos); } void BaseDesignIntf::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - QGraphicsItem::mouseReleaseEvent(event); QRectF newGeometry = geometry(); if (newGeometry != m_oldGeometry) { geometryChangedEvent(newGeometry, m_oldGeometry); updateSelectionMarker(); - emit(geometryChanged(this, newGeometry, m_oldGeometry)); + emit(posChanged(this, newGeometry.topLeft(), m_oldGeometry.topLeft())); } + QGraphicsItem::mouseReleaseEvent(event); } QWidget* findRootWidget(QWidget* widget){ diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index df37850..1c00f0e 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -417,6 +417,7 @@ private: signals: void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); + void posChanging(QObject* object, QPointF newPos, QPointF oldPos); void posChanged(QObject* object, QPointF newPos, QPointF oldPos); void itemSelected(LimeReport::BaseDesignIntf *item); void itemSelectedHasBeenChanged(BaseDesignIntf *item, bool value); @@ -428,7 +429,6 @@ signals: void propertyesChanged(QVector propertyNames); void itemAlignChanged(BaseDesignIntf* item, const ItemAlign& oldValue, const ItemAlign& newValue); void itemVisibleHasChanged(BaseDesignIntf* item); - void beforeRender(); void afterData(); void afterRender(); diff --git a/limereport/lrpageitemdesignintf.cpp b/limereport/lrpageitemdesignintf.cpp index 046a203..96bf692 100644 --- a/limereport/lrpageitemdesignintf.cpp +++ b/limereport/lrpageitemdesignintf.cpp @@ -327,7 +327,7 @@ void PageItemDesignIntf::registerBand(BandDesignIntf *band) band->setParentItem(this); band->setWidth(pageRect().width()/band->columnsCount()); connect(band, SIGNAL(destroyed(QObject*)),this,SLOT(bandDeleted(QObject*))); - connect(band, SIGNAL(geometryChanged(QObject*,QRectF,QRectF)),this,SLOT(bandGeometryChanged(QObject*,QRectF,QRectF))); + connect(band, SIGNAL(posChanged(QObject*,QPointF,QPointF)),this,SLOT(bandPositionChanged(QObject*,QPointF,QPointF))); } } @@ -798,17 +798,17 @@ void PageItemDesignIntf::moveBandFromTo(int from, int to) } -void PageItemDesignIntf::bandGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry) +void PageItemDesignIntf::bandPositionChanged(QObject* object, QPointF newPos, QPointF oldPos) { if (itemMode() == DesignMode){ BandDesignIntf* band = dynamic_cast(object); int curIndex = band->bandIndex(); BandDesignIntf* bandToSwap = 0; foreach(BandDesignIntf* curBand, bands()){ - if (newGeometry.y() > oldGeometry.y()) { + if (newPos.y() > oldPos.y()) { if (curBand->bandType() == band->bandType() && curIndex < curBand->bandIndex() - && (curBand->pos().y() + (curBand->height()/2)) < newGeometry.y() + && (curBand->pos().y() + (curBand->height()/2)) < newPos.y() && curBand->parentBand() == band->parentBand()) { curIndex = curBand->bandIndex(); @@ -817,7 +817,7 @@ void PageItemDesignIntf::bandGeometryChanged(QObject* object, QRectF newGeometry } else { if (curBand->bandType() == band->bandType() && curIndex>curBand->bandIndex() - && (curBand->pos().y() + (curBand->height()/2)) > newGeometry.y() + && (curBand->pos().y() + (curBand->height()/2)) > newPos.y() && curBand->parentBand() == band->parentBand()) { curIndex = curBand->bandIndex(); diff --git a/limereport/lrpageitemdesignintf.h b/limereport/lrpageitemdesignintf.h index 719d0e7..d6f8a94 100644 --- a/limereport/lrpageitemdesignintf.h +++ b/limereport/lrpageitemdesignintf.h @@ -148,7 +148,7 @@ signals: void afterLastPageRendered(); protected slots: void bandDeleted(QObject* band); - void bandGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); + void bandPositionChanged(QObject* object, QPointF newPos, QPointF oldPos); protected: void collectionLoadFinished(const QString& collectionName); QRectF& pageRect(){return m_pageRect;}