Bool becomes QString when QSettings load
I met a problem when storing bool values in QSettings. It looks like a bug to me, but maybe I'm missing something?
I have this piece of code:
QSettings* settings = new QSettings(); qDebug() << "test setting is of type " << settings->value("test", false).typeName(); settings->setValue("test", true);qDebug() << "now test setting is of type " << settings->value("test", false).typeName();
In the first round, it will print
test parameter is of type bool
test setting is now of type bool
After that, it will print
test parameter is of type QString
test setting is now of type bool
In the first round, there is no stored definition, it takes the default value spent, but after the setting has been set once, it seems that it is stored as a QString and load as a QString on the application next run.
It is ruin a lot of things especially during the passage of the QVariant to QML.
My ugly solution right now is to make a
settings->setValue('test', settings->value('test', false).toBool())
the launch for each Boolean parameter that I have.
Anyone else seeing this?
This behavior is expected although not very intuitive.
QSettings stores type information in ini files. Always ask the specific type when accessing QSetting using the. toBool(), toInt(), toString() etc.
I think it is more correct than the use of the workaround above because there is no guarantee on how QSettings stores data internally.
Tags: BlackBerry Developers
Similar Questions
-
Why 'options' to load when I load firefox?
Just upgraded to win 7 pro 10, need to know how to load my old Firefox data in this version, and also why does options happen when I load firefox?
You can check the setting of the home page to see if the subject: preferences page is added.
- Tools > Options > general > startup: Homepage
Firefox supports several home pages separated by ' |' symbol (pipe).
-
Can I stop a new tab to open on my home page when I load Firefox to my office?
When I load Mozilla Firefox my homepage loads OK but a new tab loads also with ' search or enter addresses in the space of the url where an address must be typed. When I click on the information on the general tab Page address for the new tab is chrome://ntsd-a/content/newtab/newtab.html. I don't want the new tab to load automatically. How can I stop this action?
Enter about: preferences in your search bar and check to see what your home page. back to the just in case where. Restart firefox to check if the tab opens.
Try firefox shift-click to launch. see if this tab always opens. If not, this means that there are a few add-on do this. Enter about: addons and see what addon could do that.
If she does not always just clear the cache or refresh firefox it should be resolved. -
Why do the topics become Chinese when I access my email via Firefox but not Internet Explorer?
Why do the topics become Chinese when I access my email via Firefox but not Internet Explorer?
Hello, this is a display caused the extension Advisor default McAfee site - please try to disable or remove that in case you have now until there's a mcafee update that may resolve the problem.
http://service.McAfee.com/faqdocument.aspx?ID=TS100162
https://community.McAfee.com/thread/76071 -
When firefox load it also load another tab for the search engine. How can I remove this where it will load only my start page?
You can check the setting of the home page and make sure that it doesn't have a leak ' |'.
Firefox supports several home pages separated by ' |' symbol.
- Tools > Options > general > startup: Homepage
- https://support.Mozilla.org/KB/how+to+set+the+home+page
-
When I load Gmail goes to Google Calendar
When I load Gmail it switches automatically to Google Calendar.
This has happened
Each time Firefox opened
Is a week ago
I followed the advice of war4peace on the removal of "Calendar" in the section of the integrated element of GMail. Seems to work fine now. Thank you!
-
I can't access Gmail because it shiftes on Calendar Page when I load Gmail
When I load my Gmail in Firefox 3.6.6 it changes automatically to the Calendar Page. I can't access my Gmail.
This has happened
Each time Firefox opened
== I opened my Gmail account
I have the same problem, it happens where ever I connect on Firefox, mobile professional or mobile home. One is Vista and the other Windows 7. I had to use Chrome to gmail.
-
a macbook pro with retina display becomes hot when in use?
A macbook pro with retina display becomes hot when in use?
Yes. All of the skin of the MBP is part of the evacuation of heat, not only the arriere-charniere event. That's why running the MBP on a hard flat surface is better, so the room air can cool down all surfaces. He put on a hidden or your knees when running may block exposure to air.
High intensity running video uses graphics and CPU harder, needing cooling.
-
When I load the cd and computer flash drive does not
Original title:
When I load cd computer not responding
When I put a flash drive into the computer, I got absolutely nothing. I know that flash player has information about it and yet the computer does not even recognize that it has received a flash drive. at this point if I wanted to reload the operating drive, it wouldn't work.
Hello
1. What is the number of brand and model of the computer?
2. you remember recent changes made on the computer before the show?
3. what version of the operating system is installed on your computer?
4. have you checked to go in Windows Explorer to check if the flash drive is displayed?
5 refer to only auto play you?
6. what exactly you're talking about when you say "at this stage if I wanted to reload the operating drive, it wouldn't?
7. you receive an error message?
8. are you booting from the DVD?
Method 1:
You can use the flash drive on a different port and then check if it works.
Method 2:
Run the fix it from the below link:
Your CD or DVD drive cannot read or write media.
http://support.Microsoft.com/mats/cd_dvd_drive_problems/en-usMethod 3:
You can consult the following link try the steps as indicated and check if it works.
http://Windows.Microsoft.com/en-us/Windows-Vista/tips-for-solving-problems-with-USB-devices
(It works for Windows 7 as well)
I hope this helps.
-
I try to play a game online game and when it loads it says that the firewall is bloacking it helped me
Hello
You can turn your firewall on and outside:
http://Windows.Microsoft.com/en-us/Windows-Vista/turn-Windows-Firewall-on-or-off
hope this helps,
B Eddie -
I have an ID card and valid windows xp disk - but when I loaded the xp I found myself with the bsod - I then replaced the HD with a new Seagate Barracuda 500 GB SATA3 and still have the same problem. -How can I have the disk corruption hard if I just installed a new.
BSOD reflects not only the problem of hard drive, but also other computer equipment. to help you, I need the message error on the BSOD
-
My computer crashes sometimes when windows loads up.
My computer sometimes freezes when it loads Windows. He can do it two or three times before it works. After that windows does not load it gives a message saying "a problem has been detected and windows has shut down to prevent damage to your computer. According to the report of error: Stop: 0x0000000A (0x0000001c, 0 x 00000000, 0 00000016, 0x804E1757). Event Viewer records the Source as 'Serious mistake', category 102 event 1003.
I am running XP, VERSION 2002, SP2.
http://support.Microsoft.com/kb/314063 MS - MVP - Elephant Boy computers - don't panic!
-
Why should I manually start the Security Center when windows loads
When the load windows vista, I get a warning "check your Security Center.
I have to then turn manual Security Center. Why?Hello
1 are logged as administrator?
2 How long have you been faced with the question?
3. do you have security software installed on the computer?
4 did you a recent software or changes to the material on the computer?
I suggest you to go through the steps mentioned in the article and the Coachman.
Windows Firewall is turned off every time I start my computer
http://TechNet.Microsoft.com/en-us/library/cc749262 (v = ws.10)
See also:
Using Windows Security Center
http://Windows.Microsoft.com/en-us/Windows-Vista/using-Windows-Security-Center
Disable Security Center alerts
http://Windows.Microsoft.com/en-us/Windows-Vista/turn-off-Security-Center-alerts
Hope this helps and keep us informed if you need help.
-
When windows loads, I'm unable to load my side administrator, I get a message that does not load safe mode profile side administrator but will not load completely when in safe mode message cannot load all of the side admin suggestions am running Vista Basic
Hi BillyM1948,
(1) would you please provide the full error message that you receive?
(2) remember to make changes to the computer before this problem?
Step 1: You can follow the steps mentioned in the article below, which deals with a similar question
Error message when you log a computer Windows Vista-based or Windows 7 by using a temporary profile: "the user profile Service has no logon. Unable to load the user profile.
http://support.Microsoft.com/kb/947215
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:
How to back up and restore the registry in Windows
http://support.Microsoft.com/kb/322756/Thank you, and in what concerns:
Ajay K
Microsoft Answers Support Engineer
Visit our Microsoft answers feedback Forum and let us know what you think.
-
Please help, when I load programs such as a text and other programs, I get this message to appear. Ive seen other posts like this, but people put on a record of syswow32 which I have or something like that. I would very much apreciate if you helped.
Average of the program are not compatible win7
Maybe you are looking for
-
After the most recent upgrade, Firefox will not start
I've just updated Firefox to the latest version. Firefox does not start now. I get no error message. I navigated to the Mozilla Firefox folder and tried to run to that from this site and that doesn't work anymore.Thank youCalvin
-
HP DeskJet Ink Advantage 4535: HP DeskJet Ink Advantage 4535 error Code
Hello I tried to connect my printer to the new wifi and on the printer, the message of this code was displayed. You have no idea where is the problem? I rebooted the wifi router, but the result was the same. I thank very you much. Jan
-
Change the color of track between the sliders?
I tried to figure this out, but nothing helped. Here's what I would do: I use the cursors on a XY trace to read information only between the sliders for additional data (made with property nodes and base Subvi I wrote to print the table of points be
-
Please help... I tried to connect my computer to my BT homehub but can't... my computer does not have an installed wireless adapter and I want to know if I can buy one or what else can I do... coming exams and need my computer... Help, please!
-
White box of "Windows features"
When I opened the box "Turn on or off windows features", I get a box empty or empty, so I can not install other features of windows, such as standard games for windows... How can I fix this. Running Windows 7 Pro 64-bit