Results 1 to 3 of 3

Thread: Strore Boolean value

  1. #1
    Join Date
    May 2009
    Posts
    94
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Post Strore Boolean value

    I know how to store QString.But how can we store boolean value using QSettings?

  2. #2
    Join Date
    Aug 2008
    Posts
    134
    Thanks
    10
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Strore Boolean value

    you can use QString::number(boolean value)

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Strore Boolean value

    Quote Originally Posted by bismitapadhy View Post
    I know how to store QString.But how can we store boolean value using QSettings?
    the same way!
    Qt Code:
    1. bool b = false;
    2. QSettings settings;
    3. settings.setValue("bool", b);
    4. //...
    5. b = settings.value("bool").toBool();
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. boolean field checkbox QTableView
    By skuda in forum Qt Programming
    Replies: 4
    Last Post: 8th November 2010, 13:48
  2. [delegate] wrong commit for boolean
    By lauranger in forum Qt Programming
    Replies: 3
    Last Post: 26th October 2006, 08:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.