Okay here is a first implementation which doesn't seem to work as expected :

Qt Code:
  1. ZeParagraphWidget::ZeParagraphWidget(const QString & string,
  2. QWidget *parent) :
  3. QTextEdit("", parent)
  4. {
  5. // Size policy
  6. QSizePolicy localSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  7. setSizePolicy(localSizePolicy);
  8.  
  9. setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  10. setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  11. }
  12.  
  13. void ZeParagraphWidget::setText(const QString & text)
  14. {
  15. ZeLog::get()->Print("ZeParagraphWidget - setText\n");
  16.  
  17. QTextEdit::setText(text);
  18.  
  19. updateGeometry();
  20. }
  21.  
  22. /* virtual */ QSize ZeParagraphWidget::sizeHint() const
  23. {
  24. QSize sizeRect(document()->idealWidth(), document()->size().height());
  25.  
  26. return sizeRect;
  27. }
To copy to clipboard, switch view to plain text mode 
By default the box is way to large, and the width doesn't fit the text.
I'm not sure about the size policy too.