title: Can't add items to QMap
body: <p>I have a problem. I assume I'm doing something really dumb. I'm new to C++ and Qt.</p>
  
  <p>I have a class SavedVar. I'm trying to add a key/value to a private member Qmap. When I call SavedVar::addVar(), the program crashes. SavedVar::addvar() is receiving 'id' and 'notes' correctly.</p>
  
  <pre><code>#include &lt;QObject&gt;
  #include &lt;QMap&gt;
  #include "variation.h"
  #include &lt;QTableWidget&gt;
  #include "mainwindow.h"
  
  class SavedVar : public QObject
  {
      Q_OBJECT
  public:
      explicit SavedVar(QObject *parent = 0);
      void addVar(QString id, QString notes);
      void saveVar(QString varText );
      void removeSavedVar(QList &lt;QTableWidgetItem*&gt;  &amp;varList);
      QString generateSaveFile();
      void loadVarFile(QString filename);
      const QMap&lt;QString, QString&gt;*getVmapPtr();
  
  private:
      QMap &lt;QString, QString&gt;  vmap; 
  
  }; 
  
  void SavedVar::addVar(QString id, QString notes)
  {
      vmap[id]= notes;
  }
  </code></pre>
  
  <p>I'm struggling to understand the debug output in Qt creator:</p>
  
  <pre><code>0   QBasicAtomicInt::operator!= qbasicatomic.h  75  0x4116e3    
  1   QMap&lt;QString, QString&gt;::detach  qmap.h  202 0x41ede2    
  2   QMap&lt;QString, QString&gt;::operator[]  qmap.h  526 0x41d241    
  3   SavedVar::addVar    savedvar.cpp    17  0x44afc9    
  4   SavedVar::loadVarFile   savedvar.cpp    82  0x44b4b8    
  5   MainWindow::load_data   mainwindow.cpp  190 0x40d5fe
  </code></pre>
  
  <p>Cheers,</p>
  
  <p>Neil    </p>