Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Problem with filedialog for opengl application.

    General and Desktop
    1
    1
    465
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Q
      Q139 last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post