mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-24 00:33:02 +03:00
Merge branch 'master' into 1.4
This commit is contained in:
commit
50cd32492e
@ -63,7 +63,7 @@ bool lessThen(BaseDesignIntf *c1, BaseDesignIntf* c2){
|
||||
HorizontalLayout::HorizontalLayout(QObject *owner, QGraphicsItem *parent)
|
||||
: LayoutDesignIntf(xmlTag, owner, parent),m_isRelocating(false),m_layoutType(Layout)
|
||||
{
|
||||
setPosibleResizeDirectionFlags(ResizeBottom);
|
||||
setPossibleResizeDirectionFlags(ResizeBottom);
|
||||
m_layoutMarker = new LayoutMarker(this);
|
||||
m_layoutMarker->setParentItem(this);
|
||||
m_layoutMarker->setColor(Qt::red);
|
||||
@ -223,7 +223,7 @@ void HorizontalLayout::restoreChild(BaseDesignIntf* item){
|
||||
this, SLOT(slotOnChildItemAlignChanged(BaseDesignIntf*,ItemAlign,ItemAlign)));
|
||||
|
||||
item->setFixedPos(true);
|
||||
item->setPosibleResizeDirectionFlags(ResizeRight | ResizeBottom);
|
||||
item->setPossibleResizeDirectionFlags(ResizeRight | ResizeBottom);
|
||||
item->setParent(this);
|
||||
item->setParentItem(this);
|
||||
|
||||
@ -255,7 +255,7 @@ void HorizontalLayout::addChild(BaseDesignIntf *item, bool updateSize)
|
||||
item->setParentItem(this);
|
||||
item->setParent(this);
|
||||
item->setFixedPos(true);
|
||||
item->setPosibleResizeDirectionFlags(ResizeRight | ResizeBottom);
|
||||
item->setPossibleResizeDirectionFlags(ResizeRight | ResizeBottom);
|
||||
|
||||
connect(item,SIGNAL(destroyed(QObject*)),this,SLOT(slotOnChildDestroy(QObject*)));
|
||||
connect(item,SIGNAL(geometryChanged(QObject*,QRectF,QRectF)),this,SLOT(slotOnChildGeometryChanged(QObject*,QRectF,QRectF)));
|
||||
@ -341,7 +341,7 @@ void HorizontalLayout::beforeDelete()
|
||||
bdItem->setVisible(true);
|
||||
bdItem->setPos(mapToParent(bdItem->pos()));
|
||||
bdItem->setFixedPos(false);
|
||||
bdItem->setPosibleResizeDirectionFlags(AllDirections);
|
||||
bdItem->setPossibleResizeDirectionFlags(AllDirections);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -452,7 +452,7 @@ void HorizontalLayout::slotOnChildGeometryChanged(QObject *item, QRectF newGeome
|
||||
|
||||
void HorizontalLayout::slotOnChildItemAlignChanged(BaseDesignIntf *item, const BaseDesignIntf::ItemAlign &, const BaseDesignIntf::ItemAlign&)
|
||||
{
|
||||
item->setPosibleResizeDirectionFlags(ResizeBottom | ResizeRight);
|
||||
item->setPossibleResizeDirectionFlags(ResizeBottom | ResizeRight);
|
||||
}
|
||||
|
||||
void HorizontalLayout::slotOnChildVisibleHasChanged(BaseDesignIntf *)
|
||||
|
@ -142,9 +142,9 @@ void ImageItem::setAutoSize(bool autoSize)
|
||||
if (m_autoSize && !m_picture.isNull()){
|
||||
setWidth(image().width());
|
||||
setHeight(image().height());
|
||||
setPosibleResizeDirectionFlags(Fixed);
|
||||
setPossibleResizeDirectionFlags(Fixed);
|
||||
} else {
|
||||
setPosibleResizeDirectionFlags(AllDirections);
|
||||
setPossibleResizeDirectionFlags(AllDirections);
|
||||
}
|
||||
update();
|
||||
notify("autoSize",!autoSize,autoSize);
|
||||
|
@ -147,8 +147,8 @@ BandDesignIntf::BandDesignIntf(BandsType bandType, const QString &xmlTypeName, Q
|
||||
m_printAlways(false),
|
||||
m_repeatOnEachRow(false)
|
||||
{
|
||||
setPosibleResizeDirectionFlags(ResizeBottom);
|
||||
setPosibleMoveFlags(TopBotom);
|
||||
setPossibleResizeDirectionFlags(ResizeBottom);
|
||||
setPossibleMoveFlags(TopBotom);
|
||||
|
||||
if (parent) {
|
||||
BaseDesignIntf* parentItem = dynamic_cast<BaseDesignIntf*>(parent);
|
||||
|
@ -52,8 +52,8 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q
|
||||
QObject(owner), QGraphicsItem(parent),
|
||||
m_resizeHandleSize(Const::RESIZE_HANDLE_SIZE),
|
||||
m_selectionPenSize(Const::SELECTION_PEN_SIZE),
|
||||
m_posibleResizeDirectionFlags(ResizeTop | ResizeBottom | ResizeLeft | ResizeRight),
|
||||
m_posibleMoveDirectionFlags(All),
|
||||
m_possibleResizeDirectionFlags(ResizeTop | ResizeBottom | ResizeLeft | ResizeRight),
|
||||
m_possibleMoveDirectionFlags(All),
|
||||
m_resizeDirectionFlags(0),
|
||||
m_width(200),
|
||||
m_height(50),
|
||||
@ -494,7 +494,7 @@ void BaseDesignIntf::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
|
||||
QPointF tmpPos = pos();
|
||||
QPointF delta;
|
||||
switch (posibleMoveDirectionFlags()) {
|
||||
switch (possibleMoveDirectionFlags()) {
|
||||
case LeftRight: {
|
||||
delta = QPoint(div(event->buttonDownScenePos(Qt::LeftButton).x() - event->scenePos().x(), hStep).quot * hStep, 0);
|
||||
break;
|
||||
@ -519,9 +519,9 @@ void BaseDesignIntf::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
int BaseDesignIntf::posibleResizeDirectionFlags() const
|
||||
int BaseDesignIntf::possibleResizeDirectionFlags() const
|
||||
{
|
||||
return m_posibleResizeDirectionFlags;
|
||||
return m_possibleResizeDirectionFlags;
|
||||
}
|
||||
|
||||
int BaseDesignIntf::resizeHandleSize() const
|
||||
@ -533,30 +533,26 @@ int BaseDesignIntf::resizeDirectionFlags(QPointF position)
|
||||
{
|
||||
int flags = Fixed;
|
||||
|
||||
if (posibleResizeDirectionFlags()&ResizeTop && m_topRect.contains(position)) {
|
||||
if (possibleResizeDirectionFlags()&ResizeTop && m_topRect.contains(position)) {
|
||||
flags |= ResizeTop;
|
||||
}
|
||||
|
||||
if (posibleResizeDirectionFlags()&ResizeLeft && m_leftRect.contains(position)) {
|
||||
if (possibleResizeDirectionFlags()&ResizeLeft && m_leftRect.contains(position)) {
|
||||
flags |= ResizeLeft;
|
||||
}
|
||||
|
||||
if (posibleResizeDirectionFlags()&ResizeBottom && m_bottomRect.contains(position)) {
|
||||
if (possibleResizeDirectionFlags()&ResizeBottom && m_bottomRect.contains(position)) {
|
||||
flags |= ResizeBottom;
|
||||
}
|
||||
|
||||
if (posibleResizeDirectionFlags()&ResizeRight && m_rightRect.contains(position)) {
|
||||
if (possibleResizeDirectionFlags()&ResizeRight && m_rightRect.contains(position)) {
|
||||
flags |= ResizeRight;
|
||||
}
|
||||
|
||||
// if (posibleResizeDirectionFlags()&FixedSize) {
|
||||
// flags |= FixedSize;
|
||||
// }
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
Qt::CursorShape BaseDesignIntf::getPosibleCursor(int cursorFlags)
|
||||
Qt::CursorShape BaseDesignIntf::getPossibleCursor(int cursorFlags)
|
||||
{
|
||||
|
||||
if ((cursorFlags == Fixed) || (scene()->selectedItems().count() > 1)) return Qt::ArrowCursor;
|
||||
@ -596,7 +592,7 @@ QPointF BaseDesignIntf::modifyPosForAlignedItem(const QPointF& pos){
|
||||
if (parent){
|
||||
qreal leftBorder = parentPage?parentPage->leftMargin()*mmFactor():0;
|
||||
qreal rightBorder = parentPage?parentPage->rightMargin()*mmFactor():0;
|
||||
qreal aviableSpace = parent->width()-(leftBorder+rightBorder);
|
||||
qreal avaibleSpace = parent->width()-(leftBorder+rightBorder);
|
||||
|
||||
switch(m_itemAlign){
|
||||
case LeftItemAlign:
|
||||
@ -606,7 +602,7 @@ QPointF BaseDesignIntf::modifyPosForAlignedItem(const QPointF& pos){
|
||||
result.setX(parent->width()-rightBorder);
|
||||
break;
|
||||
case CenterItemAlign:
|
||||
result.setX((aviableSpace-width())/2);
|
||||
result.setX((avaibleSpace-width())/2);
|
||||
break;
|
||||
case ParentWidthItemAlign:
|
||||
result.setX(leftBorder);
|
||||
@ -646,17 +642,17 @@ void BaseDesignIntf::updateItemAlign(){
|
||||
m_changingItemAlign = false;
|
||||
}
|
||||
|
||||
void BaseDesignIntf::updatePosibleDirectionFlags(){
|
||||
setPosibleResizeDirectionFlags(AllDirections);
|
||||
void BaseDesignIntf::updatePossibleDirectionFlags(){
|
||||
setPossibleResizeDirectionFlags(AllDirections);
|
||||
switch(m_itemAlign){
|
||||
case LeftItemAlign:
|
||||
setPosibleResizeDirectionFlags(AllDirections^ResizeLeft);
|
||||
setPossibleResizeDirectionFlags(AllDirections^ResizeLeft);
|
||||
break;
|
||||
case RightItemAlign:
|
||||
setPosibleResizeDirectionFlags(AllDirections^ResizeRight);
|
||||
setPossibleResizeDirectionFlags(AllDirections^ResizeRight);
|
||||
break;
|
||||
case ParentWidthItemAlign:
|
||||
setPosibleResizeDirectionFlags(ResizeBottom|ResizeTop);
|
||||
setPossibleResizeDirectionFlags(ResizeBottom|ResizeTop);
|
||||
case CenterItemAlign:
|
||||
case DesignedItemAlign:
|
||||
break;
|
||||
@ -718,7 +714,7 @@ void BaseDesignIntf::setItemAlign(const ItemAlign &itemAlign)
|
||||
ItemAlign oldValue = m_itemAlign;
|
||||
m_itemAlign = itemAlign;
|
||||
notify("itemAlign",oldValue,itemAlign);
|
||||
updatePosibleDirectionFlags();
|
||||
updatePossibleDirectionFlags();
|
||||
updateItemAlign();
|
||||
emit itemAlignChanged(this, oldValue, itemAlign);
|
||||
}
|
||||
@ -775,32 +771,32 @@ void BaseDesignIntf::moveUp()
|
||||
|
||||
void BaseDesignIntf::sizeRight()
|
||||
{
|
||||
if ((m_posibleResizeDirectionFlags & ResizeLeft) ||
|
||||
(m_posibleResizeDirectionFlags & ResizeRight)) {
|
||||
if ((m_possibleResizeDirectionFlags & ResizeLeft) ||
|
||||
(m_possibleResizeDirectionFlags & ResizeRight)) {
|
||||
setWidth(width() + page()->horizontalGridStep());
|
||||
}
|
||||
}
|
||||
|
||||
void BaseDesignIntf::sizeLeft()
|
||||
{
|
||||
if ((m_posibleResizeDirectionFlags & ResizeLeft) ||
|
||||
(m_posibleResizeDirectionFlags & ResizeRight)) {
|
||||
if ((m_possibleResizeDirectionFlags & ResizeLeft) ||
|
||||
(m_possibleResizeDirectionFlags & ResizeRight)) {
|
||||
setWidth(width() - page()->horizontalGridStep());
|
||||
}
|
||||
}
|
||||
|
||||
void BaseDesignIntf::sizeUp()
|
||||
{
|
||||
if ((m_posibleResizeDirectionFlags & ResizeTop) ||
|
||||
(m_posibleResizeDirectionFlags & ResizeBottom)) {
|
||||
if ((m_possibleResizeDirectionFlags & ResizeTop) ||
|
||||
(m_possibleResizeDirectionFlags & ResizeBottom)) {
|
||||
setHeight(height() - page()->verticalGridStep());
|
||||
}
|
||||
}
|
||||
|
||||
void BaseDesignIntf::sizeDown()
|
||||
{
|
||||
if ((m_posibleResizeDirectionFlags & ResizeTop) ||
|
||||
(m_posibleResizeDirectionFlags & ResizeBottom)) {
|
||||
if ((m_possibleResizeDirectionFlags & ResizeTop) ||
|
||||
(m_possibleResizeDirectionFlags & ResizeBottom)) {
|
||||
setHeight(height() + page()->verticalGridStep());
|
||||
}
|
||||
}
|
||||
@ -922,9 +918,9 @@ PageDesignIntf *BaseDesignIntf::page()
|
||||
return dynamic_cast<PageDesignIntf*>(scene());
|
||||
}
|
||||
|
||||
void BaseDesignIntf::setPosibleResizeDirectionFlags(int directionsFlags)
|
||||
void BaseDesignIntf::setPossibleResizeDirectionFlags(int directionsFlags)
|
||||
{
|
||||
m_posibleResizeDirectionFlags = directionsFlags;
|
||||
m_possibleResizeDirectionFlags = directionsFlags;
|
||||
}
|
||||
|
||||
QPen BaseDesignIntf::borderPen(BorderSide side/*, bool selected*/) const
|
||||
@ -1102,14 +1098,14 @@ void BaseDesignIntf::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
||||
QGraphicsItem::mouseDoubleClickEvent(event);
|
||||
}
|
||||
|
||||
int BaseDesignIntf::posibleMoveDirectionFlags() const
|
||||
int BaseDesignIntf::possibleMoveDirectionFlags() const
|
||||
{
|
||||
return m_posibleMoveDirectionFlags;
|
||||
return m_possibleMoveDirectionFlags;
|
||||
}
|
||||
|
||||
void BaseDesignIntf::setPosibleMoveFlags(int directionsFlags)
|
||||
void BaseDesignIntf::setPossibleMoveFlags(int directionsFlags)
|
||||
{
|
||||
m_posibleMoveDirectionFlags = directionsFlags;
|
||||
m_possibleMoveDirectionFlags = directionsFlags;
|
||||
}
|
||||
|
||||
void BaseDesignIntf::setMarginSize(int value)
|
||||
|
@ -222,10 +222,10 @@ public:
|
||||
void notify(const QString &propertyName, const QVariant &oldValue, const QVariant &newValue);
|
||||
void notify(const QVector<QString> &propertyNames);
|
||||
|
||||
int posibleResizeDirectionFlags() const;
|
||||
void setPosibleResizeDirectionFlags(int directionsFlags);
|
||||
int posibleMoveDirectionFlags() const;
|
||||
void setPosibleMoveFlags(int directionsFlags);
|
||||
int possibleResizeDirectionFlags() const;
|
||||
void setPossibleResizeDirectionFlags(int directionsFlags);
|
||||
int possibleMoveDirectionFlags() const;
|
||||
void setPossibleMoveFlags(int directionsFlags);
|
||||
|
||||
int marginSize() const {return m_margin;}
|
||||
void setMarginSize(int value);
|
||||
@ -309,16 +309,16 @@ private:
|
||||
void updateSelectionMarker();
|
||||
int resizeDirectionFlags(QPointF position);
|
||||
void moveSelectedItems(QPointF delta);
|
||||
Qt::CursorShape getPosibleCursor(int cursorFlags);
|
||||
void updatePosibleDirectionFlags();
|
||||
Qt::CursorShape getPossibleCursor(int cursorFlags);
|
||||
void updatePossibleDirectionFlags();
|
||||
void turnOnSelectionMarker(bool value);
|
||||
private:
|
||||
QPointF m_startPos;
|
||||
//QPointF m_startScenePos;
|
||||
int m_resizeHandleSize;
|
||||
int m_selectionPenSize;
|
||||
int m_posibleResizeDirectionFlags;
|
||||
int m_posibleMoveDirectionFlags;
|
||||
int m_possibleResizeDirectionFlags;
|
||||
int m_possibleMoveDirectionFlags;
|
||||
int m_resizeDirectionFlags;
|
||||
qreal m_width, m_height;
|
||||
QPen m_pen;
|
||||
|
@ -749,7 +749,7 @@ void PageDesignIntf::dragLeaveEvent(QGraphicsSceneDragDropEvent *)
|
||||
//m_itemInsertRect = 0;
|
||||
}
|
||||
|
||||
QStringList PageDesignIntf::posibleParentItems()
|
||||
QStringList PageDesignIntf::possibleParentItems()
|
||||
{
|
||||
QStringList itemsList;
|
||||
foreach(QGraphicsItem * item, items()) {
|
||||
@ -2071,7 +2071,7 @@ void InsertHLayoutCommand::undoIt()
|
||||
bi->setParent(parent);
|
||||
bi->setPos(m_elements.value(bi->objectName()));
|
||||
bi->setFixedPos(false);
|
||||
bi->setPosibleResizeDirectionFlags(BaseDesignIntf::AllDirections);
|
||||
bi->setPossibleResizeDirectionFlags(BaseDesignIntf::AllDirections);
|
||||
}
|
||||
}
|
||||
page()->removeReportItem(layout,false);
|
||||
|
@ -129,7 +129,7 @@ namespace LimeReport {
|
||||
ReportEnginePrivate* reportEditor();
|
||||
void setReportEditor(ReportEnginePrivate* value){m_reportEditor=value;}
|
||||
|
||||
QStringList posibleParentItems();
|
||||
QStringList possibleParentItems();
|
||||
void registerItem(BaseDesignIntf* item);
|
||||
void registerBand(BandDesignIntf* band);
|
||||
void removeAllItems();
|
||||
|
Loading…
Reference in New Issue
Block a user