Results 1 to 2 of 2

Thread: QTSettings with ini file format ignores first section unless preceded by comment

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2009
    Location
    Laval, France
    Posts
    124
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QTSettings with ini file format ignores first section unless preceded by comment

    Hi all,
    I am getting bizarre behaviour from QSettings
    I want to use it with an ini file.
    so I do something like this
    Qt Code:
    1. m_settings = new QSettings("settings.ini",QSettings::IniFormat);
    To copy to clipboard, switch view to plain text mode 
    Now if I have a first "section"( beginning with [Env]) then all settings in that section are ignored: reading with m_settings->value(...) returns the "fallback" value.
    The following sections are properly read however
    Now if I precede by first section with a comment starting with # then mysteriously all settings in that ini file are read properly.
    Is this a bug or a feature or is a Byte Order Mark doing its dirty work here?
    Last edited by feraudyh; 19th March 2014 at 18:32. Reason: make it clearer

Similar Threads

  1. QtSettings and QStringList
    By matsukan in forum Qt Programming
    Replies: 4
    Last Post: 24th February 2014, 20:51
  2. Replies: 2
    Last Post: 10th August 2011, 07:16
  3. Replies: 5
    Last Post: 1st June 2011, 08:28
  4. Qt Creator Comment Section
    By ToddAtWSU in forum Qt Tools
    Replies: 3
    Last Post: 6th February 2011, 21:01
  5. QMessageBox ignores nobr with rich text format
    By daggilli in forum Qt Programming
    Replies: 0
    Last Post: 14th October 2008, 03:54

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.