title: QList/QHash store abstract elements
body: <p>I'd like to store in <code>QHash</code> elements that inherits from one class. So I've got:</p>
  
  <pre><code>class ImageInterface
  {
  public:
      ImageInterface();
      ImageInterface(const QString&amp; path);
      virtual QString getName() const = 0;
  };
  </code></pre>
  
  <p>And implementation:</p>
  
  <pre><code>class Image : public ImageInterface
  {
  public:
      Image();
      Image(const QString&amp; path);
      QString getName() const { return name; }
  
  private:
      QString name;
  };
  </code></pre>
  
  <p>Then I want to use it in <code>QHash</code>:</p>
  
  <pre><code>QHash&lt;QString, ImageInterface&gt; *imageMap;
  imageMap = new QHash&lt;QString, ImageInterface&gt;();
  ImageInterface *im = new Image(var);
  imageMap-&gt;insert(im-&gt;getName(), *im);
  imageMap-&gt;take(name);
  </code></pre>
  
  <p>There are errors.</p>
  
  <pre><code>    ../EmulatorKamery/mainwindow.cpp:59:28: error: cannot allocate an object of abstract type ‘ImageInterface’
      ../EmulatorKamery/imageinterface.h:8:11: note:   because the following virtual functions are pure within ‘ImageInterface’:
      ../EmulatorKamery/imageinterface.h:13:25: note:     virtual QString ImageInterface::getName() const
      In file included from /usr/include/qt4/QtCore/qvariant.h:50:0,
                       from /usr/include/qt4/QtCore/qabstractitemmodel.h:45,
                       from /usr/include/qt4/QtGui/qabstractitemview.h:46,
                       from /usr/include/qt4/QtGui/qlistview.h:45,
                       from /usr/include/qt4/QtGui/qlistwidget.h:45,
                       from /usr/include/qt4/QtGui/QListWidget:1,
                       from ../EmulatorKamery/mainwindow.h:5,
                       from ../EmulatorKamery/mainwindow.cpp:1:
      /usr/include/qt4/QtCore/qhash.h: At global scope:
      /usr/include/qt4/QtCore/qhash.h: In instantiation of ‘QHashNode&lt;QString, ImageInterface&gt;’:
      /usr/include/qt4/QtCore/qhash.h:765:9:   instantiated from ‘QHash&lt;K, V&gt;::iterator QHash&lt;K, V&gt;::insert(const Key&amp;, const T&amp;) [with Key = QString, T = ImageInterface]’
      ../EmulatorKamery/mainwindow.cpp:46:48:   instantiated from here
      /usr/include/qt4/QtCore/qhash.h:221:7: error: cannot declare field ‘QHashNode&lt;QString, ImageInterface&gt;::value’ to be of abstract type ‘ImageInterface’
      ../EmulatorKamery/imageinterface.h:8:11: note:   since type ‘ImageInterface’ has pure virtual functions
      /usr/include/qt4/QtCore/qhash.h: In member function ‘T QHash&lt;K, V&gt;::take(const Key&amp;) [with Key = QString, T = ImageInterface]’:
      ../EmulatorKamery/mainwindow.cpp:59:28:   instantiated from here
      /usr/include/qt4/QtCore/qhash.h:805:24: error: invalid abstract return type for member function ‘T QHash&lt;K, V&gt;::take(const Key&amp;) [with Key = QString, T = ImageInterface]’
      ../EmulatorKamery/imageinterface.h:8:11: note:   since type ‘ImageInterface’ has pure virtual functions
      ../EmulatorKamery/mainwindow.cpp:59:28:   instantiated from here
      /usr/include/qt4/QtCore/qhash.h:808:18: error: cannot allocate an object of abstract type ‘ImageInterface’
      ../EmulatorKamery/imageinterface.h:8:11: note:   since type ‘ImageInterface’ has pure virtual functions
      /usr/include/qt4/QtCore/qhash.h:813:24: error: cannot allocate an object of abstract type ‘ImageInterface’
      ../EmulatorKamery/imageinterface.h:8:11: note:   since type ‘ImageInterface’ has pure virtual functions
      /usr/include/qt4/QtCore/qhash.h:813:11: error: cannot declare variable ‘t’ to be of abstract type ‘ImageInterface’
      ../EmulatorKamery/imageinterface.h:8:11: note:   since type ‘ImageInterface’ has pure virtual functions
      ../EmulatorKamery/mainwindow.cpp:59:28:   instantiated from here
      /usr/include/qt4/QtCore/qhash.h:819:16: error: cannot allocate an object of abstract type ‘ImageInterface’
      ../EmulatorKamery/imageinterface.h:8:11: note:   since type ‘ImageInterface’ has pure virtual functions
      /usr/include/qt4/QtCore/qhash.h:821:14: error: cannot allocate an object of abstract type ‘ImageInterface’
      ../EmulatorKamery/imageinterface.h:8:11: note:   since type ‘ImageInterface’ has pure virtual functions
      /usr/include/qt4/QtCore/qhash.h:822:1: warning: control reaches end of non-void function [-Wreturn-type]
  </code></pre>
  
  <p>How should I implemented something like this?</p>