Ok but you did it with Designer. In my case, I can't... Here's all my code for this part, do you see any mistakes? Would you have done it differently?
Qt Code:
  1. //my .h file
  2. QVBoxLayout* layout;
  3. QTextEdit* txt;
  4. QWidget* container;
  5.  
  6. //my .cpp file
  7. //Constructor
  8. container = new QWidget();
  9. layout = new QVBoxLayout();
  10. ui.scrollArea->setWidget(container);
  11. container->setLayout(layout);
  12. ui.scrollArea->setLayout(layout);
  13. ui.scrollArea->setWidgetResizable(true);
  14.  
  15. //Slot which creates my textEdits
  16. txt = new QTextEdit();
  17. txt->setParent(container);
  18. connect(txt->document(), SIGNAL(contentsChanged()), this, SLOT(update_size()));
  19. txt->installEventFilter(this);
  20. txt->setFont(QFont("Times New Roman", fontSize));
  21. txt->setTextColor(fontColor);
  22. txt->show();
To copy to clipboard, switch view to plain text mode