Here you go(untested)
Qt Code:
  1. void FrameInfo::addInfo (QString infoName, QString val)
  2. {
  3. QWidget *w = new QWidget(holder);
  4. QHBoxLayout* infoLayout = new QHBoxLayout(w);
  5. QLabel* lblValue = new QLabel (infoName,w);
  6. infoLayout->addWidget(lblValue);
  7. QLineEdit* leValue = new QLineEdit (val,w);
  8. leValue->setReadOnly ( true );
  9. leValue->setAlignment(Qt::AlignRight);
  10. infoLayout->addWidget(leValue);
  11. infoLayout->addStretch();
  12. mainLayout->addWidget(w);
  13. mainLayout->update();
  14. }
To copy to clipboard, switch view to plain text mode