title: Write QList of QPair to a QSettings object
body: <p>I have a list of integer pairs that I want to store in a persistent way, using Qt Framework.</p>
  
  <p>I thought of using <code>QList&lt; QPair &lt; int,int&gt;&gt;</code> as type for the list and to store them on an .ini file using <code>QSettings</code>. </p>
  
  <p>Unfortunately, the function <code>QSettings::setValue</code> raises an error: </p>
  
  <pre><code>no matching function for call to ‘QSettings::setValue(const char [19], FavoriteList&amp;)’
  note:   no known conversion for argument 2 from QList&lt; QPair&lt; int, int&gt; &gt; to ‘const QVariant&amp;’
  </code></pre>
  
  <p>It seems that it cannot cast that type to a <code>QVariant</code>. I tried declaring it with <code>Q_DECLARE_METATYPE</code> but it didn't work, it raises the same error.</p>
  
  <p>How can I write that type to a <code>QSettings</code> object?</p>
  
  <p>EDIT: Example of code that fails:</p>
  
  <pre><code>QList&lt;QPair&lt;int,int&gt;&gt; list;
  
  if(!settings.contains("Radio/Favorites/FM"))
  {
      settings.setValue("Radio/Favorites/FM", list);
  }
  </code></pre>