Add EnterKey.onClicked to property list in SailfishOS SDK

asked 2013-12-31 14:51:24 +0200

Mariusmssj gravatar image

TextField does work with EnterKey.onClicked when deployed but the SDK sees it as "Invalid property name 'EnterKey'.(m16) "

I want to change that property from a function but I can't as it's not there for TextField, I tried to set a property but it wouldn't work as the SDK can't see EnterKey.onClicked .

So I would recomend adding EnterKey.onClicked to TextField property list

edit retag flag offensive close delete

Comments

No sure what you want todo, but I use:

 Keys.onReturnPressed: {
                entryUser.focus = true;
            }

because I did now about EnterKey.onClicked maybe it deprecated?

mike7b4 ( 2013-12-31 20:49:30 +0200 )edit

I want to change the state of TextField from a function. Essentially depending on what user picked I would change on what the focus would be changed after the press of enter key.

Mariusmssj ( 2013-12-31 21:12:01 +0200 )edit

How about doing a function with the EnterKey.onClicked, for example:

ComboBox { id: comboBox }
TextField {
    EnterKey.onClicked: {
        if (comboBox.currentIndex == 0)
            // ...
       else if (...)
           // ...
    }
}
Dickson ( 2014-01-01 19:23:44 +0200 )edit