Run windows command line



  • How do make a gui to display output of cmd? e.g.:
    @echo %COMPUTERNAME%@



  • Thanks for the example

    With that I came to

    @void MainWindow::onReadyRead()
    {
    //qDebug() << "onReadyread:" <<
    //myProcess->readAllStandardOutput();
    ui->label->setText(myProcess->readAllStandardOutput());
    }@

    Evenso, it did not only output computername, but also output that always comes out during build which is

    @C:\Users\krustasia\Documents\qtworkspace\build-cmdTest-Desktop_Qt_5_1_1_MinGW_32bit-Debug\debug\cmdTest.exe exited with code 0@

    Sometimes only the above depends on size of label boundary.


Log in to reply
 

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