you can see my screensaver of my UI class
Immagine.jpg
and this is the cpp file of the class
#include "tabwidget.h"
#include "ui_tabwidget.h"
tabWidget
::tabWidget(QWidget *parent
) : ui(new Ui::tabWidget)
{
ui->setupUi(this);
}
tabWidget::~tabWidget()
{
delete ui;
}
#include "tabwidget.h"
#include "ui_tabwidget.h"
tabWidget::tabWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::tabWidget)
{
ui->setupUi(this);
}
tabWidget::~tabWidget()
{
delete ui;
}
To copy to clipboard, switch view to plain text mode
then in mainwindow.cpp I include the class with
#include "tabwidget.h"
#include "tabwidget.h"
To copy to clipboard, switch view to plain text mode
in the end always How do I create a new tab using my widget class, but the whole thing does not work
tabWidget *serialtab;
serialtab = new tabWidget();
ui->tabWidget->addTab(serialtab,"+");
tabWidget *serialtab;
serialtab = new tabWidget();
ui->tabWidget->addTab(serialtab,"+");
To copy to clipboard, switch view to plain text mode
I hope I misunderstood your question, thanks
Added after 21 minutes:
very sorry.
the problem was that the first 2 tabs are already created by mainwindow.ui but did not have the calss TabWidget created by me but the third tab it works !!!
thank you very much !!!
Bookmarks