×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    2

    onChecked QML Switch Element

    Hello,
    please how I can use the signal like "onChecked" with QML Switch Element?


    Code:
    Switch {
                         id: switcher
                         checked: true
                         onChecked: if(checked){
                                       doSomeThing();
                                    }
                                    else{
                                        doOtherThing();
                                    }
                     }
    the code above doesn't work with Symbian Belle neither with MeeGo Harmattan, please correct me the code above to work with Symbian (com.nokia.symbian 1.1) and MeeGo (com.nokia.meego 1.1).

    Thank you

  2. #2
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: onChecked QML Switch Element

    Hi,

    The below works fine with Meego

    Code:
        Switch {
                             id: switcher
                             checked: true
    
                             onCheckedChanged:
                              if(checked){
                                            console.log("hello");
                                        }
                                        else{
                                            console.log("hi");
                                        }
                         }
    onCheckedChanged makes the difference.

    For symbian -
    Code:
        Switch {
            id: switcher
        }
        Text {
            text: switcher.checked ? "Switched on" : "Switched off"
        }
    In symbian for some reason Clicked signal doesnt work, could not set checked property too.
    Last edited by kusumk; 2012-02-22 at 05:22. Reason: added symbian details

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2011
    Posts
    9

    Re: onChecked QML Switch Element

    you can also use onClicked signal for Symbian.
    hope Qt Team fix the onCheckedChanged signal for Symbian
    Last edited by aymen.ka; 2012-02-22 at 19:24.

  4. #4
    Registered User
    Join Date
    Feb 2012
    Posts
    2

    Re: onChecked QML Switch Element

    Thank you very much

  5. #5
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: onChecked QML Switch Element

    has anyone filed that as bug to https://bugreports.qt-project.org/?

Similar Threads

  1. Replies: 2
    Last Post: 2009-04-24, 04:19
  2. XML Element tag name
    By mariadlangeles in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2009-01-06, 13:04
  3. timer switch off or switch on (n95 8g)
    By xiangqiuzhao in forum Symbian
    Replies: 2
    Last Post: 2008-10-20, 04:10
  4. Circuit Switch & Packet Switch at the same time on Series60 Platform
    By TrickLo in forum Symbian Networking & Messaging (Closed)
    Replies: 9
    Last Post: 2006-04-09, 15:36
  5. DO element
    By choscos in forum Browsing and Mark-ups
    Replies: 4
    Last Post: 2004-08-10, 14:01

Posting Permissions

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