if (evt->buttons() & Qt::MiddleButton) //you filter out the middle mouse button (no signal will be emitted)
if (evt->buttons() & Qt::MiddleButton) //you filter out the middle mouse button (no signal will be emitted)
To copy to clipboard, switch view to plain text mode
why ? but why enter to weheel and not at the press
void QOgreWidget::setViewNum(int num)
{
--------------------------------------------------------------
if(num == 1)
{
float wi=central->width();
float hi=central->height();
QOgreRenderWindow
* orw
= new QOgreRenderWindow
(QString("View2"),mSceneMgr,mRoot,nb_cam,
/*central*/wi,hi
);
Layout->addWidget(orw);
central->setLayout(Layout);
mVerticalLayout->addWidget(central);
}
---------------------------------
for(int i = 0;i<mQOgreRenderWindowList.count();i++)
{
connect(mQOgreRenderWindowList
[i
],
SIGNAL(keyPress
(QKeyEvent*)),
this,
SLOT(keyPress
(QKeyEvent*)));
connect(mQOgreRenderWindowList
[i
],
SIGNAL(keyRelease
(QKeyEvent*)),
this,
SLOT(keyRelease
(QKeyEvent*)));
}
void QOgreWidget::setViewNum(int num)
{
--------------------------------------------------------------
if(num == 1)
{
QWidget *central = new QGroupBox("My Scene", this);
float wi=central->width();
float hi=central->height();
QOgreRenderWindow * orw = new QOgreRenderWindow(QString("View2"),mSceneMgr,mRoot,nb_cam,/*central*/wi,hi);
QHBoxLayout* Layout = new QHBoxLayout();
Layout->addWidget(orw);
central->setLayout(Layout);
mVerticalLayout->addWidget(central);
}
---------------------------------
for(int i = 0;i<mQOgreRenderWindowList.count();i++)
{
connect(mQOgreRenderWindowList[i],SIGNAL(keyPress(QKeyEvent*)),this,SLOT(keyPress(QKeyEvent*)));
connect(mQOgreRenderWindowList[i],SIGNAL(keyRelease(QKeyEvent*)),this,SLOT(keyRelease(QKeyEvent*)));
connect(mQOgreRenderWindowList[i],SIGNAL(mousePress(QMouseEvent*)),this,SLOT(mousePress(QMouseEvent*)));
connect(mQOgreRenderWindowList[i],SIGNAL(mouseRelease(QMouseEvent*)),this,SLOT(mouseRelease(QMouseEvent*)));
connect(mQOgreRenderWindowList[i],SIGNAL(mouseMove(QMouseEvent*)),this,SLOT(mouseMove(QMouseEvent*)));
connect(mQOgreRenderWindowList[i],SIGNAL(wheel(QWheelEvent*)),this,SLOT(wheel(QWheelEvent*)));
}
To copy to clipboard, switch view to plain text mode
it work with wheel when i make the curseur of mouse on widget i see that the camera change it position
Bookmarks