Solved A window with quickly changing forms
-
Hi.
Me need window with quickly changing forms.
In mainwindow.h :private: Ui::MainWindow *ui; Ui::MainWindow *ui2;
In mainwindow.cpp :
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), ui2(new Ui::MainWindow) { ui->setupUi(this); NBar = 0; TimeFrame=1; ParametrForStrategyCod=10; //ui2=new Ui::MainWindow; //ui3=new Ui::MainWindow; }
The button is tied to the calling form:
ui2->setupUi(this);
But after that the buttons don't work.
How to create and call a new window, or form in this class? -
@Mikee Why do you use two MainWindows? Just create two widgets and switch between them. See http://doc.qt.io/qt-5.9/qmainwindow.html#setCentralWidget
-
Hi
The http://doc.qt.io/qt-5/qstackedwidget.html
is also good for such designs as it make it very easy to switch back and forth between
"pages" containing any number of widgets. -
thank you