I've created Many (.UI) , made a (Header File + .cpp) to each .UI in order to implement their own slots , & Linked them by making a widget to be shown using :
// CustomSlot2 implements the slots inside the 2nd .UI
CustomSlot2* widget = new CustomSlot2();
widget->setAttribute(Qt::WA_DeleteOnClose);
widget->show();
// CustomSlot2 implements the slots inside the 2nd .UI
CustomSlot2* widget = new CustomSlot2();
widget->setAttribute(Qt::WA_DeleteOnClose);
widget->show();
To copy to clipboard, switch view to plain text mode
CustomSlot2 Constructor's Code is :
{
formTwo.setupUi(this);
}
CustomSlot2::CustomSlot2(QWidget *parent): QWidget(parent)
{
formTwo.setupUi(this);
}
To copy to clipboard, switch view to plain text mode
So far so Good . However , by making this approach there's a flicker when you Open & Hide/Close Windows .
I've thought in an alternative way ;that I'll Drag & Drop a QWidget into my Main Window using QT Design.
The Problem : How Could I open my .UIs into the QWidget that I've added @ MainWindow .
The MainWindow's header file generated by "make" :
class Ui_MainForm
{
public:
//........................ etc
class Ui_MainForm
{
public:
QPushButton *btnProcess;
QLineEdit *txtInput;
QLineEdit *txtResult;
QPushButton *btnNext;
QWidget *widget;
//........................ etc
To copy to clipboard, switch view to plain text mode
Thanks .
Bookmarks