Results 1 to 6 of 6

Thread: Qprocess

  1. #1
    Join Date
    Feb 2006
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Qprocess

    Hi there!

    Do you have any idea, why this is not working for me?
    Qprocess seems that doesn't handle well the process arguments..
    When I run a command like "ls -l" with one argument, it works fine..... but ..
    connecting with "pppd call vodafone" , is not working....

    Thanks in advance.

    ....................

    void Form1::callfunc()
    {
    textEdit1->append("Starting pppd daemon...");
    process = new QProcess(this);
    process->addArgument( "pppd" );
    process->addArgument( "call" );
    process->addArgument( "vodafone" );
    connect(process,SIGNAL(readyReadStdout()),
    this, SLOT(updateText()));
    connect(process, SIGNAL(processExited()),
    this, SLOT(processExited()));
    process->start();
    }

    ...............

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qprocess

    Do you have enough privileges to run pppd? Is it on your path?

  3. #3
    Join Date
    Feb 2006
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Qprocess

    Thank you very much for the reply Jacek,

    pppd is in my path and the program is running as user root.

    I don't know how to debug it....

    void Form1::callfunc()
    {
    textEdit1->append("Starting pppd daemon...");
    process = new QProcess(this);
    process->addArgument( "pppd" );
    process->addArgument( "call" );
    process->addArgument( "vodafone" );
    qDebug("Reading args..."); // some output here
    connect(process,SIGNAL(readyReadStdout()),
    this, SLOT(updateText()));
    connect(process, SIGNAL(processExited()),
    this, SLOT(processExited()));

    qDebug("starting process..."); // see some output
    process->start();

    if ( !process->start() ) {
    // error handling
    QMessageBox::critical( 0,
    tr("Fatal error"),
    tr("Could not start the pppd command."),
    tr("Quit") );
    exit( -1 );
    }

    }


    It seems to be running, because I don't get an error message, but it's not.
    I should have an output on my /var/log/messages about pppd, but nothing


    Thank you....

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qprocess

    Quote Originally Posted by ioannisb
    qDebug("starting process..."); // see some output
    process->start();

    if ( !process->start() ) {
    // error handling
    // ...
    }
    You try to start that process twice. If you remove one "process->start()", what does the other one returns?

  5. #5
    piotrpsz Guest

    Default Re: Qprocess

    hi,

    try to set a working directory - setWorkingDirectory

    piotr

  6. #6
    Join Date
    Feb 2006
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Qprocess

    Thanks guys, it seems to be a problem with pppd daemon..... all working fine now.
    Thanks a lot for your help.

Similar Threads

  1. Detect First QProcess finished in a group and kill other
    By Davidaino in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2008, 12:53
  2. QProcess exitStatus()
    By user_mail07 in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2008, 20:51
  3. QProcess and Pipes
    By KaptainKarl in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2007, 23:11
  4. QProcess extremely slow on Windows?
    By Pepe in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2007, 00:25
  5. problem with qprocess
    By deekayt in forum Qt Programming
    Replies: 2
    Last Post: 13th June 2006, 13:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.