The code seems OK.
You do this:
setCentralWidget(txtName);
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:
l->addWidget(some widget);
l->addWidget(some widget);
l->addWidget(some widget);
...
[B]l->addWidget(txtEdit)[/B];
...
l->addWidget(some widget);
w->setLayout(l);
this->setCentralWidget(w);
QWidget *w = new QWidget(this);
QHBoxLayout *l = new QHBoxLayout(w);
l->addWidget(some widget);
l->addWidget(some widget);
l->addWidget(some widget);
...
[B]l->addWidget(txtEdit)[/B];
...
l->addWidget(some widget);
w->setLayout(l);
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
Bookmarks