I am trying to put a VboxLayout inside a QScrollArea. I have this to work with the code below with QPushButton, but if I try a custom widget I maed with QtDesigner the widget is not displayed.

One thing I tried was just to create a VBoxlayout (without a scroll area) and add my custom widget to it, and this worked fine. So it must have something to do with the scroll area setup, but I cannot tell.

Here is my code. (qpb1 shows up fine, but ne1 does not show up) (ui.frame is a QScrollArea)

Qt Code:
  1. QPushButton * qpb1 = new QPushButton("Jack");
  2. NameEntry * ne1 = new NameEntry("John", "NU", QPixmap(":/fb/images/1604859.jpg"), "123456789", p );
  3.  
  4. QWidget * qw = new QWidget();
  5. QVBoxLayout * layout = new QVBoxLayout();
  6. layout->addWidget(ne1);
  7. layout->addWidget(qpb1);
  8. qw->setLayout(layout);
  9. ui.frame->setWidget(qw);
To copy to clipboard, switch view to plain text mode 
Thanks for the help.

Here is a snip from NameEntry if that is needed:
Qt Code:
  1. class NameEntry : public QWidget {
  2. Q_OBJECT
  3.  
  4. public:
  5. NameEntry(QString name, QString info, QPixmap image, QString id, Profile & p, QWidget *parent = 0) :
  6. QWidget(parent), p(p), idNum(id) {
  7. ui.setupUi(this);
  8.  
  9. setName(name);
  10. setInfo(info);
  11. setImage(image);
  12. }
To copy to clipboard, switch view to plain text mode