Hello. There is a class ComparisionTable inherited from QWidget with widgets: two QLabel and one QTableWidget.
The layout was spelled out in the constructor:
QVBoxLayout *pVBox = new QVBoxLayout(); pVBox->addWidget(lblIS, 0, Qt::AlignTop); pVBox->addWidget(lblOS, 0, Qt::AlignTop); QHBoxLayout *pHBox = new QHBoxLayout(this); pHBox->addWidget(pTable); pHBox->addLayout(pVBox); this->setLayout(pHBox); You need to create the PairwiseComp class, which will inherit from the above-written class, just add another QLabel and the necessary methods for it. Created:
PairwiseComp::PairwiseComp(ComparisionTableData data, QString name, QWidget *parent) : ComparisionTable(data, parent) { lblName = new QLabel(this); lblName->setText("<font color=blue>"+name+"</font>"); And it will be necessary to change the layout. How can I change the layout? Simply adding to the constructor is not an option.