Problem with filedialog for opengl application.
-
Hello,
Having problem with crash while calling file opening dialog or window gui / interface from seperate class.
Also crash if window->show comand used to show seperate gui.@ if (m->button() == Qt::MidButton){
allowmousemove = 1;
VALUElast = move_LEFT_RIGHT;
VALUElastUP_DOWN = move_UP_DOWN;
start_mouse_move = m->globalX()- VALUElast;
start_mouse_move2 = m->globalY()- VALUElastUP_DOWN;
}}
void OpenGLWindow::mouseReleaseEvent(QMouseEvent *w)
{
if (w->button() == Qt::MidButton){
allowmousemove = 0;
}
}void OpenGLWindow::mouseMoveEvent(QMouseEvent *q)
{
if(allowmousemove==1){offsetMouseX = (q->globalX()-start_mouse_move); offsetMouseY = (q->globalY()-start_mouse_move2);
}
}void OpenGLWindow::keyPressEvent(QKeyEvent *e){
if(e->key() == Qt::Key_F1){
CRASHLINE-> // FileTOopen = QFileDialog::getOpenFileName(); // vali fail
FileTOopen = "C:/WWW/out.txt";readfile(); //loe sisse fail } if(e->key() == Qt::Key_F11){ zoom++; } if(e->key() == Qt::Key_F12){ zoom--; } if(e->key() == Qt::Key_F6){ }
}
OpenGLWindow::~OpenGLWindow()
{
delete m_device;
}
//! [2]
void OpenGLWindow::render(QPainter *painter)
@That line // evokes crash, what to do different or proper to avoid this problem , app is rendering opengl while calling, minigw compiler.