Results 1 to 8 of 8

Thread: Help with QProcess please

  1. #1
    Join Date
    Jan 2012
    Location
    Canary Islands, Spain
    Posts
    86
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Help with QProcess please

    hi, i have a simple code:

    Qt Code:
    1. void lAtari2600(QString rom) {
    2. QSettings settings("frontend.ini", QSettings::IniFormat);
    3. QProcess *launchProcess = new QProcess;
    4.  
    5. comm << "z:/emu/Atari 2600/roms/Asterix (1988) (Atari) (PAL) [!].zip";
    6. launchProcess->start( settings.value("Atari2600/StellaEXE").toString(), comm );
    7. }
    To copy to clipboard, switch view to plain text mode 

    That works

    but the next one doesnt work:
    Qt Code:
    1. void lAtari2600(QString rom) {
    2. QSettings settings("frontend.ini", QSettings::IniFormat);
    3. QProcess *launchProcess = new QProcess;
    4.  
    5. comm << rom;
    6. launchProcess->start( settings.value("Atari2600/StellaEXE").toString(), comm );
    7. }
    To copy to clipboard, switch view to plain text mode 

    i've been hours with this but can't make it work.
    any help?
    Last edited by aguayro; 19th March 2012 at 00:42.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Help with QProcess please

    Add a qDebug() statement outputting the contents of the "rom" variable to make sure the value passed is what you expect it to be.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2012
    Location
    Canary Islands, Spain
    Posts
    86
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Help with QProcess please

    value its ok, qDebug() was the fits thing i did, all seems be ok, qDebug() output always shows the selected rom name:

    ("Z:/emu/Atari 2600/Roms/Asterix (1988) (Atari) (PAL) [!].zip") is the oputput of qDebug() << comm
    Last edited by aguayro; 19th March 2012 at 00:00.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Help with QProcess please

    Did you check the problem is not with StellaEXE failing to open the file or something? Does it get executed at all?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2012
    Location
    Canary Islands, Spain
    Posts
    86
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Help with QProcess please

    Ok, was some strange character, it works with rom.simplified()

    But, still doing strange things, now:

    launchProcess->start( settings.value("Atari2600/StellaEXE").toString(), QStringList() << "-fullscreen 1" << rom.simplified() ); <---doesnt works

    launchProcess->start( settings.value("Atari2600/StellaEXE").toString(), QStringList() << rom.simplified() ); <--- Works

    this is killing me, a lot hours spent

    if i type via cmd.exe: "z:\emu\atari 2600\Stella.exe" -fullscreen 1 "z:\emu\atari 2600\roms\Romname.zip" <-- works ok
    Last edited by aguayro; 19th March 2012 at 01:10.

  6. #6
    Join Date
    Jan 2012
    Location
    Canary Islands, Spain
    Posts
    86
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Help with QProcess please

    i think the problem coud be taht QProcess pass "-fullscreen 1" instead -fullscreen 1, if its quoted doesn't work, i tested it in windows command line
    i've been 1 day stucked with this

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Help with QProcess please

    You need to pass -fullscreen and 1 as two separate strings into your comm object.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Jan 2012
    Location
    Canary Islands, Spain
    Posts
    86
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Help with QProcess please

    Thanks!!!! you saved my project!!
    All is working fine now

Similar Threads

  1. Replies: 0
    Last Post: 26th August 2010, 10:44
  2. QProcess or something else??
    By zakis in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2010, 19:33
  3. QProcess inside QProcess
    By bunjee in forum Qt Programming
    Replies: 7
    Last Post: 4th December 2008, 00:39
  4. help QProcess
    By totosugito in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2008, 14:42
  5. QProcess again ..
    By cmeliak in forum Qt Programming
    Replies: 13
    Last Post: 24th May 2006, 20:56

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
  •  
Qt is a trademark of The Qt Company.