C++ (Qt) myTab = new QTabWidget(this); myWidget = new QWidget; myWidget2 = new QWidget; myWidget3 = new QWidget; myLayBoxWidget = new QVBoxLayout; myLayBoxWidget->addWidget(myTab); myTab->addTab(myWidget,QString("MY")); myTab->addTab(myWidget2,QString("MY2")); myTab->addTab(myWidget3,QString("MY3"));
C++ (Qt)MyWindow::MyWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MyWindow){ ui->setupUi(this); myTab = new QTabWidget(this); myWidget = new QWidget; myWidget2 = new QTextEdit; myWidget3 = new QWidget; myLayBoxWidget = new QVBoxLayout; myLayBoxWidget->addWidget(myTab); setLayout (myLayBoxWidget); myTab->addTab(myWidget,QString("MY")); myTab->addTab(myWidget2,QString("MY2")); myTab->addTab(myWidget3,QString("MY3"));} MyWindow::~MyWindow(){ delete ui;}