How is that ?!!

Part of Header files 's code generated to the form that contains the QStackedWidget :

Qt Code:
  1. #include <QtGui/QStackedWidget>
  2. #include <QtGui/QWidget>
  3.  
  4.  
  5. class Ui_FormTwo
  6. {
  7. public:
  8. QStackedWidget *stackedWidget;
  9. QWidget *page;
  10.  
  11. void setupUi(QWidget *FormTwo)
  12. {
  13. stackedWidget = new QStackedWidget(FormTwo);
  14. stackedWidget->setObjectName(QString::fromUtf8("stackedWidget"));
  15. stackedWidget->setGeometry(QRect(460, 130, 551, 371));
  16. page = new QWidget();
  17. page->setObjectName(QString::fromUtf8("page"));
  18. page->setGeometry(QRect(0, 0, 551, 371));
  19. stackedWidget->addWidget(page);
  20.  
  21. retranslateUi(FormTwo);
  22.  
  23. stackedWidget->setCurrentIndex(0);
  24.  
  25. // ......................etc
  26.  
  27. } // setupUi
To copy to clipboard, switch view to plain text mode 

---------------------------------------------------------------
Temporarily , I've added the code that add my .UI to the stack at the constructor of the form that has the stack object :

Qt Code:
  1. CustomSlot2::CustomSlot2(QWidget *parent): QWidget(parent)
  2. {
  3. formTwo.setupUi(this);
  4.  
  5. CustomSlot *CustomSlotObj=new CustomSlot() ;
  6.  
  7. formTwo.stackedWidget->insertWidget(1,CustomSlotObj);
  8.  
  9. QWidget *WidgetObj;
  10. WidgetObj= formTwo.stackedWidget->widget (1) ;
  11.  
  12. WidgetObj->show();
  13.  
  14.  
  15. }
To copy to clipboard, switch view to plain text mode 

Thanks .