Results 1 to 2 of 2

Thread: How to compute a number with string of operation in QML

  1. #1
    Join Date
    Aug 2012
    Posts
    23
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default How to compute a number with string of operation in QML

    Hi,

    Is this possible to do a mathematical computation with a number and a string of expression??
    for example I used a string variable like
    Qt Code:
    1. property string user_script: "*1"
    To copy to clipboard, switch view to plain text mode 

    can i compute this string to a number variable?

    Thanks in advance

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to compute a number with string of operation in QML

    Do you need to convert string to int? If so use parseInt, parseFloat functions.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. The following user says thank you to spirit for this useful post:

    nestuser (20th September 2012)

Similar Threads

  1. Get string buy its number
    By TJSonic in forum Newbie
    Replies: 5
    Last Post: 2nd November 2010, 15:48
  2. Replies: 1
    Last Post: 22nd July 2010, 18:12
  3. Compute the area under a curve
    By giusepped in forum Qwt
    Replies: 0
    Last Post: 26th December 2008, 07:56
  4. how to format a number into a const width string ?
    By lovelypp in forum Qt Programming
    Replies: 3
    Last Post: 25th July 2008, 22:45
  5. Converting number to string.
    By safknw in forum Newbie
    Replies: 2
    Last Post: 18th September 2006, 13:12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.