¨[solved] - public slots in MainWindow
is anywhere described how to create a public slot in MainWindow?
I already have a tabWidget as a centralWidget and I'm interested to add a public slot that will open any new form/widget in a new tab, inside the mainWindow. this slot should be consumed by a pushButton.
You need to read this
I knew this post, but I didn't pay attention when I read it.
basically in mainwindow.h I declared:
void addNewTab(QWidget *page, QString &title)
QTabWidget *newTab = new QTabWidget;
connect(newTab, SIGNAL(tabCloseRequested(int)), newTab, SLOT (close()));
setCentralWidget(newTab); newTab->addTab(page, title); }
when I call it from mainwindow.cpp
usernew *nU = new usernew;
QString title = "Add User";
that solved the issue. thank you for your guidelines.