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?
//my .h file
//my .cpp file
//Constructor
ui.scrollArea->setWidget(container);
container->setLayout(layout);
ui.scrollArea->setLayout(layout);
ui.scrollArea->setWidgetResizable(true);
//Slot which creates my textEdits
txt->setParent(container);
connect(txt->document(), SIGNAL(contentsChanged()), this, SLOT(update_size()));
txt->installEventFilter(this);
txt
->setFont
(QFont("Times New Roman", fontSize
));
txt->setTextColor(fontColor);
txt->show();
//my .h file
QVBoxLayout* layout;
QTextEdit* txt;
QWidget* container;
//my .cpp file
//Constructor
container = new QWidget();
layout = new QVBoxLayout();
ui.scrollArea->setWidget(container);
container->setLayout(layout);
ui.scrollArea->setLayout(layout);
ui.scrollArea->setWidgetResizable(true);
//Slot which creates my textEdits
txt = new QTextEdit();
txt->setParent(container);
connect(txt->document(), SIGNAL(contentsChanged()), this, SLOT(update_size()));
txt->installEventFilter(this);
txt->setFont(QFont("Times New Roman", fontSize));
txt->setTextColor(fontColor);
txt->show();
To copy to clipboard, switch view to plain text mode
Bookmarks