From 30a662db0cb987a42ebc6beab07213080c26005f Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Mon, 25 Jul 2016 15:16:21 +0300 Subject: [PATCH] Item position Q_INVOKABLE functions have been added --- limereport/lrbasedesignintf.cpp | 32 ++++++++++++++++++++++++++++++++ limereport/lrbasedesignintf.h | 6 ++++++ 2 files changed, 38 insertions(+) diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp index 5353440..60d8af1 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -203,6 +203,38 @@ QString BaseDesignIntf::setItemHeight(qreal height) return QString(); } +qreal BaseDesignIntf::getItemWidth() +{ + return width() / mmFactor(); +} + +qreal BaseDesignIntf::getItemHeight() +{ + return height() / mmFactor(); +} + +qreal BaseDesignIntf::getItemPosX() +{ + return x() / mmFactor(); +} + +qreal BaseDesignIntf::getItemPosY() +{ + return y() / mmFactor(); +} + +QString BaseDesignIntf::setItemPosX(qreal xValue) +{ + setItemPos(xValue * mmFactor(),y()); + return QString(); +} + +QString BaseDesignIntf::setItemPosY(qreal yValue) +{ + setItemPos(x(),yValue * mmFactor()); + return QString(); +} + QFont BaseDesignIntf::transformToSceneFont(const QFont& value) const { QFont f = value; diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index bb93d23..0a8bfcd 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -251,6 +251,12 @@ public: Q_INVOKABLE QString setItemWidth(qreal width); Q_INVOKABLE QString setItemHeight(qreal height); + Q_INVOKABLE qreal getItemWidth(); + Q_INVOKABLE qreal getItemHeight(); + Q_INVOKABLE qreal getItemPosX(); + Q_INVOKABLE qreal getItemPosY(); + Q_INVOKABLE QString setItemPosX(qreal xValue); + Q_INVOKABLE QString setItemPosY(qreal yValue); protected: //ICollectionContainer