mirror of
https://github.com/fralx/LimeReport.git
synced 2025-09-23 08:29:07 +03:00
Finish 1.4.118
This commit is contained in:
@@ -1163,6 +1163,12 @@ void BaseDesignIntf::setItemPos(const QPointF &newPos)
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
QWidget* findRootWidget(QWidget* widget){
|
||||
|
@@ -800,33 +800,35 @@ void PageItemDesignIntf::moveBandFromTo(int from, int to)
|
||||
|
||||
void PageItemDesignIntf::bandGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry)
|
||||
{
|
||||
BandDesignIntf* band = dynamic_cast<BandDesignIntf*>(object);
|
||||
int curIndex = band->bandIndex();
|
||||
BandDesignIntf* bandToSwap = 0;
|
||||
foreach(BandDesignIntf* curBand, bands()){
|
||||
if (newGeometry.y() > oldGeometry.y()) {
|
||||
if (curBand->bandType() == band->bandType()
|
||||
&& curIndex < curBand->bandIndex()
|
||||
&& (curBand->pos().y() + (curBand->height()/2)) < newGeometry.y()
|
||||
&& curBand->parentBand() == band->parentBand())
|
||||
{
|
||||
curIndex = curBand->bandIndex();
|
||||
bandToSwap = curBand;
|
||||
}
|
||||
} else {
|
||||
if (curBand->bandType() == band->bandType()
|
||||
&& curIndex>curBand->bandIndex()
|
||||
&& (curBand->pos().y() + (curBand->height()/2)) > newGeometry.y()
|
||||
&& curBand->parentBand() == band->parentBand())
|
||||
{
|
||||
curIndex = curBand->bandIndex();
|
||||
bandToSwap = curBand;
|
||||
if (itemMode() == DesignMode){
|
||||
BandDesignIntf* band = dynamic_cast<BandDesignIntf*>(object);
|
||||
int curIndex = band->bandIndex();
|
||||
BandDesignIntf* bandToSwap = 0;
|
||||
foreach(BandDesignIntf* curBand, bands()){
|
||||
if (newGeometry.y() > oldGeometry.y()) {
|
||||
if (curBand->bandType() == band->bandType()
|
||||
&& curIndex < curBand->bandIndex()
|
||||
&& (curBand->pos().y() + (curBand->height()/2)) < newGeometry.y()
|
||||
&& curBand->parentBand() == band->parentBand())
|
||||
{
|
||||
curIndex = curBand->bandIndex();
|
||||
bandToSwap = curBand;
|
||||
}
|
||||
} else {
|
||||
if (curBand->bandType() == band->bandType()
|
||||
&& curIndex>curBand->bandIndex()
|
||||
&& (curBand->pos().y() + (curBand->height()/2)) > newGeometry.y()
|
||||
&& curBand->parentBand() == band->parentBand())
|
||||
{
|
||||
curIndex = curBand->bandIndex();
|
||||
bandToSwap = curBand;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (curIndex != band->bandIndex() && itemMode() == DesignMode){
|
||||
if (page())
|
||||
page()->saveCommand(BandMoveFromToCommand::create(page(), band->bandIndex(), bandToSwap->bandIndex()), true);
|
||||
if (curIndex != band->bandIndex() && itemMode() == DesignMode){
|
||||
if (page())
|
||||
page()->saveCommand(BandMoveFromToCommand::create(page(), band->bandIndex(), bandToSwap->bandIndex()), true);
|
||||
}
|
||||
}
|
||||
relocateBands();
|
||||
}
|
||||
|
Reference in New Issue
Block a user