title: QListView with custom item => mouse events are propagated
body: <p>I would like to use a QListView with custom widgets that contain QSlider and QSpinBox widgets.
  I succeeded in creating the QListView with a new custom item delegate that displays the custom widgets but the mouse events are not propagated to the custom widgets.</p>
  
  <p>It's not possible to slide the QSlider or change the value of the QSpinBox. The user can not interact with the items.</p>
  
  <p>I'm new to Qt and I guess it's because the custom widgets are not children of the list view. I tried to associate the widgets to the list view (in the item delegate constructor) but that does not work.</p>
  
  <p>I also tried to propagate the item delegate's events to the widgets using the QWidget::event() functions, but that does not work.</p>
  
  <p>Does any one have an idea ?</p>
  
  <p>Here is the custom widget :</p>
  
  <p><img src="https://i.stack.imgur.com/0A5SC.jpg" alt=""></p>
  
  <p>Here is the QListView displaying the custom widget :</p>
  
  <p><img src="https://i.stack.imgur.com/OECoM.jpg" alt=""></p>
  
  <p>Here is the code of my custom item delegate :</p>
  
  <pre><code>#include &lt;QPainter&gt;
  #include "layeritemwidgetdelegate.h"
  #include "../../libs/debug/debug.h"
  
  LayerItemWidgetDelegate::LayerItemWidgetDelegate( QObject *ptParent ) :
      QItemDelegate( ptParent ),
      m_ptItemWidget( new LayerItemWidget() )
  {
  }
  
  LayerItemWidgetDelegate::~LayerItemWidgetDelegate()
  {
      delete m_ptItemWidget;
  }
  
  void LayerItemWidgetDelegate::paint( QPainter *ptPainter, const QStyleOptionViewItem &amp;tOption, const QModelIndex &amp;tIndex ) const
  {
      QPalette tPalette;
  
      //  Resize the item widget
      m_ptItemWidget-&gt;resize( tOption.rect.size() );
  
      // Change the background color of the widget if it is selected.
      if( QStyle::State_Selected == ( tOption.state &amp; QStyle::State_Selected ) )
          tPalette.setBrush( QPalette::Window, QBrush( QColor( Qt::lightGray ) ) );
      else
          tPalette.setBrush( QPalette::Window, QBrush( QColor( Qt::transparent ) ) );
      m_ptItemWidget-&gt;setPalette( tPalette );
  
      //  Paint the widget
      ptPainter-&gt;save();
      ptPainter-&gt;translate( tOption.rect.topLeft() );
      m_ptItemWidget-&gt;render( ptPainter );
      ptPainter-&gt;restore();
  }
  
  QSize LayerItemWidgetDelegate::sizeHint(const QStyleOptionViewItem &amp;tOption, const QModelIndex &amp;tIndex) const
  {
      Q_UNUSED( tOption )
      Q_UNUSED( tIndex )
      return QSize( m_ptItemWidget-&gt;minimumWidth(), m_ptItemWidget-&gt;height() );
  }
  
  bool LayerItemWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &amp;option, const QModelIndex &amp;index)
  {
      m_ptItemWidget-&gt;propagateEvent(event);
      m_ptItemWidget-&gt;setEnabled( true );
      DEBUG_MESSAGE( "EVENT" );
  }
  </code></pre>