Fatla
17th June 2008, 17:30
Now , I'm @ QT Design then I create a normal widget ,add ctrls into it.
I make the previous step 4 times . So now I've 4 .UIs that have there own ctrls into it .
To Each UI, I create its (.h + .cpp ) to implement my own slots .
Well now I open ,using QT Design ,the 1st .ui I 've made & Drag & Drop Widget into it , which is located into Container Section .
The Problem : is how to make other .UIs open into the widget I created @ the 1st .ui I 've made .
The standard way that shows each .UI separately, wrks fine by :
// CustomSlot2 implements the slots inside the 2nd .UI
CustomSlot2* widget = new CustomSlot2();
widget->setAttribute(Qt::WA_DeleteOnClose);
widget->show();
CustomSlot2 Constructor's Code is :
CustomSlot2::CustomSlot2(QWidget *parent): QWidget(parent)
{
formTwo.setupUi(this);
}
So far so Good . However , by making this approach there's a flicker when you Open & Hide/Close Windows .
The MainWindow's header file generated by "make" :
class Ui_MainForm
{
public:
QPushButton *btnProcess;
QLineEdit *txtInput;
QLineEdit *txtResult;
QPushButton *btnNext;
QWidget *widget;
//........................ etc
Thanks .
I make the previous step 4 times . So now I've 4 .UIs that have there own ctrls into it .
To Each UI, I create its (.h + .cpp ) to implement my own slots .
Well now I open ,using QT Design ,the 1st .ui I 've made & Drag & Drop Widget into it , which is located into Container Section .
The Problem : is how to make other .UIs open into the widget I created @ the 1st .ui I 've made .
The standard way that shows each .UI separately, wrks fine by :
// CustomSlot2 implements the slots inside the 2nd .UI
CustomSlot2* widget = new CustomSlot2();
widget->setAttribute(Qt::WA_DeleteOnClose);
widget->show();
CustomSlot2 Constructor's Code is :
CustomSlot2::CustomSlot2(QWidget *parent): QWidget(parent)
{
formTwo.setupUi(this);
}
So far so Good . However , by making this approach there's a flicker when you Open & Hide/Close Windows .
The MainWindow's header file generated by "make" :
class Ui_MainForm
{
public:
QPushButton *btnProcess;
QLineEdit *txtInput;
QLineEdit *txtResult;
QPushButton *btnNext;
QWidget *widget;
//........................ etc
Thanks .