From 667a655e4a5fe0acba82bb4b5866ca406d663863 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Fri, 21 Jun 2019 20:18:23 +0300 Subject: [PATCH] Rulers and inches support has been added --- .../dark_style_sheet/qdarkstyle/style.qss | 2 +- .../qlightstyle/lightstyle.qss | 2 +- limereport/designer.pri | 2 + limereport/items/lrabstractlayout.h | 2 +- limereport/lrbasedesignintf.cpp | 75 ++++--- limereport/lrbasedesignintf.h | 21 +- limereport/lrfactoryinitializer.cpp | 2 +- limereport/lrpagedesignintf.cpp | 25 ++- limereport/lrpageitemdesignintf.cpp | 49 +++-- limereport/lrpageitemdesignintf.h | 2 + limereport/lrreportdesignwidget.cpp | 177 ++++++++++++++- limereport/lrreportdesignwidget.h | 40 ++++ limereport/lrreportengine.cpp | 4 +- limereport/lrreportrender.cpp | 11 +- .../objectinspector/lrobjectitemmodel.cpp | 1 + .../propertyItems/lrenumpropitem.cpp | 2 + .../propertyItems/lrmarginpropitem.cpp | 102 +++++++++ .../propertyItems/lrmarginpropitem.h | 28 +++ .../propertyItems/lrqrealpropitem.cpp | 4 +- .../propertyItems/lrqrealpropitem.h | 2 - .../propertyItems/lrrectproptem.cpp | 202 ++++++++++++------ .../propertyItems/lrrectproptem.h | 21 +- translations/limereport_ru.qm | Bin 120136 -> 121800 bytes translations/limereport_ru.ts | 24 ++- 24 files changed, 652 insertions(+), 148 deletions(-) create mode 100644 limereport/objectinspector/propertyItems/lrmarginpropitem.cpp create mode 100644 limereport/objectinspector/propertyItems/lrmarginpropitem.h diff --git a/3rdparty/dark_style_sheet/qdarkstyle/style.qss b/3rdparty/dark_style_sheet/qdarkstyle/style.qss index 44d1983..0140e4f 100644 --- a/3rdparty/dark_style_sheet/qdarkstyle/style.qss +++ b/3rdparty/dark_style_sheet/qdarkstyle/style.qss @@ -34,7 +34,7 @@ QWidget { color: #eff0f1; background-color: #383838; - selection-background-color:#000; + selection-background-color:#819a67; selection-color: #eff0f1; background-clip: border; border-image: none; diff --git a/3rdparty/light_style_sheet/qlightstyle/lightstyle.qss b/3rdparty/light_style_sheet/qlightstyle/lightstyle.qss index 223d324..1c768a4 100644 --- a/3rdparty/light_style_sheet/qlightstyle/lightstyle.qss +++ b/3rdparty/light_style_sheet/qlightstyle/lightstyle.qss @@ -34,7 +34,7 @@ QWidget { color: #000; background-color: #f0f0f0; - selection-background-color:#000; + selection-background-color:#b5da91; selection-color: #000; background-clip: border; border-image: none; diff --git a/limereport/designer.pri b/limereport/designer.pri index f377546..1c7e279 100644 --- a/limereport/designer.pri +++ b/limereport/designer.pri @@ -27,6 +27,7 @@ SOURCES += \ $$REPORT_PATH/objectinspector/propertyItems/lrdatasourcepropitem.cpp \ $$REPORT_PATH/objectinspector/propertyItems/lrgroupfieldpropitem.cpp \ $$REPORT_PATH/objectinspector/propertyItems/lrcontentpropitem.cpp \ + $$REPORT_PATH/objectinspector/propertyItems/lrmarginpropitem.cpp \ $$REPORT_PATH/objectinspector/editors/lrtextitempropertyeditor.cpp \ $$REPORT_PATH/objectinspector/editors/lrcomboboxeditor.cpp \ $$REPORT_PATH/objectinspector/editors/lrcheckboxeditor.cpp \ @@ -69,6 +70,7 @@ HEADERS += \ $$REPORT_PATH/objectinspector/propertyItems/lrcontentpropitem.h \ $$REPORT_PATH/objectinspector/propertyItems/lrqrealpropitem.h \ $$REPORT_PATH/objectinspector/propertyItems/lrcolorpropitem.h \ + $$REPORT_PATH/objectinspector/propertyItems/lrmarginpropitem.h \ $$REPORT_PATH/objectinspector/editors/lrtextitempropertyeditor.h \ $$REPORT_PATH/objectinspector/editors/lrcomboboxeditor.h \ $$REPORT_PATH/objectinspector/editors/lrcheckboxeditor.h \ diff --git a/limereport/items/lrabstractlayout.h b/limereport/items/lrabstractlayout.h index 742055a..1324ff7 100644 --- a/limereport/items/lrabstractlayout.h +++ b/limereport/items/lrabstractlayout.h @@ -34,7 +34,7 @@ public: int childrenCount(); int layoutSpacing() const; void setLayoutSpacing(int layoutSpacing); - qreal layoutSpacingMM(){ return m_layoutSpacing * mmFactor();} + qreal layoutSpacingMM(){ return m_layoutSpacing * unitFactor();} protected: void beforeDelete(); void childAddedEvent(BaseDesignIntf *child); diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp index e0c943b..18d5130 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -60,7 +60,6 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q m_width(200), m_height(50), m_fontColor(Qt::black), - m_mmFactor(Const::mmFACTOR), m_fixedPos(false), m_borderLineSize(1), m_BGMode(OpaqueMode), @@ -83,7 +82,8 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q m_hovered(false), m_joinMarkerOn(false), m_selectionMarker(0), - m_fillTransparentInDesignMode(true) + m_fillTransparentInDesignMode(true), + m_unitType(Millimeters) { setGeometry(QRectF(0, 0, m_width, m_height)); if (BaseDesignIntf *item = dynamic_cast(parent)) { @@ -100,7 +100,6 @@ QRectF BaseDesignIntf::boundingRect() const qreal halfpw = pen().widthF() / 2; halfpw += 2; m_boundingRect = rect(); - m_boundingRect.adjust(-halfpw, -halfpw, halfpw, halfpw); }; return m_boundingRect; } @@ -185,7 +184,7 @@ void BaseDesignIntf::setWidth(qreal width) QString BaseDesignIntf::setItemWidth(qreal width) { - setWidth(width * mmFactor()); + setWidth(width * unitFactor()); return QString(); } @@ -194,9 +193,9 @@ qreal BaseDesignIntf::height() const return rect().height(); } -QRectF BaseDesignIntf::geometry() const +QRect BaseDesignIntf::geometry() const { - return QRectF(pos().x(), pos().y(), width(), height()); + return QRect(pos().x(), pos().y(), width(), height()); } void BaseDesignIntf::setHeight(qreal height) @@ -206,28 +205,28 @@ void BaseDesignIntf::setHeight(qreal height) QString BaseDesignIntf::setItemHeight(qreal height) { - setHeight(height * mmFactor()); + setHeight(height * unitFactor()); return QString(); } qreal BaseDesignIntf::getItemWidth() { - return width() / mmFactor(); + return width() / unitFactor(); } qreal BaseDesignIntf::getItemHeight() { - return height() / mmFactor(); + return height() / unitFactor(); } qreal BaseDesignIntf::getItemPosX() { - return x() / mmFactor(); + return x() / unitFactor(); } qreal BaseDesignIntf::getItemPosY() { - return y() / mmFactor(); + return y() / unitFactor(); } qreal BaseDesignIntf::getAbsolutePosX() @@ -242,13 +241,13 @@ qreal BaseDesignIntf::getAbsolutePosY() QString BaseDesignIntf::setItemPosX(qreal xValue) { - setItemPos(xValue * mmFactor(),y()); + setItemPos(xValue * unitFactor(),y()); return QString(); } QString BaseDesignIntf::setItemPosY(qreal yValue) { - setItemPos(x(),yValue * mmFactor()); + setItemPos(x(),yValue * unitFactor()); return QString(); } @@ -337,32 +336,46 @@ QSizeF BaseDesignIntf::size() const QSizeF BaseDesignIntf::sizeMM() const { - return QSizeF(width() / m_mmFactor, height() / m_mmFactor); + return QSizeF(width() / Const::mmFACTOR, height() / Const::mmFACTOR); } qreal BaseDesignIntf::widthMM() const { - return width() / m_mmFactor; + return width() / Const::mmFACTOR; } qreal BaseDesignIntf::heightMM() const { - return height() / m_mmFactor; + return height() / Const::mmFACTOR; } -void BaseDesignIntf::setMMFactor(qreal mmFactor) +//void BaseDesignIntf::setUnitFactor(qreal unitFactor) +//{ +// m_unitFactor = unitFactor; +//} + +qreal BaseDesignIntf::unitFactor() const { - m_mmFactor = mmFactor; + if (m_unitType == Millimeters) + return Const::mmFACTOR; + else return Const::mmFACTOR * 2.54; } -qreal BaseDesignIntf::mmFactor() const +void BaseDesignIntf::setUnitType(BaseDesignIntf::UnitType value) { - return m_mmFactor; + foreach(BaseDesignIntf* child, childBaseItems()) + child->setUnitType(value); + m_unitType = value; +} + +BaseDesignIntf::UnitType BaseDesignIntf::unitType() +{ + return m_unitType; } QPointF BaseDesignIntf::posMM() const { - return QPointF(pos().x() / m_mmFactor, pos().y() / m_mmFactor); + return QPointF(pos().x() / Const::mmFACTOR, pos().y() / Const::mmFACTOR); } QRectF BaseDesignIntf::rect() const @@ -652,8 +665,8 @@ QPointF BaseDesignIntf::modifyPosForAlignedItem(const QPointF& pos){ BaseDesignIntf* parent = dynamic_cast(parentItem()); PageItemDesignIntf* parentPage = dynamic_cast(parentItem()); if (parent){ - qreal leftBorder = parentPage?parentPage->leftMargin()*mmFactor():0; - qreal rightBorder = parentPage?parentPage->rightMargin()*mmFactor():0; + qreal leftBorder = parentPage ? parentPage->leftMargin() * Const::mmFACTOR : 0; + qreal rightBorder = parentPage ? parentPage->rightMargin() * Const::mmFACTOR : 0; qreal avaibleSpace = parent->width()-(leftBorder+rightBorder); switch(m_itemAlign){ @@ -694,10 +707,9 @@ void BaseDesignIntf::updateItemAlign(){ PageItemDesignIntf* parentPage = dynamic_cast(parentItem()); m_changingItemAlign = true; if (parent){ - qreal leftBorder = parentPage?parentPage->leftMargin()*mmFactor():0; - qreal rightBorder = parentPage?parentPage->rightMargin()*mmFactor():0; + qreal leftBorder = parentPage ? parentPage->leftMargin() * Const::mmFACTOR : 0; + qreal rightBorder = parentPage ? parentPage->rightMargin() * Const::mmFACTOR : 0; qreal aviableSpace = parent->width()-(leftBorder+rightBorder); - setPos(modifyPosForAlignedItem(pos())); if (m_itemAlign == ParentWidthItemAlign) setWidth(aviableSpace); @@ -732,6 +744,11 @@ void BaseDesignIntf::setFillTransparentInDesignMode(bool fillTransparentInDesign m_fillTransparentInDesignMode = fillTransparentInDesignMode; } +void BaseDesignIntf::emitPosChanged(QPointF oldPos, QPointF newPos) +{ + emit posChanged(this, oldPos, newPos); +} + bool BaseDesignIntf::fillInSecondPass() const { return m_fillInSecondPass; @@ -1031,9 +1048,9 @@ void BaseDesignIntf::beforeDelete() } -void BaseDesignIntf::setGeometryProperty(QRectF rect) +void BaseDesignIntf::setGeometryProperty(QRect rect) { - if (rect!=geometry()){ + if ( rect != m_itemGeometry ){ QRectF oldValue = geometry(); if ((rect.x() != geometry().x()) || (rect.y() != geometry().y())) setPos(rect.x(), rect.y()); @@ -1098,8 +1115,10 @@ void BaseDesignIntf::initMode(ItemMode mode) QVariant BaseDesignIntf::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) { + if (change == QGraphicsItem::ItemPositionHasChanged) { updateSelectionMarker(); + emit geometryChanged(this, geometry(), geometry()); } if (change == QGraphicsItem::ItemSelectedChange) { diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index 6209b97..01dfc0f 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -88,7 +88,8 @@ class BaseDesignIntf : Q_ENUMS(BrushStyle) Q_ENUMS(ItemAlign) Q_FLAGS(BorderLines) - Q_PROPERTY(QRectF geometry READ geometry WRITE setGeometryProperty NOTIFY geometryChanged) + Q_ENUMS(UnitType) + Q_PROPERTY(QRect geometry READ geometry WRITE setGeometryProperty NOTIFY geometryChanged) Q_PROPERTY(ACollectionProperty children READ fakeCollectionReader DESIGNABLE false) Q_PROPERTY(qreal zOrder READ zValue WRITE setZValueProperty DESIGNABLE false) Q_PROPERTY(BorderLines borders READ borderLines WRITE setBorderLinesFlags) @@ -137,6 +138,7 @@ public: }; enum ObjectState {ObjectLoading, ObjectLoaded, ObjectCreated}; enum ItemAlign {LeftItemAlign,RightItemAlign,CenterItemAlign,ParentWidthItemAlign,DesignedItemAlign}; + enum UnitType {Millimeters, Inches}; // enum ExpandType {EscapeSymbols, NoEscapeSymbols, ReplaceHTMLSymbols}; Q_DECLARE_FLAGS(BorderLines, BorderSide) Q_DECLARE_FLAGS(ItemMode,ItemModes) @@ -183,12 +185,13 @@ public: bool isFixedPos(){return m_fixedPos;} int resizeHandleSize() const; - void setMMFactor(qreal mmFactor); - qreal mmFactor() const; - virtual QRectF geometry() const; + qreal unitFactor() const; + void setUnitType(UnitType unitType); + UnitType unitType(); + virtual QRect geometry() const; void setGeometry(QRectF rect); - QRectF rect()const; + QRectF rect() const; void setupPainter(QPainter* painter) const; virtual QRectF boundingRect() const; @@ -209,7 +212,7 @@ public: ItemMode itemMode() const {return m_itemMode;} virtual void setBorderLinesFlags(LimeReport::BaseDesignIntf::BorderLines flags); - void setGeometryProperty(QRectF rect); + void setGeometryProperty(QRect rect); PageDesignIntf* page(); BorderLines borderLines() const; @@ -297,6 +300,7 @@ public: bool fillTransparentInDesignMode() const; void setFillTransparentInDesignMode(bool fillTransparentInDesignMode); + void emitPosChanged(QPointF oldPos, QPointF newPos); protected: @@ -380,7 +384,6 @@ private: QPen m_pen; QFont m_font; QColor m_fontColor; - qreal m_mmFactor; bool m_fixedPos; int m_borderLineSize; @@ -421,7 +424,9 @@ private: bool m_joinMarkerOn; SelectionMarker* m_selectionMarker; Marker* m_joinMarker; - bool m_fillTransparentInDesignMode; + bool m_fillTransparentInDesignMode; + QRect m_itemGeometry; + UnitType m_unitType; signals: void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); void posChanging(QObject* object, QPointF newPos, QPointF oldPos); diff --git a/limereport/lrfactoryinitializer.cpp b/limereport/lrfactoryinitializer.cpp index f91e7e6..f244d1a 100644 --- a/limereport/lrfactoryinitializer.cpp +++ b/limereport/lrfactoryinitializer.cpp @@ -294,7 +294,7 @@ ObjectPropItem * createReqtItem( ObjectPropItem * createReqtMMItem( QObject*object, LimeReport::ObjectPropItem::ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& data, LimeReport::ObjectPropItem* parent, bool readonly ){ - return new LimeReport::RectMMPropItem(object, objects, name, displayName, data, parent, readonly); + return new LimeReport::RectUnitPropItem(object, objects, name, displayName, data, parent, readonly); } ObjectPropItem * createStringPropItem( diff --git a/limereport/lrpagedesignintf.cpp b/limereport/lrpagedesignintf.cpp index 46fe876..0e478bf 100644 --- a/limereport/lrpagedesignintf.cpp +++ b/limereport/lrpagedesignintf.cpp @@ -268,7 +268,10 @@ void PageDesignIntf::setPageItem(PageItemDesignIntf::Ptr pageItem) } m_pageItem = pageItem; m_pageItem->setItemMode(itemMode()); - setSceneRect(pageItem->rect().adjusted(-10*Const::mmFACTOR,-10*Const::mmFACTOR,10*Const::mmFACTOR,10*Const::mmFACTOR)); + setSceneRect(pageItem->rect().adjusted(-10 * Const::mmFACTOR, + -10 * Const::mmFACTOR, + 10 * Const::mmFACTOR, + 10 * Const::mmFACTOR)); addItem(m_pageItem.data()); registerItem(m_pageItem.data()); } @@ -290,7 +293,10 @@ void PageDesignIntf::setPageItems(QList pages) curHeight+=pageItem->height()+20; if (curWidthwidth()) curWidth=pageItem->width(); } - setSceneRect(QRectF(0,0,curWidth,curHeight).adjusted(-10*Const::mmFACTOR,-10*Const::mmFACTOR,10*Const::mmFACTOR,10*Const::mmFACTOR)); + setSceneRect(QRectF( 0, 0, curWidth,curHeight).adjusted( -10 * Const::mmFACTOR, + -10 * Const::mmFACTOR, + 10 * Const::mmFACTOR, + 10 * Const::mmFACTOR)); if (m_reportPages.count()>0) m_currentPage = m_reportPages.at(0).data(); @@ -500,6 +506,7 @@ BaseDesignIntf *PageDesignIntf::addReportItem(const QString &itemType, QPointF p BaseDesignIntf *reportItem = addReportItem(itemType, band, band); reportItem->setPos(placePosOnGrid(band->mapFromScene(pos))); reportItem->setSize(placeSizeOnGrid(size)); + reportItem->setUnitType(pageItem()->unitType()); return reportItem; } else { PageItemDesignIntf* page = pageItem() ? pageItem() : m_currentPage; @@ -507,6 +514,7 @@ BaseDesignIntf *PageDesignIntf::addReportItem(const QString &itemType, QPointF p BaseDesignIntf *reportItem = addReportItem(itemType, page, page); reportItem->setPos(placePosOnGrid(page->mapFromScene(pos))); reportItem->setSize(placeSizeOnGrid(size)); + reportItem->setUnitType(pageItem()->unitType()); ItemDesignIntf* ii = dynamic_cast(reportItem); if (ii) ii->setItemLocation(ItemDesignIntf::Page); @@ -522,6 +530,7 @@ BaseDesignIntf *PageDesignIntf::addReportItem(const QString &itemType, QObject * BaseDesignIntf *item = LimeReport::DesignElementsFactory::instance().objectCreator(itemType)((owner) ? owner : pageItem(), (parent) ? parent : pageItem()); item->setObjectName(genObjectName(*item)); item->setItemTypeName(itemType); + item->setUnitType(pageItem()->unitType()); registerItem(item); return item; } @@ -2087,7 +2096,11 @@ bool PosChangedCommand::doIt() for (int i = 0; i < m_newPos.count(); i++) { BaseDesignIntf *reportItem = page()->reportItemByName(m_newPos[i].objectName); - if (reportItem && (reportItem->pos() != m_newPos[i].pos)) reportItem->setPos(m_newPos[i].pos); + if (reportItem && (reportItem->pos() != m_newPos[i].pos)){ + QPointF oldValue = reportItem->pos(); + reportItem->setPos(m_newPos[i].pos); + emit reportItem->posChanged(reportItem, oldValue, reportItem->pos()); + } } return true; @@ -2098,7 +2111,11 @@ void PosChangedCommand::undoIt() for (int i = 0; i < m_oldPos.count(); i++) { BaseDesignIntf *reportItem = page()->reportItemByName(m_oldPos[i].objectName); - if (reportItem && (reportItem->pos() != m_oldPos[i].pos)) reportItem->setPos(m_oldPos[i].pos); + if (reportItem && (reportItem->pos() != m_oldPos[i].pos)){ + QPointF oldValue = reportItem->pos(); + reportItem->setPos(m_oldPos[i].pos); + reportItem->emitPosChanged(oldValue, reportItem->pos()); + } } } diff --git a/limereport/lrpageitemdesignintf.cpp b/limereport/lrpageitemdesignintf.cpp index 0641424..ac3ba68 100644 --- a/limereport/lrpageitemdesignintf.cpp +++ b/limereport/lrpageitemdesignintf.cpp @@ -544,8 +544,8 @@ void PageItemDesignIntf::relocateBands() m_bands[i+1]->setPos(pageRect().x(),posByColumn[0]); posByColumn[0] += m_bands[i+1]->height()+bandSpace; } else { - m_bands[i+1]->setPos(pageRect().x(),posByColumn[0]+2); - posByColumn[0] += m_bands[i+1]->height()+bandSpace+2; + m_bands[i+1]->setPos(pageRect().x(),posByColumn[0]); + posByColumn[0] += m_bands[i+1]->height()+bandSpace; } } else { m_bands[i+1]->setPos(m_bands[i+1]->pos().x(),posByColumn[m_bands[i+1]->columnIndex()]); @@ -904,6 +904,18 @@ void PageItemDesignIntf::bandGeometryChanged(QObject* object, QRectF newGeometry bandPositionChanged(object, newGeometry.topLeft(), oldGeometry.topLeft()); } +void PageItemDesignIntf::setUnitTypeProperty(BaseDesignIntf::UnitType value) +{ + if (unitType() != value){ + UnitType oldValue = unitType(); + setUnitType(value); + if (!isLoading()){ + update(); + notify("units", oldValue, value); + } + } +} + void PageItemDesignIntf::collectionLoadFinished(const QString &collectionName) { if (collectionName.compare("children",Qt::CaseInsensitive)==0){ @@ -925,8 +937,12 @@ void PageItemDesignIntf::collectionLoadFinished(const QString &collectionName) void PageItemDesignIntf::updateMarginRect() { m_pageRect = rect(); - m_pageRect.adjust(m_leftMargin*mmFactor(),m_topMargin*mmFactor(), - -m_rightMargin*mmFactor(),-m_bottomMargin*mmFactor()); + m_pageRect.adjust( leftMargin() * Const::mmFACTOR, + topMargin() * Const::mmFACTOR, + -rightMargin() * Const::mmFACTOR, + -bottomMargin() * Const::mmFACTOR + ); + foreach(BandDesignIntf* band,m_bands){ band->setWidth(pageRect().width()/band->columnsCount()); relocateBands(); @@ -944,20 +960,27 @@ void PageItemDesignIntf::paintGrid(QPainter *ppainter, QRectF rect) ppainter->save(); ppainter->setPen(QPen(gridColor())); ppainter->setOpacity(0.5); - for (int i=0;i<=(rect.height()-50)/100;i++){ - ppainter->drawLine(rect.x(),(i*100)+rect.y()+50,rect.right(),i*100+rect.y()+50); + for (int i = 0; i <= (rect.height() - 5 * unitFactor()) / (10 * unitFactor()); ++i){ + if (i * 10 * unitFactor() + 5 * unitFactor() >= topMargin() * Const::mmFACTOR) + ppainter->drawLine(rect.x(), (i * 10 * unitFactor()) + ( (rect.y() + 5 * unitFactor()) - (topMargin() * Const::mmFACTOR)), + rect.right(), i * 10 * unitFactor() +( (rect.y() + 5 * unitFactor()) - (topMargin() * Const::mmFACTOR))); }; - for (int i=0;i<=((rect.width()-50)/100);i++){ - ppainter->drawLine(i*100+rect.x()+50,rect.y(),i*100+rect.x()+50,rect.bottom()); + for (int i=0; i<=((rect.width() - 5 * unitFactor()) / (10 * unitFactor())); ++i){ + if (i * 10 * unitFactor() + 5 * unitFactor() >= leftMargin() * Const::mmFACTOR) + ppainter->drawLine(i * 10 * unitFactor() + ((rect.x() + 5 * unitFactor()) - (leftMargin() * Const::mmFACTOR)), rect.y(), + i * 10 * unitFactor() + ((rect.x() + 5 * unitFactor()) - (leftMargin() * Const::mmFACTOR)), rect.bottom()); }; - ppainter->setPen(QPen(gridColor())); ppainter->setOpacity(1); - for (int i=0;i<=(rect.width()/100);i++){ - ppainter->drawLine(i*100+rect.x(),rect.y(),i*100+rect.x(),rect.bottom()); + for (int i = 0; i <= (rect.width() / (10 * unitFactor())); ++i){ + if (i * 10 * unitFactor() >= leftMargin() * Const::mmFACTOR) + ppainter->drawLine(i * 10 * unitFactor() + (rect.x() - (leftMargin() * Const::mmFACTOR)), rect.y(), + i * 10 * unitFactor() + (rect.x() - (leftMargin() * Const::mmFACTOR)), rect.bottom()); }; - for (int i=0;i<=rect.height()/100;i++){ - ppainter->drawLine(rect.x(),i*100+rect.y(),rect.right(),i*100+rect.y()); + for (int i = 0; i <= rect.height() / (10 * unitFactor()); ++i){ + if (i * 10 * unitFactor() >= topMargin() * Const::mmFACTOR) + ppainter->drawLine(rect.x(), i * 10 * unitFactor() + (rect.y() - (topMargin() * Const::mmFACTOR)), + rect.right(), i * 10 * unitFactor() + (rect.y() - (topMargin() * Const::mmFACTOR))); }; ppainter->drawRect(rect); ppainter->restore(); diff --git a/limereport/lrpageitemdesignintf.h b/limereport/lrpageitemdesignintf.h index 7e2510d..466b360 100644 --- a/limereport/lrpageitemdesignintf.h +++ b/limereport/lrpageitemdesignintf.h @@ -61,6 +61,7 @@ class PageItemDesignIntf : public ItemsContainerDesignInft Q_PROPERTY(bool endlessHeight READ endlessHeight WRITE setEndlessHeight) Q_PROPERTY(bool printable READ isPrintable WRITE setPrintable) Q_PROPERTY(QString printerName READ printerName WRITE setPrinterName) + Q_PROPERTY(UnitType units READ unitType WRITE setUnitTypeProperty) friend class ReportRender; public: enum Orientation { Portrait = QPrinter::Portrait, Landscape = QPrinter::Landscape }; @@ -169,6 +170,7 @@ protected slots: void bandDeleted(QObject* band); void bandPositionChanged(QObject* object, QPointF newPos, QPointF oldPos); void bandGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); + void setUnitTypeProperty(BaseDesignIntf::UnitType value); protected: void collectionLoadFinished(const QString& collectionName); QRectF& pageRect(){return m_pageRect;} diff --git a/limereport/lrreportdesignwidget.cpp b/limereport/lrreportdesignwidget.cpp index 42e6297..c98c9da 100644 --- a/limereport/lrreportdesignwidget.cpp +++ b/limereport/lrreportdesignwidget.cpp @@ -277,10 +277,12 @@ void ReportDesignWidget::createTabs(){ m_tabWidget->clear(); int pageIndex = -1; for (int i = 0; ipageCount();++i){ - QGraphicsView* view = new QGraphicsView(qobject_cast(this)); +// QGraphicsView* view = new QGraphicsView(qobject_cast(this)); + PageView* view = new PageView(qobject_cast(this)); view->setBackgroundBrush(QBrush(Qt::gray)); view->setFrameShape(QFrame::NoFrame); view->setScene(m_report->pageAt(i)); + view->setPageItem(m_report->pageAt(i)->pageItem()); // foreach(QGraphicsItem* item, m_report->pageAt(i)->selectedItems()){ // item->setSelected(false); @@ -1017,6 +1019,179 @@ void ReportDesignWidget::clear() m_scriptEditor->setPlainText(""); } +void PageView::setPageItem(PageItemDesignIntf *pageItem) +{ + if (!pageItem) return; + m_pageItem = pageItem; + if (!m_horizontalRuller){ + m_horizontalRuller = new Ruler(Ruler::Horizontal, this); + m_horizontalRuller->setPage(pageItem); + } + if (!m_verticalRuller){ + m_verticalRuller = new Ruler(Ruler::Vertical, this); + m_verticalRuller->setPage(pageItem); + } +} + +bool PageView::viewportEvent(QEvent *event) +{ + switch (event->type()) { + case QEvent::MouseMove: + m_horizontalRuller->setMousePos(dynamic_cast(event)->pos()); + m_verticalRuller->setMousePos(dynamic_cast(event)->pos()); + m_horizontalRuller->update(); + m_verticalRuller->update(); + break; + //case QEvent::Resize: + case QEvent::Paint: + if (m_horizontalRuller){ + int x = mapFromScene(m_pageItem->boundingRect().x(),m_pageItem->boundingRect().y()).x(); + int y = mapFromScene(m_pageItem->boundingRect().x(),m_pageItem->boundingRect().y()).y(); + int width = mapFromScene(m_pageItem->boundingRect().bottomRight().x(),m_pageItem->boundingRect().bottomRight().y()).x(); + int height = mapFromScene(m_pageItem->boundingRect().bottomRight().x(),m_pageItem->boundingRect().bottomRight().y()).y(); + + x = x < 0 ? 0 : x; + y = y < 0 ? 0 : y; + + m_horizontalRuller->setGeometry(x+20, 0, (width-x), 20); + m_verticalRuller->setGeometry(0, y+20, 20, (height - y)); + m_verticalRuller->update(); + m_horizontalRuller->update(); + } + break; + default: + break; + } + + return QGraphicsView::viewportEvent(event); +} + +void Ruler::setPage(PageItemDesignIntf *page) +{ + m_page = page; + +} + +void Ruler::paintEvent(QPaintEvent *event){ + QPainter painter(this); + painter.setBrush(palette().background()); + painter.setPen(Qt::NoPen); + painter.drawRect(event->rect()); +// painter.setPen(palette().foreground().color()); + + if (m_page){ + qreal rulerWidth = m_page->geometry().width() / m_page->unitFactor(); + qreal rulerHeight = m_page->geometry().height() / m_page->unitFactor(); + + QGraphicsView* view = qobject_cast(parent()); + + int hStartPos = view->mapFromScene(0,0).x(); + int vStartPos = view->mapFromScene(0,0).y(); + + QFont font = painter.font(); + font.setPointSize(7); + painter.setFont(font); + + switch (m_type) { + case Horizontal: + painter.setPen(Qt::NoPen); + + if (isColorDark(palette().background().color())) + painter.setBrush(QColor("#64893d")); + else + painter.setBrush(QColor("#b5da91")); + + drawItemWithChildren(&painter, m_page); + painter.setPen(palette().foreground().color()); + + for (int i = 0; i < rulerWidth / 10; ++i){ + int hs10 = view->mapFromScene(QPointF(m_page->geometry().topLeft().x() + i * 10 * m_page->unitFactor(), 0)).x(); + int hs5 = view->mapFromScene(QPointF(m_page->geometry().topLeft().x() + i * 10 * m_page->unitFactor() + 5 * m_page->unitFactor(), 0)).x(); + if (hs10 > 0){ + if (hStartPos > 0){ + hs10 -= hStartPos; + hs5 -= hStartPos; + } + painter.drawLine(hs10, 15, hs10, 20); + painter.drawLine(hs5, 10, hs5, 20); + if ( i > 0) + painter.drawText(QPoint(hs10 - (painter.fontMetrics().width(QString::number(i))/2), 12), + QString::number(i)); + } + } + painter.setPen(Qt::black); + painter.drawLine(m_mousePos.x() - (hStartPos > 0 ? hStartPos : 0) , 0, + m_mousePos.x() - (hStartPos > 0 ? hStartPos : 0) , 20); + break; + case Vertical: + painter.setPen(Qt::NoPen); + + if (isColorDark(palette().background().color())) + painter.setBrush(QColor("#64893d")); + else + painter.setBrush(QColor("#b5da91")); + + drawItemWithChildren(&painter, m_page); + painter.setPen(palette().foreground().color()); + for (int i = 0; i < rulerHeight / 10; ++i){ + int vs10 = view->mapFromScene(QPointF(0, m_page->geometry().topLeft().y()+i * 10 * m_page->unitFactor())).y(); + int vs5 = view->mapFromScene(QPointF(0, m_page->geometry().topLeft().y()+i * 10 * m_page->unitFactor() + 5 * m_page->unitFactor())).y(); + if (vs10 > 0){ + if (vStartPos > 0){ + vs10 -= vStartPos; + vs5 -= vStartPos; + } + painter.drawLine(15, vs10, 20, vs10); + if ( i > 0 ) + painter.drawText(QPoint( (15 - painter.fontMetrics().width(QString::number(i))) / 2 , + vs10 + (painter.fontMetrics().height()/2)), QString::number(i)); + painter.drawLine(10, vs5, 20, vs5); + } + } + painter.setPen(Qt::black); + painter.drawLine(0, m_mousePos.y() - (vStartPos > 0 ? vStartPos : 0), + 20, m_mousePos.y() - (vStartPos > 0 ? vStartPos : 0)); + break; + } + } +} + +void Ruler::drawItemWithChildren(QPainter* painter, BaseDesignIntf *item) +{ + foreach(BaseDesignIntf* child, item->childBaseItems()){ + if (!child->childBaseItems().isEmpty()) + drawItemWithChildren(painter, child); + else drawItem(painter, child); + + } + drawItem(painter, item); +} + +void Ruler::drawItem(QPainter* painter, BaseDesignIntf *item) +{ + if (!item->isSelected()) return; + + QGraphicsView* view = qobject_cast(parent()); + int hStartPos = view->mapFromScene(0,0).x(); + int vStartPos = view->mapFromScene(0,0).y(); + + switch (m_type) { + case Horizontal: + if (item->isSelected()) + painter->drawRect(view->mapFromScene(item->mapToScene(0,0)).x() - hStartPos, 0, + view->mapFromScene(item->geometry().bottomRight().x() - item->pos().x(), 0).x() - hStartPos, 20); + + + break; + case Vertical: + if (item->isSelected()) + painter->drawRect(0, view->mapFromScene(item->mapToScene(0, 0)).y() - vStartPos, + 20, view->mapFromScene(0, item->geometry().bottomRight().y() - item->pos().y()).y() - vStartPos); + break; + + } +} + } diff --git a/limereport/lrreportdesignwidget.h b/limereport/lrreportdesignwidget.h index 5229ce8..3429cae 100644 --- a/limereport/lrreportdesignwidget.h +++ b/limereport/lrreportdesignwidget.h @@ -64,6 +64,46 @@ class TranslationEditor; class ScriptEditor; +class Ruler: public QWidget{ +public: + enum RulerType{Horizontal, Vertical}; + Ruler(RulerType type, QWidget* parent = 0): QWidget(parent), m_page(0), m_type(type){} + void setPage(PageItemDesignIntf* page); + void setMousePos(QPoint mousePos){ m_mousePos = mousePos;} +protected: + void paintEvent(QPaintEvent* event); + void drawItemWithChildren(QPainter *painter, BaseDesignIntf* item); + void drawItem(QPainter *painter, BaseDesignIntf* item); +private: + PageItemDesignIntf* m_page; + RulerType m_type; + QPoint m_mousePos; +}; + +class PageView: public QGraphicsView{ +public: + PageView(QWidget *parent = nullptr): QGraphicsView(parent), + m_horizontalRuller(0), m_verticalRuller(0) + { + setViewportMargins(20,20,0,0); + } + PageView(QGraphicsScene *scene, QWidget *parent = nullptr): + QGraphicsView(scene, parent), + m_horizontalRuller(0), m_verticalRuller(0) + { + setViewportMargins(20,20,0,0); + } + void setPageItem(PageItemDesignIntf* pageItem); +protected: +// void mouseMoveEvent(QMouseEvent *event); +// void resizeEvent(QResizeEvent *event); + bool viewportEvent(QEvent *event); +private: + PageItemDesignIntf* m_pageItem; + Ruler* m_horizontalRuller; + Ruler* m_verticalRuller; +}; + class ReportDesignWidget : public QWidget { Q_OBJECT diff --git a/limereport/lrreportengine.cpp b/limereport/lrreportengine.cpp index 05418e5..d997639 100644 --- a/limereport/lrreportengine.cpp +++ b/limereport/lrreportengine.cpp @@ -1786,8 +1786,8 @@ bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page) m_printer->getPageMargins(&leftMargin, &topMargin, &rightMargin, &bottomMargin, QPrinter::Millimeter); QRectF printerPageRect = m_printer->pageRect(QPrinter::Millimeter); - printerPageRect = QRectF(0,0,(printerPageRect.size().width() + rightMargin + leftMargin) * Const::mmFACTOR, - (printerPageRect.size().height() + bottomMargin +topMargin) * Const::mmFACTOR); + printerPageRect = QRectF(0,0,(printerPageRect.size().width() + rightMargin + leftMargin) * page->unitFactor(), + (printerPageRect.size().height() + bottomMargin +topMargin) * page->unitFactor()); if (m_printer->pageSize() != static_cast(page->pageSize()) && printerPageRect.width() < page->geometry().width()) diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index d4566ef..bf74151 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -1241,9 +1241,9 @@ void ReportRender::startNewPage(bool isFirst) emit m_patternPageItem->beforeRender(); m_renderPageItem->setObjectName(QLatin1String("ReportPage")+QString::number(m_pageCount)); - m_maxHeightByColumn[m_currentColumn]=m_renderPageItem->pageRect().height(); - m_currentStartDataPos[m_currentColumn]=m_patternPageItem->topMargin()*Const::mmFACTOR; - m_currentIndex=0; + m_maxHeightByColumn[m_currentColumn] = m_renderPageItem->pageRect().height(); + m_currentStartDataPos[m_currentColumn] = m_patternPageItem->topMargin() * Const::mmFACTOR; + m_currentIndex = 0; if (isFirst) { renderReportHeader(m_patternPageItem, BeforePageHeader); @@ -1254,7 +1254,7 @@ void ReportRender::startNewPage(bool isFirst) m_pageFooterHeight = calcPageFooterHeight(m_patternPageItem)+2; m_maxHeightByColumn[m_currentColumn] -= m_pageFooterHeight; - m_currentIndex=10; + m_currentIndex = 10; m_dataAreaSize = m_maxHeightByColumn[m_currentColumn]; m_renderedDataBandCount = 0; @@ -1473,7 +1473,8 @@ void ReportRender::savePage(bool isLast) foreach (BandDesignIntf* band, m_renderPageItem->bands()) { pageHeight += band->height(); } - m_renderPageItem->setHeight(pageHeight+10+(m_patternPageItem->topMargin()+m_patternPageItem->bottomMargin())*Const::mmFACTOR); + m_renderPageItem->setHeight(pageHeight + 10 + + (m_patternPageItem->topMargin() + m_patternPageItem->bottomMargin()) * Const::mmFACTOR); } } diff --git a/limereport/objectinspector/lrobjectitemmodel.cpp b/limereport/objectinspector/lrobjectitemmodel.cpp index 0e76ad6..e7bf04f 100644 --- a/limereport/objectinspector/lrobjectitemmodel.cpp +++ b/limereport/objectinspector/lrobjectitemmodel.cpp @@ -160,6 +160,7 @@ void QObjectPropertyModel::translatePropertyName() tr("fontLetterSpacing"); tr("hideText"); tr("option3"); + tr("units"); } void QObjectPropertyModel::clearObjectsList() diff --git a/limereport/objectinspector/propertyItems/lrenumpropitem.cpp b/limereport/objectinspector/propertyItems/lrenumpropitem.cpp index 2c6c6b0..143ba38 100644 --- a/limereport/objectinspector/propertyItems/lrenumpropitem.cpp +++ b/limereport/objectinspector/propertyItems/lrenumpropitem.cpp @@ -143,6 +143,8 @@ void EnumPropItem::translateEnumItemName() tr("TitleAlignCenter"); tr("Layout"); tr("Table"); + tr("Millimeters"); + tr("Inches"); } void EnumPropItem::setPropertyEditorData(QWidget *propertyEditor, const QModelIndex &) const diff --git a/limereport/objectinspector/propertyItems/lrmarginpropitem.cpp b/limereport/objectinspector/propertyItems/lrmarginpropitem.cpp new file mode 100644 index 0000000..66bbc25 --- /dev/null +++ b/limereport/objectinspector/propertyItems/lrmarginpropitem.cpp @@ -0,0 +1,102 @@ +#include "lrmarginpropitem.h" +#include +#include +#include "lrbasedesignintf.h" + +namespace { + LimeReport::ObjectPropItem * createMarginPropItem( + QObject *object, LimeReport::ObjectPropItem::ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& data, LimeReport::ObjectPropItem* parent, bool readonly) + { + return new LimeReport::MarginPropItem(object, objects, name, displayName, data, parent, readonly); + } + bool VARIABLE_IS_NOT_USED registredTopMargin = LimeReport::ObjectPropFactory::instance().registerCreator( + LimeReport::APropIdent("topMargin","LimeReport::PageItemDesignIntf"), + QObject::tr("margin"),createMarginPropItem + ); + bool VARIABLE_IS_NOT_USED registredRightMargin = LimeReport::ObjectPropFactory::instance().registerCreator( + LimeReport::APropIdent("rightMargin","LimeReport::PageItemDesignIntf"), + QObject::tr("margin"),createMarginPropItem + ); + bool VARIABLE_IS_NOT_USED registredBottomMargin = LimeReport::ObjectPropFactory::instance().registerCreator( + LimeReport::APropIdent("bottomMargin","LimeReport::PageItemDesignIntf"), + QObject::tr("margin"),createMarginPropItem + ); + bool VARIABLE_IS_NOT_USED registredLeftMargin = LimeReport::ObjectPropFactory::instance().registerCreator( + LimeReport::APropIdent("leftMargin","LimeReport::PageItemDesignIntf"), + QObject::tr("margin"),createMarginPropItem + ); +} + +namespace LimeReport{ + + +QString MarginPropItem::displayValue() const +{ + LimeReport::BaseDesignIntf * item = dynamic_cast(object()); + switch (item->unitType()) { + case LimeReport::BaseDesignIntf::Millimeters: + + return QString("%1 %2").arg(propertyValue().toDouble(), 0, 'f', 2) + .arg(QObject::tr("mm")); + case LimeReport::BaseDesignIntf::Inches: + return QString("%1 %2").arg((propertyValue().toDouble() * Const::mmFACTOR) / (item->unitFactor() * 10), 0, 'f', 2) + .arg(QObject::tr("''")); + } +} + +QWidget *MarginPropItem::createProperyEditor(QWidget *parent) const +{ + QDoubleSpinBox *editor= new QDoubleSpinBox(parent); + editor->setMaximum(std::numeric_limits::max()); + editor->setMinimum(std::numeric_limits::max()*-1); + editor->setSuffix(" "+unitShortName()); + return editor; +} + +void MarginPropItem::setPropertyEditorData(QWidget *propertyEditor, const QModelIndex &) const +{ + QDoubleSpinBox *editor =qobject_cast(propertyEditor); + editor->setValue(valueInUnits(propertyValue().toReal())); +} + +void MarginPropItem::setModelData(QWidget *propertyEditor, QAbstractItemModel *model, const QModelIndex &index) +{ + model->setData(index, valueInReportUnits(qobject_cast(propertyEditor)->value())); + setValueToObject(propertyName(), propertyValue()); +} + +qreal MarginPropItem::valueInUnits(qreal value) const +{ + BaseDesignIntf* item = dynamic_cast(object()); + switch (item->unitType()) { + case LimeReport::BaseDesignIntf::Millimeters: + return value; + case LimeReport::BaseDesignIntf::Inches: + return (value * Const::mmFACTOR) / (item->unitFactor() * 10); + } +} + +qreal MarginPropItem::valueInReportUnits(qreal value) const +{ + BaseDesignIntf* item = dynamic_cast(object()); + switch (item->unitType()) { + case LimeReport::BaseDesignIntf::Millimeters: + return value; + case LimeReport::BaseDesignIntf::Inches: + return (value * (item->unitFactor() * 10)) / Const::mmFACTOR; + + } +} + +QString MarginPropItem::unitShortName() const +{ + BaseDesignIntf* item = dynamic_cast(object()); + switch (item->unitType()) { + case LimeReport::BaseDesignIntf::Millimeters: + return QObject::tr("mm"); + case LimeReport::BaseDesignIntf::Inches: + return QObject::tr("''"); + } +} + +} // namespace LimeReport diff --git a/limereport/objectinspector/propertyItems/lrmarginpropitem.h b/limereport/objectinspector/propertyItems/lrmarginpropitem.h new file mode 100644 index 0000000..f511ce1 --- /dev/null +++ b/limereport/objectinspector/propertyItems/lrmarginpropitem.h @@ -0,0 +1,28 @@ +#ifndef LRMARGINPROPITEM_H +#define LRMARGINPROPITEM_H + +#include "lrobjectpropitem.h" + +namespace LimeReport { + +class MarginPropItem : public ObjectPropItem +{ + Q_OBJECT +public: + MarginPropItem():ObjectPropItem(){} + MarginPropItem(QObject* object, ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& value,ObjectPropItem* parent, bool readonly) + :ObjectPropItem(object, objects, name, displayName, value, parent, readonly){} + QString displayValue() const; + QWidget* createProperyEditor(QWidget *parent) const; + void setPropertyEditorData(QWidget * propertyEditor, const QModelIndex &) const; + void setModelData(QWidget * propertyEditor, QAbstractItemModel * model, const QModelIndex & index); +private: + qreal valueInUnits(qreal value) const; + qreal valueInReportUnits(qreal value) const; + QString unitShortName() const; +}; + +} // namespace LimeReport + + +#endif // LRMARGINPROPITEM_H diff --git a/limereport/objectinspector/propertyItems/lrqrealpropitem.cpp b/limereport/objectinspector/propertyItems/lrqrealpropitem.cpp index 096c91d..2d27868 100644 --- a/limereport/objectinspector/propertyItems/lrqrealpropitem.cpp +++ b/limereport/objectinspector/propertyItems/lrqrealpropitem.cpp @@ -38,8 +38,9 @@ namespace{ { return new LimeReport::QRealPropItem(object, objects, name, displayName, data, parent, readonly); } + bool VARIABLE_IS_NOT_USED registred = LimeReport::ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("qreal",""),QObject::tr("qreal"),createQRealPropItem); - bool VARIABLE_IS_NOT_USED registredDouble = LimeReport::ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("double",""),QObject::tr("qreal"),createQRealPropItem); + bool VARIABLE_IS_NOT_USED registredDouble = LimeReport::ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("double",""),QObject::tr("qreal"),createQRealPropItem); } namespace LimeReport{ @@ -61,7 +62,6 @@ void QRealPropItem::setPropertyEditorData(QWidget *propertyEditor, const QModelI void QRealPropItem::setModelData(QWidget *propertyEditor, QAbstractItemModel *model, const QModelIndex &index) { model->setData(index,qobject_cast(propertyEditor)->value()); - //object()->setProperty(propertyName().toLatin1(),propertyValue()); setValueToObject(propertyName(),propertyValue()); } diff --git a/limereport/objectinspector/propertyItems/lrqrealpropitem.h b/limereport/objectinspector/propertyItems/lrqrealpropitem.h index d06872f..c8a2616 100644 --- a/limereport/objectinspector/propertyItems/lrqrealpropitem.h +++ b/limereport/objectinspector/propertyItems/lrqrealpropitem.h @@ -47,6 +47,4 @@ public: }; } - - #endif // LRQREALPROPITEM_H diff --git a/limereport/objectinspector/propertyItems/lrrectproptem.cpp b/limereport/objectinspector/propertyItems/lrrectproptem.cpp index 638dcab..5d2d13b 100644 --- a/limereport/objectinspector/propertyItems/lrrectproptem.cpp +++ b/limereport/objectinspector/propertyItems/lrrectproptem.cpp @@ -45,14 +45,14 @@ namespace{ ){ return new LimeReport::RectPropItem(object, objects, name, displayName, data, parent, readonly); } - LimeReport::ObjectPropItem * createReqtMMItem( + LimeReport::ObjectPropItem * createReqtUnitItem( QObject*object, LimeReport::ObjectPropItem::ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& data, LimeReport::ObjectPropItem* parent, bool readonly ){ - return new LimeReport::RectMMPropItem(object, objects, name, displayName, data, parent, readonly); + return new LimeReport::RectUnitPropItem(object, objects, name, displayName, data, parent, readonly); } bool VARIABLE_IS_NOT_USED registredRectProp = LimeReport::ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("QRect",""),QObject::tr("QRect"),createReqtItem); bool VARIABLE_IS_NOT_USED registredRectFProp = LimeReport::ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("QRectF",""),QObject::tr("QRectF"),createReqtItem); - bool VARIABLE_IS_NOT_USED registredRectMMProp = LimeReport::ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("geometry","LimeReport::BaseDesignIntf"),QObject::tr("geometry"),createReqtMMItem); + bool VARIABLE_IS_NOT_USED registredRectMMProp = LimeReport::ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("geometry","LimeReport::BaseDesignIntf"),QObject::tr("geometry"),createReqtUnitItem); } namespace LimeReport{ @@ -63,9 +63,8 @@ template QString rectToString(T rect) } QRectF modifyRect(QRectF rect, const QString& name, qreal itemValue){ - - if (name=="x"){qreal width=rect.width(); rect.setX(itemValue);rect.setWidth(width);} - if (name=="y"){qreal heigh=rect.height(); rect.setY(itemValue);rect.setHeight(heigh);} + if (name=="x"){qreal width=rect.width(); rect.setX(itemValue); rect.setWidth(width);} + if (name=="y"){qreal heigh=rect.height(); rect.setY(itemValue); rect.setHeight(heigh);} if (name=="height"){rect.setHeight(itemValue);} if (name=="width"){rect.setWidth(itemValue);} @@ -89,118 +88,153 @@ QString LimeReport::RectPropItem::displayValue() const switch(propertyValue().type()){ case QVariant::Rect: return rectToString(propertyValue().toRect()); - break; case QVariant::RectF: return rectToString(propertyValue().toRect()); - break; default : return ObjectPropItem::displayValue(); - } } -LimeReport::RectMMPropItem::RectMMPropItem(QObject *object, ObjectsList* objects, const QString &name, const QString &displayName, const QVariant &value, ObjectPropItem *parent, bool /*readonly*/): +LimeReport::RectUnitPropItem::RectUnitPropItem(QObject *object, ObjectsList* objects, const QString &name, const QString &displayName, const QVariant &value, ObjectPropItem *parent, bool /*readonly*/): ObjectPropItem(object, objects, name, displayName, value,parent) { - QRectF rect=value.toRect(); + QRectF rect= value.toRect(); LimeReport::BandDesignIntf* band = dynamic_cast(object); - LimeReport::PageItemDesignIntf *page = dynamic_cast(object); - if(band){ - this->appendItem(new LimeReport::RectMMValuePropItem(object, objects, "x","x",rect.x()/10,this,true)); - this->appendItem(new LimeReport::RectMMValuePropItem(object, objects, "y","y",rect.y()/10,this,true)); - this->appendItem(new LimeReport::RectMMValuePropItem(object, objects, "width",tr("width"), rect.width()/10,this,true)); - this->appendItem(new LimeReport::RectMMValuePropItem(object, objects, "height",tr("height"), rect.height()/10,this,false)); - } else if(page){ - this->appendItem(new LimeReport::RectMMValuePropItem(object, 0, "x","x",rect.x()/10,this,true)); - this->appendItem(new LimeReport::RectMMValuePropItem(object, 0, "y","y",rect.y()/10,this,true)); - this->appendItem(new LimeReport::RectMMValuePropItem(object, 0,"width", tr("width"), rect.width()/10,this,false)); - this->appendItem(new LimeReport::RectMMValuePropItem(object, 0, "height", tr("height"), rect.height()/10,this,false)); + LimeReport::PageItemDesignIntf* page = dynamic_cast(object); + LimeReport::BaseDesignIntf* item = dynamic_cast(object); + + if (band){ + this->appendItem(new LimeReport::RectUnitValuePropItem(object, objects, "x", "x", rect.x(), this, true)); + this->appendItem(new LimeReport::RectUnitValuePropItem(object, objects, "y", "y", rect.y(), this, true)); + this->appendItem(new LimeReport::RectUnitValuePropItem(object, objects, "width", tr("width"), rect.width(), this, true)); + this->appendItem(new LimeReport::RectUnitValuePropItem(object, objects, "height", tr("height"), rect.height(), this, false)); + } else if (page){ + this->appendItem(new LimeReport::RectUnitValuePropItem(object, 0, "x", "x", rect.x(), this, true)); + this->appendItem(new LimeReport::RectUnitValuePropItem(object, 0, "y", "y",rect.y(), this, true)); + this->appendItem(new LimeReport::RectUnitValuePropItem(object, 0,"width", tr("width"), rect.width(), this, false)); + this->appendItem(new LimeReport::RectUnitValuePropItem(object, 0, "height", tr("height"), rect.height(), this, false)); } else { - this->appendItem(new LimeReport::RectMMValuePropItem(object, objects, "x","x",rect.x()/10,this,false)); - this->appendItem(new LimeReport::RectMMValuePropItem(object, objects, "y","y",rect.y()/10,this,false)); - this->appendItem(new LimeReport::RectMMValuePropItem(object, objects, "width", tr("width"), rect.width()/10,this,false)); - this->appendItem(new LimeReport::RectMMValuePropItem(object, objects, "height", tr("height"), rect.height()/10,this,false)); + this->appendItem(new LimeReport::RectUnitValuePropItem(object, objects, "x", "x", rect.x(), this, false)); + this->appendItem(new LimeReport::RectUnitValuePropItem(object, objects, "y", "y", rect.y(), this, false)); + this->appendItem(new LimeReport::RectUnitValuePropItem(object, objects, "width", tr("width"), rect.width(), this, false)); + this->appendItem(new LimeReport::RectUnitValuePropItem(object, objects, "height", tr("height"), rect.height(), this, false)); } - LimeReport::BaseDesignIntf * item = dynamic_cast(object); + if (item){ connect(item,SIGNAL(geometryChanged(QObject*,QRectF,QRectF)),this,SLOT(itemGeometryChanged(QObject*,QRectF,QRectF))); connect(item,SIGNAL(posChanged(QObject*,QPointF,QPointF)),this,SLOT(itemPosChanged(QObject*,QPointF,QPointF))); + connect(item,SIGNAL(posChanging(QObject*,QPointF,QPointF)),this,SLOT(itemPosChanged(QObject*,QPointF,QPointF))); } } -QString LimeReport::RectMMPropItem::displayValue() const +QString LimeReport::RectUnitPropItem::displayValue() const { - QRectF rect = propertyValue().toRectF(); - return QString("[%1,%2] %3x%4 mm") - .arg(rect.x()/10,0,'f',2) - .arg(rect.y()/10,0,'f',2) - .arg(rect.width()/10,0,'f',2) - .arg(rect.height()/10,0,'f',2); + QRectF rect = rectInUnits(propertyValue().toRectF()); + return QString("[%1,%2] %3x%4 %5") + .arg(rect.x(), 0, 'f', 2) + .arg(rect.y(), 0,'f', 2) + .arg(rect.width(), 0, 'f', 2) + .arg(rect.height(), 0, 'f', 2) + .arg(unitShortName()); } -LimeReport::RectMMValuePropItem::RectMMValuePropItem(QObject *object, ObjectsList* objects, const QString &name, const QString &displayName, const QVariant &value, ObjectPropItem *parent, bool readonly +LimeReport::RectUnitValuePropItem::RectUnitValuePropItem(QObject *object, ObjectsList* objects, const QString &name, const QString &displayName, const QVariant &value, ObjectPropItem *parent, bool readonly ):ObjectPropItem(object, objects, name, displayName, value,parent,readonly){} -QWidget * LimeReport::RectMMValuePropItem::createProperyEditor(QWidget *parent) const +QWidget * LimeReport::RectUnitValuePropItem::createProperyEditor(QWidget *parent) const { QDoubleSpinBox *editor= new QDoubleSpinBox(parent); editor->setMaximum(100000); - editor->setSuffix(" mm"); + editor->setSuffix(" "+unitShortName()); + BaseDesignIntf* item = dynamic_cast(object()); return editor; } -void LimeReport::RectMMValuePropItem::setPropertyEditorData(QWidget *propertyEditor, const QModelIndex &) const +void LimeReport::RectUnitValuePropItem::setPropertyEditorData(QWidget *propertyEditor, const QModelIndex &) const { QDoubleSpinBox *editor = qobject_cast(propertyEditor); - editor->setValue(propertyValue().toDouble()); + editor->setValue(valueInUnits(propertyValue().toReal())); } -void LimeReport::RectMMValuePropItem::setModelData(QWidget *propertyEditor, QAbstractItemModel *model, const QModelIndex &index) +void LimeReport::RectUnitValuePropItem::setModelData(QWidget *propertyEditor, QAbstractItemModel *model, const QModelIndex &index) { - model->setData(index,qobject_cast(propertyEditor)->value()); + model->setData(index,valueInReportUnits(qobject_cast(propertyEditor)->value())); QRectF rect=object()->property(parent()->propertyName().toLatin1()).toRectF(); - object()->setProperty(parent()->propertyName().toLatin1(),modifyRect(rect,propertyName(),propertyValue().toReal()*10)); + object()->setProperty(parent()->propertyName().toLatin1(), modifyRect(rect, propertyName(), propertyValue().toReal())); } -QString LimeReport::RectMMValuePropItem::displayValue() const +qreal LimeReport::RectUnitValuePropItem::valueInUnits(qreal value) const { - return QString::number(propertyValue().toReal())+" "+QObject::tr("mm"); -} - -void LimeReport::RectMMPropItem::itemPosChanged(QObject* /*object*/, QPointF newPos, QPointF oldPos) -{ - if (newPos.x()!=oldPos.x()){ - setValue("x",newPos.x()); - } - if (newPos.y()!=oldPos.y()){ - setValue("y",newPos.y()); + BaseDesignIntf* item = dynamic_cast(object()); + switch (item->unitType()) { + case LimeReport::BaseDesignIntf::Millimeters: + return value / item->unitFactor(); + case LimeReport::BaseDesignIntf::Inches: + return value / (item->unitFactor() * 10); } } -void LimeReport::RectMMPropItem::itemGeometryChanged(QObject * /*object*/, QRectF newGeometry, QRectF oldGeometry) +qreal LimeReport::RectUnitValuePropItem::valueInReportUnits(qreal value) const { - if (newGeometry.x()!=oldGeometry.x()){ - setValue("x",newGeometry.x()); - } - if (newGeometry.y()!=oldGeometry.y()){ - setValue("y",newGeometry.y()); - } - if (newGeometry.width()!=oldGeometry.width()){ - setValue("width",newGeometry.width()); - } - if (newGeometry.height()!=oldGeometry.height()){ - setValue("height",newGeometry.height()); + BaseDesignIntf* item = dynamic_cast(object()); + switch (item->unitType()) { + case LimeReport::BaseDesignIntf::Millimeters: + return value * item->unitFactor(); + case LimeReport::BaseDesignIntf::Inches: + return value * (item->unitFactor() * 10); } } -void LimeReport::RectMMPropItem::setValue(const QString &name, qreal value) +QString LimeReport::RectUnitValuePropItem::unitShortName() const { - if (name!=""){ + BaseDesignIntf* item = dynamic_cast(object()); + switch (item->unitType()) { + case LimeReport::BaseDesignIntf::Millimeters: + return QObject::tr("mm"); + case LimeReport::BaseDesignIntf::Inches: + return QObject::tr("''"); + } +} + +QString LimeReport::RectUnitValuePropItem::displayValue() const +{ + return QString("%1 %2").arg(valueInUnits(propertyValue().toReal()), 0, 'f', 2).arg(unitShortName()); +} + +void LimeReport::RectUnitPropItem::itemPosChanged(QObject* /*object*/, QPointF newPos, QPointF oldPos) +{ + if (newPos.x() != oldPos.x()){ + setValue("x", newPos.x()); + } + if (newPos.y() != oldPos.y()){ + setValue("y", newPos.y()); + } +} + +void LimeReport::RectUnitPropItem::itemGeometryChanged(QObject * /*object*/, QRectF newGeometry, QRectF oldGeometry) +{ + if (newGeometry.x() != oldGeometry.x()){ + setValue("x", newGeometry.x()); + } + if (newGeometry.y() != oldGeometry.y()){ + setValue("y", newGeometry.y()); + } + if (newGeometry.width() != oldGeometry.width()){ + setValue("width", newGeometry.width()); + } + if (newGeometry.height() != oldGeometry.height()){ + setValue("height", newGeometry.height()); + } +} + +void LimeReport::RectUnitPropItem::setValue(const QString &name, qreal value) +{ + if (name != ""){ LimeReport::ObjectPropItem* propItem = findChild(name); if (propItem) { - propItem->setPropertyValue(value/10); - setPropertyValue(LimeReport::modifyRect(propertyValue().toRectF(),name,value)); - LimeReport::QObjectPropertyModel *itemModel=dynamic_cast(model()); + propItem->setPropertyValue(value); + setPropertyValue(LimeReport::modifyRect(propertyValue().toRectF(), name, value)); + LimeReport::QObjectPropertyModel *itemModel = dynamic_cast(model()); if (itemModel) { itemModel->itemDataChanged(modelIndex()); if (propItem->modelIndex().isValid()) @@ -209,3 +243,31 @@ void LimeReport::RectMMPropItem::setValue(const QString &name, qreal value) } } } + +QRectF LimeReport::RectUnitPropItem::rectInUnits(QRectF rect) const +{ + BaseDesignIntf* item = dynamic_cast(object()); + switch (item->unitType()) { + case LimeReport::BaseDesignIntf::Millimeters: + return QRectF(rect.x() / item->unitFactor(), + rect.y() / item->unitFactor(), + rect.width() / item->unitFactor(), + rect.height() / item->unitFactor()); + case LimeReport::BaseDesignIntf::Inches: + return QRectF(rect.x() / (item->unitFactor() * 10), + rect.y() / (item->unitFactor() * 10), + rect.width() / (item->unitFactor() * 10), + rect.height() / (item->unitFactor() * 10)); + } +} + +QString LimeReport::RectUnitPropItem::unitShortName() const +{ + BaseDesignIntf* item = dynamic_cast(object()); + switch (item->unitType()) { + case LimeReport::BaseDesignIntf::Millimeters: + return QObject::tr("mm"); + case LimeReport::BaseDesignIntf::Inches: + return QObject::tr("''"); + } +} diff --git a/limereport/objectinspector/propertyItems/lrrectproptem.h b/limereport/objectinspector/propertyItems/lrrectproptem.h index 64d8d78..bd6915c 100644 --- a/limereport/objectinspector/propertyItems/lrrectproptem.h +++ b/limereport/objectinspector/propertyItems/lrrectproptem.h @@ -43,28 +43,35 @@ public: QString displayValue() const; }; -class RectMMPropItem : public ObjectPropItem{ +class RectUnitPropItem : public ObjectPropItem{ Q_OBJECT public: - RectMMPropItem():ObjectPropItem(){} - RectMMPropItem(QObject *object, ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& value, ObjectPropItem* parent, bool readonly=true); + RectUnitPropItem():ObjectPropItem(){} + RectUnitPropItem(QObject *object, ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& value, ObjectPropItem* parent, bool readonly=true); QString displayValue() const; public slots: void itemPosChanged(QObject* /*object*/, QPointF newPos, QPointF oldPos); void itemGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); private: - void setValue(const QString& propertyName, qreal propertyValue); + void setValue(const QString& propertyName, qreal propertyValue); + QRectF rectInUnits(QRectF rect) const; + QString unitShortName() const; }; -class RectMMValuePropItem : public ObjectPropItem{ +class RectUnitValuePropItem : public ObjectPropItem{ Q_OBJECT public: - RectMMValuePropItem():ObjectPropItem(){} - RectMMValuePropItem(QObject *object, ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& value, ObjectPropItem* parent, bool readonly ); + RectUnitValuePropItem():ObjectPropItem(){} + RectUnitValuePropItem(QObject *object, ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& value, ObjectPropItem* parent, bool readonly ); QString displayValue() const; QWidget* createProperyEditor(QWidget *) const; void setPropertyEditorData(QWidget *, const QModelIndex &) const; void setModelData(QWidget *, QAbstractItemModel *, const QModelIndex &); +private: + qreal valueInUnits(qreal value) const; + qreal valueInReportUnits(qreal value) const; + QString unitShortName() const; + }; } diff --git a/translations/limereport_ru.qm b/translations/limereport_ru.qm index 09d747fdbe26bd02019e13a453cff90be9979da7..3ce791a78c782c75fd3bb2702eeadd125a7c7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iuZTVM{l3Rk6aG6G+HiC8AmIW4wjBY2gz*FcqhhF3wEZ9mbsVk`j`xSJ(_@*$h za4kuXgD|)seLtm17+l~&TIeA-r=0*i-9IU-&2ZiEaf0_GTk@*%)jWat*g-Wfyn*J6F6pX(lXU2K zQLYM=3K|uB07~cTxX{ct?U8rIC*BPhHelV{(IvYsP#{=gTxMoX*!+>Bf?!E2A`n zo(58iFq*l0Q)m*KtkK#UlRkxMwC<#9VIM^n_0r7Cj00TyQ?opu3~sYpv!ankKU}2I zt)Lt#xUD(7?jJga+h~psxohMsf++OoL>9YhUY?{eAra=&A3KIdCK~G#jnP%9H|dOyj6Sm~ z-fySZ495vv>Ln+fkh*d`I_Mjm@hR%ZxuOq~TKzkY*1P?VM+- zK5nN^UX3x5wr1nzFV;@dE?XKHGwW*i+YTitleAlignCenter Название по центру + + Millimeters + Миллиметры + + + Inches + Дюймы + LimeReport::FlagsPropItem @@ -1939,9 +1947,13 @@ p, li { white-space: pre-wrap; } option3 + + units + Единицы измерения + - LimeReport::RectMMPropItem + LimeReport::RectPropItem width ширина @@ -1952,7 +1964,7 @@ p, li { white-space: pre-wrap; } - LimeReport::RectPropItem + LimeReport::RectUnitPropItem width ширина @@ -3098,5 +3110,13 @@ This preview is no longer valid. Default По умолчанию + + margin + Поля + + + '' + +