thank you for repling

i want one scene

keep subclassing QWidget, and set the central widget with your OgreWidget instance.
it dos not work

i make the definition of my ogrewidget class in file
ogrewidget.h
Qt Code:
  1. class OgreWidget : public QWidget
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. OgreWidget(QWidget *parent = 0);
  7. ~OgreWidget();
  8.  
  9.  
  10. protected:
  11. //virtual void keyPressEvent(QKeyEvent *e);
  12. // virtual void moveEvent(QMoveEvent *e);
  13. void moveEvent ( QMoveEvent * e );
  14. virtual void paintEvent(QPaintEvent *e);
  15. virtual void showEvent(QShowEvent *e);
  16.  
  17. virtual void mousePressEvent(QMouseEvent *e/*vent*/);
  18. virtual void Read_C3D_Data();
  19. virtual void read_c3d();
  20. //void add_camera(const Ogre::Vector3 &pos);
  21.  
  22.  
  23. private:
  24. void initOgreSystem();
  25. void setupNLoadResources();
  26. void createScene();
  27. .
  28. .
  29. .
To copy to clipboard, switch view to plain text mode 
and i wrote the code of each function in ogrewidget.cpp

in another file interface.h i define my class mainwindow
Qt Code:
  1. class MyInterface : public QMainWindow
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. QWidget *centralwidget;
  7. QDockWidget *dockWidget_2;
  8. QWidget *dockWidgetContents_5;
  9. QToolBox *toolBox_5;
  10. QWidget *page_13;
  11. QToolButton *toolButton_13;
  12. QToolButton *toolButton_14;
  13. QToolButton *toolButton_15;
  14. QFrame *line;
  15. QToolButton *toolButton_16;
  16. QGroupBox *groupBox_8;
  17. QDoubleSpinBox *doubleSpinBox_4;
  18. QLabel *label_4;
  19. QLabel *label_5;
  20. QDoubleSpinBox *doubleSpinBox_5;
  21. QDoubleSpinBox *doubleSpinBox_6;
  22. QLabel *label_6;
  23. QWidget *page_14;
  24. QToolButton *toolButton_17;
  25. QFrame *line_2;
  26. QToolButton *toolButton_18;
  27. QToolButton *toolButton_19;
  28. QGroupBox *groupBox_6;
  29. QDoubleSpinBox *doubleSpinBox;
  30. QLabel *label;
  31. QLabel *label_2;
  32. QDoubleSpinBox *doubleSpinBox_2;
  33. QDoubleSpinBox *doubleSpinBox_3;
  34. QLabel *label_3;
  35. QToolButton *toolButton_20;
  36. QGroupBox *groupBox_7;
  37. QWidget *page_15;
  38. QMdiArea *mdiArea;
  39. QWidget *subwindow
  40. QStatusBar *statusbar;
  41. QDockWidget *dockWidget_5;
  42. QWidget *dockWidgetContents_8;
  43. QListView *listView;
  44. QScrollArea *scrollArea;
  45. QWidget *scrollAreaWidgetContents;
  46.  
  47. MyInterface(QMainWindow* parent = 0);
  48.  
  49. };
To copy to clipboard, switch view to plain text mode 
in my file .cpp
Qt Code:
  1. MyInterface::MyInterface(QMainWindow *parent )
  2. : QMainWindow (parent)
  3.  
  4. {
  5.  
  6. QWidget *centralwidget;
  7.  
  8. centralwidget = new QWidget(this);
  9. centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
  10.  
  11.  
  12. setObjectName(QString::fromUtf8("MainWindow"));
  13. resize(833, 411);
  14. setCentralWidget(centralwidget);
  15. setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8));
  16.  
  17. page_13 = new QWidget();
  18. page_13->setObjectName(QString::fromUtf8("page_13"));
  19. page_13->setGeometry(QRect(0, 0, 98, 28));
  20.  
  21. .
  22. .
  23. .
  24. .
  25. [U]this->setCentralWidget(new OgreWidget(this));[/U]
To copy to clipboard, switch view to plain text mode 
but dos not work