Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User pizarro84's Avatar
    Join Date
    Apr 2012
    Posts
    24
    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 gaba88's Avatar
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,701
    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 Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,712
    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 pizarro84's Avatar
    Join Date
    Apr 2012
    Posts
    24
    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 gaba88's Avatar
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,701
    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 pizarro84's Avatar
    Join Date
    Apr 2012
    Posts
    24
    Oh I see, thanks! will try that asap

  7. #7
    Registered User francesco_it's Avatar
    Join Date
    Jan 2012
    Posts
    33
    I would use a signal so onForcedUpdateY you do y = x

  8. #8
    Registered User yasirnoor21's Avatar
    Join Date
    Apr 2012
    Posts
    6
    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 C++
    Replies: 2
    Last Post: 2010-10-22, 13:27
  2. how to set Property ?
    By locomotive84 in forum Symbian C++
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved