Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
Zmey
Posts: 883
Registered: ‎12-18-2012

Re: QSettings Drop Down Saving Selected Index

[ Edited ]

I was wrong about "new TestApp(&app)" line - it was perfectly fine. Updated the post.

 

 

I've tried to run the project on device & checked the logs:

 

Dec 31 05:34:38.515 [...] bb::cascades::QmlDocument: error when loading QML from: QUrl( "file:///apps/[...]/main.qml" )
Dec 31 05:34:38.517 [...] assets//main.qml:39:21: Cannot assign to non-existent property "selectedIndexChanged"
selectedIndexChanged: {
^)

 

Then changed "selectedIndexChanged: {" to "onSelectedIndexChanged: {"

 

Also replaced

                        _TestApp.saveValueFor(style.objectName, style.getSelectedIndex())

with:

                        _TestApp.saveValueFor(style.objectName, style.selectedIndex)

When using properties in QML "get" is usually omitted.

 

Now it works! State is saved. :smileyhappy:

 

To check the logs in Target Navigator View right click on device; "Launch SSH session", then run:

slog2info -w

or, to filter spam:

slog2info -w | grep someString

 

Please use plain text.
Developer
mapleleafs90
Posts: 371
Registered: ‎02-12-2011
My Carrier: Wind Mobile

Re: QSettings Drop Down Saving Selected Index

Great, thanks!

 

I wish in qml when you hit the '.' it would show a list of the the possible options rather than me trying to guess. Also wish it would underline these errors.

Please use plain text.