How can I make multiple Ui forms in Qt Creator and link them? I want to have a button in my mainwindow.ui and when it's triggered i want the other ui be shown. how can I do it?
I have two Qt Form Classes:
- mainwindow
- mainwindow2
I tried this code in main.cpp:
#include "mainwindow.h"
#include "mainwindow2.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
MainWindow2 w2;
w2.show();
return a.exec();
}
but this errors occur:
main.obj:-1: error: LNK2019: unresolved external symbol "public: virtual __thiscall MainWindow2::~MainWindow2(void)" (??1MainWindow2@@UAE@XZ) referenced in function _main
main.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall MainWindow2::MainWindow2(class QWidget *)" (??0MainWindow2@@QAE@PAVQWidget@@@Z) referenced in function _main
release\testtest.exe:-1: error: LNK1120: 2 unresolved externals
MainWindow2
class? – thuga