×

Discussion Board

Results 1 to 5 of 5

Hybrid View

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    5

    Question How to send a property to another qml file?

    I am new to QML, and start to work on the first few apps for symbian.

    The simple app would consist of 2 qml pages:
    The first qml page would include a tumbler element for the user to select a value. Then, I will use the selected value to generate a URL and open it in a webview in the second qml page.

    My problem is after I generated the URL in a property string in the first qml, how can I get the string to send to the 2nd qml page?

    Seems simple step, but I really cannot figure it out in the Wiki. Thanks for your help in advance!

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2012
    Posts
    55

    Re: How to send a property to another qml file?

    How are you handling the pages? If you are using the pageStack you can try passing the string in a property as described here.

    Br,
    Villep

  3. #3
    Registered User
    Join Date
    Nov 2011
    Posts
    5

    Re: How to send a property to another qml file?

    Thanks for the tips!

    I try it with PageStackWindow, and try to pass the string using the code below:

    pageStack.push(Qt.resolvedUrl("page2.qml"), {message: window.url="http://www.example.com"+firstTumbler})


    but I have got an error while running the app:
    file:///C:/QtSDK/Simulator/Qt/mingw/imports/com/nokia/symbian.1.1/PageStack.js:153: Error: Cannot assign to non-existent property "message"

    Any hints? Do I have to declare the property url in the pagestackwindow, page1, and page2?

  4. #4
    Nokia Developer Expert
    Join Date
    Jun 2012
    Posts
    55

    Re: How to send a property to another qml file?

    All you need to do is declare the property message in page2.qml. You can rename the parameter as you wish, just make sure the property you use in pageStack.push is some existing property.
    For example in page2.qml
    Code:
    property string message: ""
    Br,
    Villep

  5. #5
    Registered User
    Join Date
    Nov 2011
    Posts
    5

    Re: How to send a property to another qml file?

    It is working now, thanks Villep!

Similar Threads

  1. Replies: 6
    Last Post: 2011-08-26, 09:05
  2. related to property file
    By sis1987 in forum Mobile Java General
    Replies: 1
    Last Post: 2008-08-27, 08:41
  3. Property/Config file
    By MananW in forum Symbian
    Replies: 1
    Last Post: 2007-01-15, 06:16
  4. Replies: 1
    Last Post: 2006-11-16, 19:51
  5. 3300 did not install property file in J2me
    By cyberstar_2001 in forum Mobile Java General
    Replies: 0
    Last Post: 2003-12-11, 03:38

Posting Permissions

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