Results 1 to 9 of 9

Thread: How execute a script in a Qt aplication?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    13
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How execute a script in a Qt aplication?

    yes yes, the script is in /opt/

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

    Default Re: How execute a script in a Qt aplication?

    But what the current working directory is? Did you explicitly set it to /opt? What happens if you call the script as /opt/script.sh instead of ./script.sh?
    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
    Apr 2011
    Posts
    13
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How execute a script in a Qt aplication?

    If i put next code:

    void proves::execapp(){

    QStringList argo,list;
    argo.clear();
    list.clear();

    QProcess * exec;
    exec =new QProcess(this);
    list <<"PATH=/usr/bin/:/bin/:/opt/:/opt/p/:";
    exec->setEnvironment(list);
    exec->start("/opt/calibrate.sh");

    }

    the results are worse, don't appear new PIDs

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

    Default Re: How execute a script in a Qt aplication?

    You forgot to start sh.

    Qt Code:
    1. exec->start("/bin/sh", QStringList() << "/opt/calibrate.sh");
    To copy to clipboard, switch view to plain text mode 
    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
    Apr 2011
    Posts
    13
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How execute a script in a Qt aplication?

    I found the solution....

    the code was correct in all cases.

    in the code i added this line:

    exec->setProcessChannelMode(QProcess::ForwardedChannels );

    Then, when i press the button, in the terminal out the next line:

    TS_OPEN: not such file name.

    TS_OPEN is internal function of TS_LIB, libray of touchScreen control. This function need the specific device of touchScreen.

    To solve this, i added the variable TSLIB_TSDEVICE in environment ---> QStringList list <<"PATH=/opt:/opt/p:/usr/bin:/bin:/sbin:/usr/local/bin:/usr/etc:"<<"TSLIB_TSDEVICE=/dev/input/event1";

    that's all

    thanks for your time

Similar Threads

  1. Simple CAD aplication - how to
    By tommnaj in forum Newbie
    Replies: 3
    Last Post: 5th April 2011, 22:47
  2. Aplication just works where it was compile
    By metRo_ in forum Qt Programming
    Replies: 7
    Last Post: 12th April 2010, 23:02
  3. How can i execute a database script within Qt?
    By NoRulez in forum Qt Programming
    Replies: 3
    Last Post: 14th January 2010, 08:37
  4. How to Execute Qt script from Qt
    By vishal.chauhan in forum Qt Programming
    Replies: 1
    Last Post: 7th May 2007, 09:12
  5. Creating a STANDALONE aplication
    By Alienxs in forum KDE Forum
    Replies: 4
    Last Post: 17th August 2006, 16:02

Tags for this Thread

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.