What I want to achieve is this:
pic.png

The second TextEdit needs a spacer in a horizontal layout for this. I've made a layout like this:
Qt Code:
  1. QHBoxLayout* hLayout = new QHBoxLayout();
  2. hLayout->addItem(new QSpacerItem(16, 64, QSizePolicy::Fixed, QSizePolicy::Fixed));
  3. hLayout->addWidget((QTextEdit*)itemText); //Just fyi: itemText is an object of class that extends QTextEdit.
To copy to clipboard, switch view to plain text mode 

and tried to add it to an existing (vertical)layout that is set on the ScrollArea.
Qt Code:
  1. ui->scrollArea->widget()->layout()->addItem(hLayout);
To copy to clipboard, switch view to plain text mode 

But it only adds empty space with the height of spacer. Why doesn't the QTextEdit object appear?