title: QMap and QPair, C++, Qt
body: <p>I want to make a data structure for accessing strings by two ways:</p>
  
  <ol>
  <li>Access by ID</li>
  <li>Access by name</li>
  </ol>
  
  <p>My first idea is using two maps for each method but it leads to duplication of data:</p>
  
  <pre><code>QMap&lt;int, QString&gt; accessById;
  QMap&lt;QString, QString&gt; accessByName;
  </code></pre>
  
  <p>I'm searching for a better way, something like this:</p>
  
  <pre><code>QMap&lt;QPair&lt;int, QString&gt;, QString&gt; multiAccess;
  </code></pre>
  
  <p>but it can not help me (at least I don't know how to do it), because searching in a map needs to know ID and name together. How can I define a well structure of Qt classes to achive my goal?</p>
  
  <p><em>No external libraries, but Qt</em></p>