Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Calling Qfiledialog form openglwindow example
Forum Updated to NodeBB v4.3 + New Features

Calling Qfiledialog form openglwindow example

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.7k Views 3 Watching
  • 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 Offline
    Q Offline
    Q139
    wrote on last edited by Q139
    #1

    Link to code where calling gui elements cause problem
    If calling QFiledialog or new gui form main.cpp or openglwindow.cpp app crashes.
    Also tryed creating thread by :

    Thread1* obj = new Thread1;
    obj->start();

    And under seperate thread running qfiledialog also causes crash.

    if while(1){} under thread works fine and can get cpu too 100% if start many times.
    How to connect gui and openfiledialog to opengl example?

    Problem is i have made graph app with that example and would be nice to have seperate gui and other gui based elements to configure.
    http://postimg.org/image/wy6eqteh9/

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      Do not show dialogs from worker threads. Ui elements (widgets, dialogs etc.) can live only in the main thread.

      One known issue is showing dialogs from initializeGL function and you shouldn't be doing that if you are.
      Can you show the code opening the dialog?

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        Q139
        wrote on last edited by Q139
        #3

        QString filenam;
        filenam = QFileDialog::getOpenFileName(0,"Vali graafiku fail");
        Initialize gl is working in main .cpp file and opening gui crashes always.
        How to run opengl and qt gui same time?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Where exactly are you calling this ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            Q139
            wrote on last edited by Q139
            #5

            In openglwindow . cpp

                      if(e->key() == Qt::Key_5){
            

            filenam = QFileDialog::getOpenFileName(0,"Vali graafiku fail");
            }

            Call from main also cause problems.

            Is only way to make opengl draw from other thread or could use same thread for gui as well?

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved