title: How do I convert QMap<QString, QMap<QString, int> > to a QVariant?
body: <p><code>QVariant</code> (needed for <code>QSettings</code> class) supports creation from <code>QMap&lt;QString, QVariant&gt;</code></p>
  
  <p>But trying to initialise something like this:</p>
  
  <pre><code>QMap&lt;QString, QVariant(QMap&lt;QString, QVariant&gt;)&gt; i;
  </code></pre>
  
  <p>Gives the error:</p>
  
  <blockquote>
    <p>function returning a function.</p>
  </blockquote>
  
  <p>So then I tried the <code>QMap&lt;QString, QVariant&gt;</code> overload for <code>QVariant()</code> and got</p>
  
  <blockquote>
    <p>error: no matching function for call to <code>QVariant::QVariant(QMap&lt;QString, QMap&lt;QString, int&gt; &gt;&amp;)</code></p>
  </blockquote>
  
  <p>Now I tried a typecast:</p>
  
  <pre><code>QMap&lt;QString, (QVariant)QMap&lt;QString, QVariant&gt; &gt; i;
  </code></pre>
  
  <p>and got </p>
  
  <blockquote>
    <p>template argument 2 is invalid<br>
    invalid type in declaration before '<code>;</code>' token</p>
  </blockquote>
  
  <p>So what's the required voodoo to convert a nested <code>QMap</code> to a <code>QVariant</code> object?</p>