I have made a widget with the following
Qt Code:
  1. FrameInfo::FrameInfo(QWidget* parent )
  2. :QGroupBox(parent)
  3. {
  4. //ctor
  5.  
  6. QVBoxLayout *topLayout = new QVBoxLayout(this);
  7. QScrollArea* scrollArea = new QScrollArea(this);
  8. topLayout->addWidget(scrollArea);
  9. setLayout(topLayout);
  10.  
  11. //Now, for the group box
  12. holder = new QWidget(scrollArea);
  13. mainLayout = new QVBoxLayout(holder);
  14. holder->setLayout(mainLayout);
  15. mainLayout->addStretch();
  16.  
  17. scrollArea->setWidget(holder);
  18. }
To copy to clipboard, switch view to plain text mode 

and a function like this

Qt Code:
  1. void FrameInfo::addInfo (QString infoName, QString val)
  2. {
  3. QHBoxLayout* infoLayout = new QHBoxLayout;
  4.  
  5. QLabel* lblValue = new QLabel (infoName,holder);
  6. infoLayout->addWidget(lblValue);
  7.  
  8.  
  9. QLineEdit* leValue = new QLineEdit (val,holder);
  10. leValue->setReadOnly ( true );
  11. leValue->setAlignment(Qt::AlignRight);
  12. infoLayout->addWidget(leValue);
  13.  
  14.  
  15. infoLayout->addStretch();
  16. mainLayout->insertLayout(mainLayout->count()-1,infoLayout);
  17.  
  18. holder->adjustSize();
  19. }
To copy to clipboard, switch view to plain text mode 

the symptom is that when this widget is not hidden and i will call addInfo I won't see my QLabel and QLineEdit anywhere, but if this widget is hidden ( not the current tab for the tabwidget) then call addInfo, when i let it show (by clicking the tab making this widget the current tab widget index ) then ill see them happy and breathing.

please help my widget ease with this sickness,

baray98