Results 1 to 6 of 6

Thread: QSettings problem!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    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 problem!

    Works fine for me...

    Qt Code:
    1. #include <QSettings>
    2. #include <QString>
    3. #include <QtDebug>
    4.  
    5. int main(int argc, char **argv){
    6. QSettings settings("test.ini", QSettings::IniFormat);
    7. QString *str = new QString;
    8. if(argc<2){
    9. *str = "xyz";
    10. settings.setValue("test", *str);
    11. } else {
    12. *str = settings.value("test").toString();
    13. qDebug() << *str;
    14. }
    15. return 0;
    16. }
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    0xl33t (28th July 2009)

Similar Threads

  1. Very strange socket programming problem
    By montylee in forum Qt Programming
    Replies: 5
    Last Post: 11th November 2008, 13:05
  2. deployment problem: msvc++ 2008 Express, Qt 4.4.3
    By vonCZ in forum Qt Programming
    Replies: 7
    Last Post: 10th November 2008, 15:38
  3. Problem with QSettings
    By arbi in forum Qt Programming
    Replies: 2
    Last Post: 24th September 2008, 09:49
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 13:45
  5. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 22:36

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.