Results 1 to 2 of 2

Thread: QSettings inserts "phantom" data

  1. #1
    Join Date
    Feb 2011
    Posts
    16
    Qt products
    Qt5
    Platforms
    Windows

    Default QSettings inserts "phantom" data

    Hi,

    I have the problem that QSettings creates data which doesn't exist. I save my settings with the following function:

    Qt Code:
    1. void MainWindow::writeSettings() {
    2. settings->setValue("LastDB", db->getDbName());
    3. settings->setValue("Window/Size", size());
    4. settings->setValue("Window/Maximize", isMaximized());
    5. }
    To copy to clipboard, switch view to plain text mode 

    But the QMap, which is delivert to the write function contains the following data:

    Qt Code:
    1. ( "LastDB", QVariant(QString, "F:/Develop/YAMDB/movie.yamdb") )
    2. ( "LastDB/Window/Maximize" , QVariant(QString, "false") )
    3. ( "Window/Maximize" , QVariant(bool, false) )
    4. ( "Window/Size" , QVariant(QSize, QSize(900, 650) ) )
    5. )
    To copy to clipboard, switch view to plain text mode 

    Where does the value "LastDB/Window/Maximize" came from

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSettings inserts "phantom" data

    Are you sure there are no OLD wrong values in you Settings?
    Print settings content before writeSettings().
    A camel can go 14 days without drink,
    I can't!!!

Similar Threads

  1. Replies: 1
    Last Post: 12th October 2010, 14:45
  2. Replies: 1
    Last Post: 7th April 2010, 21:46
  3. Replies: 3
    Last Post: 25th August 2009, 13:03
  4. QSettings to save multiple "workspaces"
    By Bitruder in forum Qt Programming
    Replies: 1
    Last Post: 13th May 2009, 21:56
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

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.