title: QListWidgetItem - adjust width and height to content
body: <p>I have got a <code>QListWidgetItem</code>, which has a <code>QWidget</code> and some <code>QLabels</code>. The height of the labels (<code>imageLabel</code>, <code>titleLabel</code> and <code>descriptionLabel</code>) varies depending on the text length. So does the height of the QWidget, which leds to different sizes in <code>QListWidgetItem</code>. So far the parameters for <code>setSizeHint</code> are static:</p>
  
  <pre><code>QListWidgetItem* listWidgetItem = new QListWidgetItem();
  listWidgetItem-&gt;setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
  listWidgetItem-&gt;setSizeHint(200, 180));
  
  QWidget* widget = new QWidget();
  
  QVBoxLayout* rootLayout = new QVBoxLayout();
  rootLayout-&gt;setAlignment(Qt::AlignTop);
  
  QHBoxLayout* contentLayout = new QHBoxLayout();
  contentLayout-&gt;setAlignment(Qt::AlignLeft);
  
  QLabel* imageLabel = new QLabel();
  imageLabel-&gt;setPixmap(pixmap);
  
  contentLayout-&gt;addWidget(imageLabel, 0, Qt::AlignTop);
  
  QVBoxLayout* informationLayout = new QVBoxLayout();
  informationLayout-&gt;setAlignment(Qt::AlignTop);
  
  QLabel* titleLabel = new QLabel("&lt;b&gt;" + title  + "&lt;/b&gt;");
  titleLabel-&gt;setWordWrap(true);
  informationLayout-&gt;addWidget(titleLabel);
  
  QLabel* descriptionLabel = new QLabel(description);
  descriptionLabel-&gt;setWordWrap(true);
  informationLayout-&gt;addWidget(descriptionLabel);
  
  QLabel* dateLabel = new QLabel(date.toString());
  informationLayout-&gt;addWidget(dateLabel);
  
  contentLayout-&gt;addLayout(informationLayout);
  
  rootLayout-&gt;addLayout(contentLayout);
  
  QHBoxLayout* buttonLayout = new QHBoxLayout();
  QPushButton* buttonOne = new QPushButton(tr("Button 1"));
  QObject::connect(buttonOne, SIGNAL(clicked()), mButtonOneSignalMapper, SLOT(map()));
  mButtonOneSignalMapper-&gt;setMapping(buttonOne, index);
  buttonLayout-&gt;addWidget(buttonOne);
  
  QPushButton* buttonTwo = new QPushButton(tr("Button 2"));
  QObject::connect(buttonTwo, SIGNAL(clicked()), mButtonTwoSignalMapper, SLOT(map()));
  mButtonTwoSignalMapper-&gt;setMapping(buttonTwo, index);
  buttonLayout-&gt;addWidget(buttonTwo);
  
  rootLayout-&gt;addLayout(buttonLayout);
  
  widget-&gt;setLayout(rootLayout);
  
  mListWidget-&gt;addItem(listWidgetItem);
  mListWidget-&gt;setItemWidget(listWidgetItem, widget);
  </code></pre>
  
  <p>Is there any way to properly set the <code>sizeHint</code> regarding the width and height of the displayed content used in the <code>QLabels</code> of the <code>QWidget</code>?</p>
  
  <p>For instance the first <code>QListWidgetItem</code> may have a <code>descriptionLabel</code> with a text length of 300 characters and the second <code>QListWidgetItem</code> may have a <code>descriptionLabel</code> with a text length of 1000 characters. So far both <code>QListWidgetItems</code> will have the same size (200px width and 180px height). While it may fit on the first <code>QListWidgetItem</code>, because it has only 300 characters, it may not fit on the second <code>QListWidgetItem</code>, because of the 1000 characters. Therefore I would like to somehow dynamically adjust the size of the <code>QListWidgetItem</code> regarding the needed space (first one will need less than the second one).</p>