Results 1 to 9 of 9

Thread: Call QProcess without GUI

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Call QProcess without GUI

    Hi, what what should i write into the connect function to call the slot updateError() that is into the CallApplication class?
    The connect function in not declared in this scope but i dont need that the callApplication.h derive by QMainWindow or something like that. Is there a work around?
    i want just to call a extern process without any GUI.

    callApplication.h
    Qt Code:
    1. #include <QProcess>
    2.  
    3. class CallApplication
    4. {
    5. public:
    6. CallApplication();
    7. ~CallApplication();
    8. void performApplication();
    9. private slots:
    10. void updateError();
    11. void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
    12. void processError(QProcess::ProcessError error);
    13. public:
    14. QProcess process;
    15. };
    To copy to clipboard, switch view to plain text mode 

    callApplication.cpp
    Qt Code:
    1. #include <callApplication.h>
    2.  
    3. CallApplication::CallApplication()
    4. {
    5. connect(&process, SIGNAL(readyReadStandardError()), /*CallApplication*/, SLOT(updateError())); //<--the reciver is CallApplication
    6. }
    7.  
    8. CallApplication::~CallApplication(){}
    9.  
    10. void CallApplication::performApplication()
    11. {
    12. args << "-resize" << "100x100" << "/home/mattia/image1/1.jpg";
    13. process.start("mogrify", args);
    14. }
    15. void CallApplication::updateError(){}
    16.  
    17. void CallApplication::processFinished(int exitCode, QProcess::ExitStatus exitStatus)
    18. {
    19. }
    20.  
    21.  
    22. void CallApplication::processError(QProcess::ProcessError error)
    23. {
    24. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by mattia; 5th November 2007 at 12:03.

Similar Threads

  1. QProcess error to call mogrify
    By mattia in forum Newbie
    Replies: 2
    Last Post: 29th October 2007, 11:46
  2. QProcess and Pipes
    By KaptainKarl in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2007, 23:11
  3. QProcess extremely slow on Windows?
    By Pepe in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2007, 00:25
  4. problem with qprocess
    By deekayt in forum Qt Programming
    Replies: 2
    Last Post: 13th June 2006, 13:30
  5. QProcess / system call not working under linux. Why?
    By johnny_sparx in forum Qt Programming
    Replies: 12
    Last Post: 11th March 2006, 00:32

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.