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
#include <QProcess>
class CallApplication
{
public:
CallApplication();
~CallApplication();
void performApplication();
private slots:
void updateError();
void processFinished
(int exitCode,
QProcess::ExitStatus exitStatus
);
void processError
(QProcess::ProcessError error
);
public:
};
#include <QProcess>
class CallApplication
{
public:
CallApplication();
~CallApplication();
void performApplication();
private slots:
void updateError();
void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
void processError(QProcess::ProcessError error);
public:
QProcess process;
};
To copy to clipboard, switch view to plain text mode
callApplication.cpp
#include <callApplication.h>
CallApplication::CallApplication()
{
connect(&process, SIGNAL(readyReadStandardError()), /*CallApplication*/, SLOT(updateError())); //<--the reciver is CallApplication
}
CallApplication::~CallApplication(){}
void CallApplication::performApplication()
{
args << "-resize" << "100x100" << "/home/mattia/image1/1.jpg";
process.start("mogrify", args);
}
void CallApplication::updateError(){}
void CallApplication
::processFinished(int exitCode,
QProcess::ExitStatus exitStatus
) {
}
void CallApplication
::processError(QProcess::ProcessError error
) {
}
#include <callApplication.h>
CallApplication::CallApplication()
{
connect(&process, SIGNAL(readyReadStandardError()), /*CallApplication*/, SLOT(updateError())); //<--the reciver is CallApplication
}
CallApplication::~CallApplication(){}
void CallApplication::performApplication()
{
QStringList args;
args << "-resize" << "100x100" << "/home/mattia/image1/1.jpg";
process.start("mogrify", args);
}
void CallApplication::updateError(){}
void CallApplication::processFinished(int exitCode, QProcess::ExitStatus exitStatus)
{
}
void CallApplication::processError(QProcess::ProcessError error)
{
}
To copy to clipboard, switch view to plain text mode
Bookmarks