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
{
Q_OBJECT
public:
~OgreWidget();
protected:
//virtual void keyPressEvent(QKeyEvent *e);
// virtual void moveEvent(QMoveEvent *e);
virtual void Read_C3D_Data();
virtual void read_c3d();
//void add_camera(const Ogre::Vector3 &pos);
private:
void initOgreSystem();
void setupNLoadResources();
void createScene();
.
.
.
class OgreWidget : public QWidget
{
Q_OBJECT
public:
OgreWidget(QWidget *parent = 0);
~OgreWidget();
protected:
//virtual void keyPressEvent(QKeyEvent *e);
// virtual void moveEvent(QMoveEvent *e);
void moveEvent ( QMoveEvent * e );
virtual void paintEvent(QPaintEvent *e);
virtual void showEvent(QShowEvent *e);
virtual void mousePressEvent(QMouseEvent *e/*vent*/);
virtual void Read_C3D_Data();
virtual void read_c3d();
//void add_camera(const Ogre::Vector3 &pos);
private:
void initOgreSystem();
void setupNLoadResources();
void createScene();
.
.
.
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
{
Q_OBJECT
public:
QMdiArea *mdiArea;
};
class MyInterface : public QMainWindow
{
Q_OBJECT
public:
QWidget *centralwidget;
QDockWidget *dockWidget_2;
QWidget *dockWidgetContents_5;
QToolBox *toolBox_5;
QWidget *page_13;
QToolButton *toolButton_13;
QToolButton *toolButton_14;
QToolButton *toolButton_15;
QFrame *line;
QToolButton *toolButton_16;
QGroupBox *groupBox_8;
QDoubleSpinBox *doubleSpinBox_4;
QLabel *label_4;
QLabel *label_5;
QDoubleSpinBox *doubleSpinBox_5;
QDoubleSpinBox *doubleSpinBox_6;
QLabel *label_6;
QWidget *page_14;
QToolButton *toolButton_17;
QFrame *line_2;
QToolButton *toolButton_18;
QToolButton *toolButton_19;
QGroupBox *groupBox_6;
QDoubleSpinBox *doubleSpinBox;
QLabel *label;
QLabel *label_2;
QDoubleSpinBox *doubleSpinBox_2;
QDoubleSpinBox *doubleSpinBox_3;
QLabel *label_3;
QToolButton *toolButton_20;
QGroupBox *groupBox_7;
QWidget *page_15;
QMdiArea *mdiArea;
QWidget *subwindow
QStatusBar *statusbar;
QDockWidget *dockWidget_5;
QWidget *dockWidgetContents_8;
QListView *listView;
QScrollArea *scrollArea;
QWidget *scrollAreaWidgetContents;
MyInterface(QMainWindow* parent = 0);
};
To copy to clipboard, switch view to plain text mode
in my file .cpp
{
centralwidget
->setObjectName
(QString::fromUtf8("centralwidget"));
setObjectName
(QString::fromUtf8("MainWindow"));
resize(833, 411);
setCentralWidget(centralwidget);
page_13
->setObjectName
(QString::fromUtf8("page_13"));
page_13
->setGeometry
(QRect(0,
0,
98,
28));
.
.
.
.
[U]this->setCentralWidget(new OgreWidget(this));[/U]
MyInterface::MyInterface(QMainWindow *parent )
: QMainWindow (parent)
{
QWidget *centralwidget;
centralwidget = new QWidget(this);
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
setObjectName(QString::fromUtf8("MainWindow"));
resize(833, 411);
setCentralWidget(centralwidget);
setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8));
page_13 = new QWidget();
page_13->setObjectName(QString::fromUtf8("page_13"));
page_13->setGeometry(QRect(0, 0, 98, 28));
.
.
.
.
[U]this->setCentralWidget(new OgreWidget(this));[/U]
To copy to clipboard, switch view to plain text mode
but dos not work
Bookmarks