Application Output - End button Not Disable



  • Hi,

    I was created QDialog for capture camera data. Its working good. i have doubt on,

    1. Just Application Run & End :OK
      Build-> Run-> Application open -> clicked close button from top right corner -> Dialog closed -> QT Creator's Application end button disabled perfectly [/home/Proj/build/Test exited with code 0].

    2. Application Run with Camera data capture process & End : PROBLEM
      Build-> Run-> Application open ->Start Capture -> Stop Capture -> clicked close button from top right corner -> Dialog closed -> QT Creator's Application end button Still Enabled [Starting /home/Proj/build/Test... - here not exited with code 0].

    What is the reason?
    How can i recover from this problem?


  • Qt Champions 2016

    @Meenu
    Probably your application hangs on exit. Break the execution (use the pause button in the debug view) when that happens (case 2) and extract a stack trace to see where the problem might lie.

    Kind regards.



  • @kshegunov
    No hanging problem while exit.
    So i like to print the message using qDebug().

    Dialog::~Dialog()
    {
        if(startcapture)  on_StopCapture();
        delete ui;
        qDebug() << "deleted ui";
    }
    

    Dialog open and Close (No Data Capture Process):
    Starting /home/Proj/build/Test...
    deleted ui
    /home/Proj/build/Test exited with code 0

    Dialog open with Data Capture Process then close:
    Starting /home/Proj/build/Test...
    Start Capture
    End Capture
    deleted ui
    Note: After calls destructor function, More then 60 to 100 seconds taken to end the application normally like - /home/Proj/build/Test exited with code 0

    What is the reason?


  • Moderators

    Hi @Meenu,

    Please show us the code on how you start and stop the camera



  • used timer concept to capture camera data.

    void timer_handler(void)
    {     
        StartAcquisition();  
    }
    void Dialog::on_StartCapture()//button clicked
    { 
      if(start_timer(1000, &timer_handler))
      {
        printf("\n timer error\n");
      }
    }
    void Dialog::on_StopCapture()//button clicked
    {        
        stop_timer();
        StopAcquisition();
    }
    

    I have one more problem.
    I like to use more than one timer in my application using this timer concept. I tired but single timer only execute(which one is last defined). Kindly clear me.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.