LimeReport Forum

General Category | Основное => Discussion | Обсуждение => Topic started by: seetharaman on July 19, 2016, 03:04:39 PM

Title: Change width in TextItem
Post by: seetharaman on July 19, 2016, 03:04:39 PM
how to change width in textitem ?

Example

THIS.width=40;
Title: Re: Change width in TextItem
Post by: Subst on July 20, 2016, 12:54:06 PM
may be by using script engine?

it's like the ecma-262, i.e. JS & so

http://www.ecma-international.org/ecma-262/7.0/
Title: Re: Change width in TextItem
Post by: Arin Alex on July 21, 2016, 12:33:38 AM
I've added method setItemWidth and setItemHeight to TextItem.
You can use like this $S{THIS.setItemWidth(40)}
I can't add it as a property for some reason
Title: Re: Change width in TextItem
Post by: seetharaman on July 21, 2016, 07:56:36 AM
thank you very much
Title: Re: Change width in TextItem
Post by: seetharaman on July 21, 2016, 08:52:17 AM
Its Return Some error message.
and attached my file

TypeError:Result of expression 'THIS.setItemWidth' [undefined] is not a function

[вложение удалено администратором]
Title: Re: Change width in TextItem
Post by: Arin Alex on July 21, 2016, 10:10:11 AM
Did you get the latest source from github ? I added this function after your message.
Title: Re: Change width in TextItem
Post by: seetharaman on July 21, 2016, 11:51:35 AM
it's work properly .

is designer open sourced? if so, where to find source code?
Title: Re: Change width in TextItem
Post by: Arin Alex on July 21, 2016, 12:51:24 PM
I've pushed it to githib.
Title: Re: Change width in TextItem
Post by: seetharaman on July 21, 2016, 12:58:00 PM
thank you very much
Title: Re: Change width in TextItem
Post by: Muthu Samy on July 25, 2016, 06:47:15 AM
Feature request: Simalarly, functions needed for setting x & y positions of an Item..

Alternatively, we can make QRectF new-able from script (similar to QColor, so that a QRectF can be assigned to Geometry property)
Title: Re: Change width in TextItem
Post by: Arin Alex on July 25, 2016, 03:30:54 PM
I added next functions to Item :
    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);