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.

inside custom component

Native Development

Reply
Trusted Contributor
AllSystemGo
Posts: 140
Registered: ‎11-23-2010
My Device: Torch 9800
My Carrier: Rogers
Accepted Solution

QSettings question

[ Edited ]

Let say my setting file is empty. If I do that

 

QSettings settings;

qDebug() << settings.value("test").isNull();


 This returns True

 

Then if I do

 

settings.setValue("Test", "");

 

The file insert the value, Test=

 

so If I reroll my first condition I get False now.

 

Is it me that doens't understand something or the behavior is wrong?

 

Thank you

 

UPDATE: If I remove the = at the end of Test then it returns True.

Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: QSettings question

Do you still have an issue?

You edited the question and I'm not sure if that means you found the solution or were trying to clarify -- but I don't see an "=" so if you have a question, please restate it.

 

There is also Qt documentation for QSettings: http://qt-project.org/doc/qt-4.8/qsettings.html#details

 

Stuart

Please use plain text.
Trusted Contributor
AllSystemGo
Posts: 140
Registered: ‎11-23-2010
My Device: Torch 9800
My Carrier: Rogers

Re: QSettings question

What I could do is remove the key and probably the isNull() is going to work instead of setting the value to "". I'll give it a try
Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: QSettings question

Yes -- "" is a valid value.

 

Stuart

Please use plain text.
Trusted Contributor
AllSystemGo
Posts: 140
Registered: ‎11-23-2010
My Device: Torch 9800
My Carrier: Rogers

Re: QSettings question

OK thank you
Please use plain text.