title: How to access the QListWidget or QListWidgetItem from a QAbstractItemDelegate
body: <p>Is this even possible in Qt? I have a QListWidget setup with a delegate for specific painting, and I'm attempting to have the delegate paint differently based on variables in my QListWidget's parent. I figure I can rig something up as long as I have a pointer to either, but I need to somehow get them while in the delegate's paint(). </p>
  
  <p>I've tried the "hack" to store a pointer in a QVariant, but it doesn't seem to be working, and I'd rather not take this approach. If I could get to the pointer to item the delegate represents, and just call item->listWidget(), this would be perfect, but it doesn't seem possible while inside the delegate.</p>
  
  <p>Is there any workaround to accomplish this? </p>
  
  <p>Also, just because.. sample of trying to get the void* trick to work - if this is the only way to do this, perhaps someone may see what I have wrong in it.</p>
  
  <pre><code>//Parent of QListWidget
  ....
  QListWidgetItem *item = new QListWidgetItem();
  ....
  QVariant v = qVariantFromValue((void *) pStitchSymbolCustom);
  item-&gt;setData(Qt::UserRole + 6, v);
  ....
  
  
  //Implemented QAbstractItemDelegate
  ....
  MyClass* p_pointer = 
      (MyClass*)(index.data(Qt::UserRole + 6).value&lt;void *&gt;());
  </code></pre>