×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    24

    assigning a property value without binding the property

    Hi, I am new to developing applications using QML and I am developing a mobile game as my capstone project for school. I recently encountered a problem with assigning values to a property: how do I get the value of a property and assign it to another property without referencing it? Thanks advance

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: assigning a property value without binding the property

    Hello pizarro84

    i will be more interested to know how you are doing it.

    Other wise its quite simple item.property = anything.

  3. #3
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,179

    Re: assigning a property value without binding the property

    yep, with properties, with Objects you would find it bit harder. You could either do it in multiline (f.ex Coordinate you would set values separately for latitude & longitude) .

    Note that this might mean that some change signals might fire multiple times, and to avoid such a thing, you could also construct new objects with Qt.createQmlObject, for more information see: http://doc.qt.nokia.com/4.7-snapshot...icobjects.html

  4. #4
    Registered User
    Join Date
    Apr 2012
    Posts
    24

    Re: assigning a property value without binding the property

    Thanks very much for the quick reply! Actually what I want to happen here is:

    x = 20

    y = x

    I want to assign 20 to y without binding x so when x changes to 25, y remains 20. Is it possible?

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: assigning a property value without binding the property

    i will say dont declare y as a property instead make y something as a javascript global variable and than i guess x will not update y until you explicitly do that.

  6. #6
    Registered User
    Join Date
    Apr 2012
    Posts
    24

    Re: assigning a property value without binding the property

    Oh I see, thanks! will try that asap

  7. #7
    Registered User
    Join Date
    Jan 2012
    Posts
    33

    Re: assigning a property value without binding the property

    I would use a signal so onForcedUpdateY you do y = x

  8. #8
    Registered User
    Join Date
    Apr 2012
    Posts
    6

    Re: assigning a property value without binding the property

    hi well lets say that you want a=b without binding a to b there is two ways (1) if you want to make a=b in a signal (clicked for examble) you say"onclicked:{a=b;a=a} ” a=a will breack the binding right after giving a the value of b (2) if you wanted to make a=b in the start you say "a:b ; Timer{running:true;repeat:false;interval:1;ontriggerd:a=a}

Similar Threads

  1. help in property of message please
    By snicker..doodle in forum Symbian
    Replies: 2
    Last Post: 2010-10-22, 13:27
  2. how to set Property ?
    By locomotive84 in forum Symbian
    Replies: 13
    Last Post: 2010-09-15, 11:23
  3. S40 JAD property?
    By raorq in forum Mobile Java General
    Replies: 5
    Last Post: 2009-04-18, 05:26
  4. There is no property with the name ExtendedKey in [CS3,FL2]
    By viswa08 in forum [Archived] Flash Lite on Nokia Devices
    Replies: 1
    Last Post: 2008-09-19, 12:44
  5. jad website property?
    By pjohnsen in forum Mobile Java General
    Replies: 0
    Last Post: 2004-04-07, 15:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×