I've got a QTextEdit inside a sub-class of QWidget. I just want to display some simple (rich) text. I'd like the QTextEdit to scale to it's contents and the window around it around it to scale too.

Qt Code:
  1. class MyThing: public QWidget
  2. {
  3. MyThing(QWidget* parent = 0);
  4. //...etc
  5.  
  6. private:
  7. QTextEdit* txtEdit;
  8. }
  9. //the constructor
  10. MyThing(QWidget *parent): QWidget (parent)
  11. {
  12. txtEdit= new QTextEdit(this) ;
  13. QWidget::setFixedSize(txtEdit->sizeHint());
  14. }
To copy to clipboard, switch view to plain text mode 
I think the problem is that txtEdit->sizeHint() is not influenced by the (small) amount of text in the QTextEdit. Is there any way of telling QTextEdit to occupy the minimum space possible for the given text formatting?

thanks
K