[Solved] prints nothing in application output



  • hi all this is my prog
    @if(size==0){
    readD.open(QIODevice::ReadOnly);
    QTextStream foint(&readD);
    foint>>flowtime;
    readD.close();
    for(;;){
    this_thread::sleep_for(chrono::seconds(10));
    time_t now=time(0);

          times.open(QIODevice::WriteOnly);
          QTextStream goes(&times),loint(&today);
          goes<<now;
          times.close();
    
              double secs=difftime(now,flowtime);
    
    
              today.open(QIODevice::WriteOnly);
              loint<<secs<<"\n";
              today.close();
    
    
    }
    

    }
    else{
    qDebug()<<"Is Here";
    readD.open(QIODevice::ReadOnly);
    QTextStream foint(&readD);
    foint>>flowtime;
    readD.close();
    int seci=0;
    for(;;){

            this_thread::sleep_for(chrono::seconds(10));
            engine.open(QIODevice::ReadWrite);
            QTextStream eng(&engine);
            eng<<seci;
            engine.close();
            seci+=10;
            if(seci==60){
                seci=0;
                today.open(QIODevice::WriteOnly | QIODevice::Append);
                QTextStream fps(&today);
                fps<<60<<endl;
                today.close();
            }
    

    }
    }
    }
    @
    I Already Check this code The Program Will Enter Else But Only Will Not Print Message That I Write With qDebug Other Codes in Else Will Run Perfectly.



  • Hi..
    The solution is simple: add CONFIG += console to your .pro file and rebuild the whole project.

    hope it helps


Log in to reply
 

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