Results 1 to 14 of 14

Thread: QSettings

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QSettings

    Quote Originally Posted by incapacitant
    QSettings is initialised here :
    Qt Code:
    1. ApplicationWindow::ApplicationWindow()
    2. : QMainWindow( 0 )
    3. {
    4. QCoreApplication::setOrganizationName("Adrien");
    5. QCoreApplication::setApplicationName("EFREI SMS");
    6. QSettings settings("efrei.ini", QSettings::IniFormat);
    To copy to clipboard, switch view to plain text mode 
    This is a local variable, not the member of the class.


    If I declare in private :
    QSettings settings("efrei.ini", QSettings::IniFormat);
    instead of
    QSettings settings;
    the compiler does not accept it.
    Of course, this would be invalid.
    Try this:
    Qt Code:
    1. QCoreApplication::setOrganizationName("Adrien"); // you should put that in main.cpp
    2. QCoreApplication::setApplicationName("EFREI SMS"); // and this too
    3. //...
    4. ApplicationWindow::ApplicationWindow()
    5. : QMainWindow( 0 ), settings("efrei.ini", QSettings::IniFormat)
    6. {
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to wysota for this useful post:

    incapacitant (25th May 2006)

  3. #2
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    106

    Default QSettings

    It works and I meet you I will ask for a brain transplant.

Similar Threads

  1. QSettings vs (QFile + Qtextstream)
    By nupul in forum Newbie
    Replies: 5
    Last Post: 10th April 2006, 08:26
  2. Replies: 4
    Last Post: 1st February 2006, 18:17
  3. QSettings again ... how to remove array elements
    By Mike in forum Qt Programming
    Replies: 4
    Last Post: 11th January 2006, 09:58
  4. QSettings - beginReadArray not working
    By Mike in forum Qt Programming
    Replies: 7
    Last Post: 9th January 2006, 22:24

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.