diff --git a/common.pri b/common.pri index 32339c3..24a0708 100644 --- a/common.pri +++ b/common.pri @@ -133,7 +133,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 49 +LIMEREPORT_VERSION_RELEASE = 50 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 91fa79c..5df12fd 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -84,7 +84,8 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q m_selectionMarker(0), m_fillTransparentInDesignMode(true), m_unitType(Millimeters), - m_itemGeometryLocked(false) + m_itemGeometryLocked(false), + m_isChangingPos(false) { setGeometry(QRectF(0, 0, m_width, m_height)); if (BaseDesignIntf *item = dynamic_cast(parent)) { @@ -389,6 +390,7 @@ void BaseDesignIntf::setFixedPos(bool fixedPos) void BaseDesignIntf::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton) { + m_isChangingPos = true; m_resizeDirectionFlags = resizeDirectionFlags(event->pos()); m_startPos = pos(); m_oldGeometry = geometry(); @@ -398,6 +400,17 @@ void BaseDesignIntf::mousePressEvent(QGraphicsSceneMouseEvent *event) else QGraphicsItem::mousePressEvent(event); } +void BaseDesignIntf::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +{ + QRectF newGeometry = geometry(); + m_isChangingPos = false; + if (newGeometry != m_oldGeometry) { + geometryChangedEvent(newGeometry, m_oldGeometry); + emit posChanged(this, newGeometry.topLeft(), m_oldGeometry.topLeft()); + } + QGraphicsItem::mouseReleaseEvent(event); +} + void BaseDesignIntf::paint(QPainter *ppainter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(option); @@ -732,6 +745,16 @@ void BaseDesignIntf::updatePossibleDirectionFlags(){ } } +bool BaseDesignIntf::isChangingPos() const +{ + return m_isChangingPos; +} + +void BaseDesignIntf::setIsChangingPos(bool isChangingPos) +{ + m_isChangingPos = isChangingPos; +} + bool BaseDesignIntf::isGeometryLocked() const { return m_itemGeometryLocked; @@ -1257,15 +1280,6 @@ void BaseDesignIntf::setItemPos(const QPointF &newPos) emit posChanging(this, finalPos, oldPos); } -void BaseDesignIntf::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) -{ - QRectF newGeometry = geometry(); - if (newGeometry != m_oldGeometry) { - geometryChangedEvent(newGeometry, m_oldGeometry); - emit posChanged(this, newGeometry.topLeft(), m_oldGeometry.topLeft()); - } - QGraphicsItem::mouseReleaseEvent(event); -} QWidget* findRootWidget(QWidget* widget){ while (widget->parentWidget()) { diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index d9fbfc9..07d4ed8 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -331,6 +331,9 @@ public: bool isGeometryLocked() const; void setGeometryLocked(bool itemLocked); + bool isChangingPos() const; + void setIsChangingPos(bool isChangingPos); + protected: //ICollectionContainer @@ -460,6 +463,7 @@ private: QRect m_itemGeometry; UnitType m_unitType; bool m_itemGeometryLocked; + bool m_isChangingPos; signals: void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); void posChanging(QObject* object, QPointF newPos, QPointF oldPos); diff --git a/limereport/lrpageitemdesignintf.cpp b/limereport/lrpageitemdesignintf.cpp index 927784e..42a1b71 100644 --- a/limereport/lrpageitemdesignintf.cpp +++ b/limereport/lrpageitemdesignintf.cpp @@ -876,8 +876,8 @@ void PageItemDesignIntf::moveBandFromTo(int from, int to) void PageItemDesignIntf::bandPositionChanged(QObject* object, QPointF newPos, QPointF oldPos) { - if (itemMode() == DesignMode){ - BandDesignIntf* band = dynamic_cast(object); + BandDesignIntf* band = dynamic_cast(object); + if (band && !band->isChangingPos() && (itemMode() == DesignMode)){ int curIndex = band->bandIndex(); BandDesignIntf* bandToSwap = 0; foreach(BandDesignIntf* curBand, bands()){ @@ -906,7 +906,8 @@ void PageItemDesignIntf::bandPositionChanged(QObject* object, QPointF newPos, QP page()->saveCommand(BandMoveFromToCommand::create(page(), band->bandIndex(), bandToSwap->bandIndex()), true); } } - relocateBands(); + if (band && !band->isChangingPos()) + relocateBands(); } void PageItemDesignIntf::bandGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry) diff --git a/limereport/objectinspector/lrobjectitemmodel.cpp b/limereport/objectinspector/lrobjectitemmodel.cpp index 8e28ff6..0b0fbdb 100644 --- a/limereport/objectinspector/lrobjectitemmodel.cpp +++ b/limereport/objectinspector/lrobjectitemmodel.cpp @@ -164,6 +164,7 @@ void QObjectPropertyModel::translatePropertyName() tr("geometryLocked"); tr("printBehavior"); tr("shiftItems"); + tr("showLegend"); tr("removeGap"); } diff --git a/translations/limereport_ru.ts b/translations/limereport_ru.ts index 9a85f2b..2d935f0 100644 --- a/translations/limereport_ru.ts +++ b/translations/limereport_ru.ts @@ -2030,6 +2030,10 @@ p, li { white-space: pre-wrap; } removeGap Удалять разрыв + + showLegend + Показывать легенду + LimeReport::RectPropItem