Good day.

I have an application that has its own settings file, which I generate with Qt and load with Qt. I am using QSettings::IniFormat, because i want to be able to change these settings by hand if needed.
Qt Code:
  1. new QSettings("myconfig.cfg", QSettings::IniFormat);
To copy to clipboard, switch view to plain text mode 
It works like a charm, the only problem is when i do a setValue() with a QVariantList that only has one value.
My QVariantLists QVariants are all QRects.

e.g: When the list contains two rectangles,
Qt Code:
  1. QList<QRect> testList;
  2. testList.append(QRect(0,0,1,1));
  3. testList.append(QRect(1,1,1,1));
  4.  
  5. QList<QVariant> variantList;
  6. foreach(QRect rect, testList)
  7. {
  8. variantList.append(rect);
  9. }
  10.  
  11. m_settings->setValue(QString("rememberRectList"), variantList);
To copy to clipboard, switch view to plain text mode 

the configuration file's entry looks ok:
rememberRectList=@Rect(0 0 1 1), @Rect(1 1 1 1)
But, when the list contains only a single entry:
Qt Code:
  1. ...
  2. QList<QRect> testList;
  3. testList.append(QRect(0,0,1,1));
  4.  
  5. QList<QVariant> variantList;
  6. foreach(QRect rect, testList)
  7. {
  8. variantList.append(rect);
  9. }
  10.  
  11. m_settings->setValue(QString("rememberRectList"), variantList);
  12. ...
To copy to clipboard, switch view to plain text mode 

I get this:
rememberRectList=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\ x13\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0)
I am wondering if this is a bug or am I doing something wrong.

Thank you.