The code seems OK.
You do this:
Qt Code:
  1. setCentralWidget(txtName);
To copy to clipboard, switch view to plain text mode 

What other widgets do you refer to?

This makes the text edit take over the entire client area in the window.

To add other widgets:
Qt Code:
  1. QWidget *w = new QWidget(this);
  2. l->addWidget(some widget);
  3. l->addWidget(some widget);
  4. l->addWidget(some widget);
  5. ...
  6. [B]l->addWidget(txtEdit)[/B];
  7. ...
  8. l->addWidget(some widget);
  9. w->setLayout(l);
  10. this->setCentralWidget(w);
To copy to clipboard, switch view to plain text mode 


This is just an example. You can use whatever layout you like.
The point is that in order to add multiple widgets in a main window client area, you need to have a container for them.

This is why you don't see any other widgets.

Regards