Hi, i returned with new problem
as you know i have like that
in the main i make
Qt Code:
  1. #include <QApplication>
  2. #include "my_interface.h"
  3. int main(int argc, char **argv)
  4. {
  5. QApplication app(argc, argv);
  6. MainWindow window;
  7. window.show();
  8. window.setViewNum(1);//or window.setViewNum(4);
  9.  
  10. return app.exec();
  11. }
To copy to clipboard, switch view to plain text mode 
in mainwindow.h i make like that
Qt Code:
  1. class MainWindow : public QMainWindow
  2. {
  3. Q_OBJECT
  4. public:
  5. MainWindow();
  6. void setViewNum(int num);
To copy to clipboard, switch view to plain text mode 
and in the .cpp
Qt Code:
  1. MainWindow::MainWindow()
  2. {
  3.  
  4. mQOgreWidget = new QOgreWidget(this);
  5.  
  6. setCentralWidget(mQOgreWidget);
  7.  
  8. if(mQOgreWidget->isVisible())
  9. mQOgreWidget->setViewNum(1);//or mQOgreWidget->setViewNum(4);
  10.  
  11. }
To copy to clipboard, switch view to plain text mode 
and in QOgreWidget.h
Qt Code:
  1. public slots :
  2. void setViewNum(int num);
  3. void setCameraPosition(const Ogre::Vector3 &pos);
To copy to clipboard, switch view to plain text mode 
in QOgreWidget.cpp
Qt Code:
  1. void QOgreWidget::setViewNum(int num)
  2. {
  3. if(num == 1)
  4. {
  5.  
  6. QWidget *central0 = new QGroupBox("My Scene", this);
  7. float wi0=central0->width();
  8. float hi0=central0->height();
  9.  
  10. QOgreRenderWindow * orw0 = new QOgreRenderWindow(QString("View2"),mSceneMgr,mRoot,nb_cam,wi0,hi0);
  11.  
  12. QHBoxLayout* Layout0 = new QHBoxLayout();
  13. Layout0->addWidget(orw0);
  14.  
  15. central0->setLayout(Layout0);
  16.  
  17.  
  18. mVerticalLayout->addWidget(central0);
  19.  
  20. }
  21. if(num == 4)
  22. {
  23.  
  24. QHBoxLayout* mainlayout = new QHBoxLayout();
  25.  
  26. QGridLayout* rightSide = new QGridLayout;
  27. /////////////////////////////////////////////////////////////////////////////////////////
  28. QWidget *central = new QGroupBox("My Scene", this);
  29. //QLabel* orw = new QLabel("i am",central);
  30. float wi=central->width();
  31. float hi=central->height();
  32. QOgreRenderWindow *orw = new QOgreRenderWindow(QString("View0"),mSceneMgr,mRoot,nb_cam,wi,hi);
  33. mQOgreRenderWindowList.append(orw);
  34. mainlayout->addWidget(orw);
  35. central->setLayout(mainlayout);
  36. /////////////////////////
  37. QWidget *central1 = new QGroupBox("0,0", this);
  38. float wi1=central1->width();
  39. float hi1=central1->height();
  40. QOgreRenderWindow * orw1 = new QOgreRenderWindow(QString("View1"),mSceneMgr,mRoot,nb_cam,wi1,hi1);
  41. mQOgreRenderWindowList.append(orw1);
  42.  
  43.  
  44. QHBoxLayout* Layout1 = new QHBoxLayout();
  45. Layout1->addWidget(orw1);
  46. central1->setLayout(Layout1);
  47. /****************************/
  48. QWidget *central2 = new QGroupBox("0,1", this);
  49. wi=central2->width();
  50. hi=central2->height();
  51.  
  52. QOgreRenderWindow *orw2 = new QOgreRenderWindow(QString("View2"),mSceneMgr,mRoot,nb_cam,wi,hi);
  53. mQOgreRenderWindowList.append(orw2);
  54. QHBoxLayout* Layout2 = new QHBoxLayout();
  55. Layout2->addWidget(orw2);
  56. central2->setLayout(Layout2);
  57.  
  58.  
  59.  
  60. ////////////////////////////////////////////////////////////////////*
  61. QWidget *central3 = new QGroupBox("0,2", this);
  62. wi=central3->width();
  63. hi=central3->height();
  64.  
  65. QOgreRenderWindow * orw3 = new QOgreRenderWindow(QString("View3"),mSceneMgr,mRoot,nb_cam,wi,hi);
  66. mQOgreRenderWindowList.append(orw3);
  67. QHBoxLayout* Layout3 = new QHBoxLayout();
  68. Layout3->addWidget(orw3);
  69. central3->setLayout(Layout3);
  70. /////////////////////////////////////////////////////////
  71. QWidget *central4 = new QGroupBox("1,0", this);
  72. wi=central4->width();
  73. hi=central4->height();
  74.  
  75. QOgreRenderWindow *orw4 = new QOgreRenderWindow(QString("View4"),mSceneMgr,mRoot,nb_cam,wi,hi);
  76. mQOgreRenderWindowList.append(orw4);
  77. QHBoxLayout* Layout4 = new QHBoxLayout();
  78. Layout4->addWidget(orw4);
  79. central4->setLayout(Layout4);
  80. ////////////////////////////////////////////
  81. QWidget *central5 = new QGroupBox("1,1", this);
  82. wi=central5->width();
  83. hi=central5->height();
  84. // QLabel* orw5 = new QLabel("i am4",central3);
  85. QOgreRenderWindow *orw5 = new QOgreRenderWindow(QString("View5"),mSceneMgr,mRoot,nb_cam,wi,hi);
  86. mQOgreRenderWindowList.append(orw5);
  87. QHBoxLayout* Layout5 = new QHBoxLayout();
  88. Layout5->addWidget(orw5);
  89. central5->setLayout(Layout5);
  90. /////////////////////////////////////////
  91. QWidget *central6 = new QGroupBox("1,2", this);
  92. wi=central6->width();
  93. hi=central6->height();
  94. //QLabel* orw3 = new QLabel("i am4",central3);
  95. QOgreRenderWindow *orw6 = new QOgreRenderWindow(QString("View6"),mSceneMgr,mRoot,nb_cam,wi,hi);
  96. mQOgreRenderWindowList.append(orw6);
  97. QHBoxLayout* Layout6 = new QHBoxLayout();
  98. Layout6->addWidget(orw6);
  99. central6->setLayout(Layout6);
  100. ////////////////////////////////////////////
  101. QWidget *central7 = new QGroupBox("2,0", this);
  102. wi=central7->width();
  103. hi=central7->height();
  104. //QLabel* orw = new QLabel("i am4",central7);
  105. QOgreRenderWindow *orw7 = new QOgreRenderWindow(QString("View7"),mSceneMgr,mRoot,nb_cam,wi,hi);
  106. mQOgreRenderWindowList.append(orw7);
  107. QHBoxLayout* Layout7 = new QHBoxLayout();
  108. Layout7->addWidget(orw7);
  109. central7->setLayout(Layout7);
  110. ////////////////////////////////////////////////////////////
  111. QWidget *central8 = new QGroupBox("2,1", this);
  112. wi=central8->width();
  113. hi=central8->height();
  114. // QLabel* orw3 = new QLabel("i am4",central8);
  115. QOgreRenderWindow *orw8 = new QOgreRenderWindow(QString("View8"),mSceneMgr,mRoot,nb_cam,wi,hi);
  116. mQOgreRenderWindowList.append(orw8);
  117. QHBoxLayout* Layout8 = new QHBoxLayout();
  118. Layout8->addWidget(orw8);
  119. central8->setLayout(Layout8);
  120. /////////////////////////////////////////////////////////////
  121. QWidget *central9 = new QGroupBox("2,2", this);
  122. wi=central9->width();
  123. hi=central9->height();
  124. // QLabel* orw3 = new QLabel("i am4",central9);
  125. QOgreRenderWindow *orw9 = new QOgreRenderWindow(QString("View9"),mSceneMgr,mRoot,nb_cam,wi,hi);
  126. mQOgreRenderWindowList.append(orw9);
  127. QHBoxLayout* Layout9 = new QHBoxLayout();
  128. Layout9->addWidget(orw9);
  129. central9->setLayout(Layout9);
  130. ///////////////////////////////////////////////
  131. QWidget *central10 = new QGroupBox("3,0", this);
  132. wi=central10->width();
  133. hi=central10->height();
  134. //QLabel* orw3 = new QLabel("i am4",central10);
  135. QOgreRenderWindow *orw10 = new QOgreRenderWindow(QString("View10"),mSceneMgr,mRoot,nb_cam,wi,hi);
  136. mQOgreRenderWindowList.append(orw10);
  137. QHBoxLayout* Layout10 = new QHBoxLayout();
  138. Layout10->addWidget(orw10);
  139. central10->setLayout(Layout10);
  140.  
  141. ////////////////////////////////////////////////////
  142. QWidget *central11 = new QGroupBox("3,1", this);
  143. wi=central11->width();
  144. hi=central11->height();
  145. // QLabel* orw3 = new QLabel("i am4",central11);
  146. QOgreRenderWindow *orw11 = new QOgreRenderWindow(QString("View111"),mSceneMgr,mRoot,nb_cam,wi,hi);
  147. mQOgreRenderWindowList.append(orw11);
  148. QHBoxLayout* Layout11 = new QHBoxLayout();
  149. Layout11->addWidget(orw11);
  150. central11->setLayout(Layout11);
  151. ///////////////////////////////
  152. QWidget *central12 = new QGroupBox("3,2", this);
  153. wi=central12->width();
  154. hi=central12->height();
  155. // QLabel* orw3 = new QLabel("i am4",central11);
  156. QOgreRenderWindow *orw12 = new QOgreRenderWindow(QString("View12"),mSceneMgr,mRoot,nb_cam,wi,hi);
  157. mQOgreRenderWindowList.append(orw12);
  158. QHBoxLayout* Layout12 = new QHBoxLayout();
  159. Layout12->addWidget(orw12);
  160. central12->setLayout(Layout12);
  161. ////////////////////////////////////////////////
  162. rightSide->addWidget(/*new QGroupBox("0,0"), 0, 0 */central1,0,0);
  163. rightSide->addWidget(central2,0,1);
  164. rightSide->addWidget(central3,0,2);
  165. rightSide->addWidget(central4, 1, 0 );
  166. rightSide->addWidget(central5, 1, 1 );
  167. rightSide->addWidget(central6, 1, 2 );
  168. rightSide->addWidget(central7, 2, 0 );
  169. rightSide->addWidget(central8, 2, 1 );
  170. rightSide->addWidget(central9, 2, 2 );
  171. rightSide->addWidget(central10, 3, 0 );
  172. rightSide->addWidget(central11, 3, 1 );
  173. rightSide->addWidget(central12, 3, 2 );
  174.  
  175.  
  176. mVerticalLayout->addWidget(central);
  177. mVerticalLayout->addLayout(rightSide);
  178.  
  179.  
  180. }
  181. for(int i = 0;i<mQOgreRenderWindowList.count();i++)
  182. {
  183. connect(mQOgreRenderWindowList[i],SIGNAL(keyPress(QKeyEvent*)),this,SLOT(keyPress(QKeyEvent*)));
  184. connect(mQOgreRenderWindowList[i],SIGNAL(keyRelease(QKeyEvent*)),this,SLOT(keyRelease(QKeyEvent*)));
  185. connect(mQOgreRenderWindowList[i],SIGNAL(mousePress(QMouseEvent*)),this,SLOT(mousePress(QMouseEvent*)));
  186. connect(mQOgreRenderWindowList[i],SIGNAL(mouseRelease(QMouseEvent*)),this,SLOT(mouseRelease(QMouseEvent*)));
  187. connect(mQOgreRenderWindowList[i],SIGNAL(mouseMove(QMouseEvent*)),this,SLOT(mouseMove(QMouseEvent*)));
  188. connect(mQOgreRenderWindowList[i],SIGNAL(wheel(QWheelEvent*)),this,SLOT(wheel(QWheelEvent*)));
  189. }
  190.  
  191. }
To copy to clipboard, switch view to plain text mode 
as you know that work
Now i add this function "setCameraPosition" that work too (it add to me an object )
The question or the problem now
1-i want when i execute ""setCameraPosition"" i add than view
is it possible ?
that mean i
i want in the start of the program i see only the left view (i execute only)
Qt Code:
  1. QOgreRenderWindow *orw = new QOgreRenderWindow(QString("View0"),mSceneMgr,mRoot,nb_cam,wi,hi);
To copy to clipboard, switch view to plain text mode 
and in each time and when i execute "setCameraPosition" i apply
Qt Code:
  1. QOgreRenderWindow *orw = new QOgreRenderWindow(QString("View0"),mSceneMgr,mRoot,nb_cam,wi,hi);
To copy to clipboard, switch view to plain text mode 
and put it in the layout