title: QT Text Edit/Text Browser dynamic height
body: <p>I am very new to QT, I have created a a GUI application which has the following code:</p>
  
  <p><strong>mainwindow.h</strong></p>
  
  <pre><code>#ifndef MAINWINDOW_H
  #define MAINWINDOW_H
  
  #include &lt;QMainWindow&gt;
  
  namespace Ui {
  class MainWindow;
  }
  
  class MainWindow : public QMainWindow
  {
      Q_OBJECT
  
  public:
      explicit MainWindow(QWidget *parent = 0);
      ~MainWindow();
  
  private:
      Ui::MainWindow *ui;
  };
  
  #endif // MAINWINDOW_H
  </code></pre>
  
  <p><strong>main.cpp</strong></p>
  
  <pre><code>#include "mainwindow.h"
  #include &lt;QApplication&gt;
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      MainWindow w;
      w.show();
  
      return a.exec();
  }
  </code></pre>
  
  <p><strong>mainwindow.cpp</strong></p>
  
  <pre><code>#include "mainwindow.h"
  #include "ui_mainwindow.h"
  
  MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
  {
      ui-&gt;setupUi(this);
  }
  
  MainWindow::~MainWindow()
  {
      delete ui;
  }
  </code></pre>
  
  <p>Using the designer I have made a textEdit in a form layout. When I have too much content in the textEdit it makes a scroll bar instead of adjusting the size to the content.</p>
  
  <p>I have googled like a mad, but all the answers I have found was way above my level so I simply didnt understand them. I want to achieve this very badly since is the core of my gui.</p>
  
  <p>Thanks in advance</p>