Hello, i get a segmentation fault when i emit a signal, down here there are some snippet of code, maybe somebody can give me a hint.
Thanks
clientsocket.h
#include <QTcpSocket>
#include <QtGui>
#include "callApplication.h"
{
Q_OBJECT
private slots:
void generateError();
void readClient();
private:
CallApplication *callApplication;
};
#include <QTcpSocket>
#include <QtGui>
#include "callApplication.h"
class ClientSocket : public QTcpSocket
{
Q_OBJECT
private slots:
void generateError();
void readClient();
private:
CallApplication *callApplication;
};
To copy to clipboard, switch view to plain text mode
clientsocket.cpp
{
connect(this->callApplication, SIGNAL(error()), this, SLOT(generateError())); //<-- segmentation fault
connect(this, SIGNAL(readyRead()), this, SLOT(readClient()));
}
ClientSocket::readClient(){
//read something from client...
callApplication = new CallApplication(this->textBrowserPark);
}
ClientSocket::ClientSocket(QTextBrowser *textBrowser)
{
connect(this->callApplication, SIGNAL(error()), this, SLOT(generateError())); //<-- segmentation fault
connect(this, SIGNAL(readyRead()), this, SLOT(readClient()));
}
ClientSocket::readClient(){
//read something from client...
callApplication = new CallApplication(this->textBrowserPark);
}
To copy to clipboard, switch view to plain text mode
callApplication.h
#include <QProcess>
class CallApplication
: public QObject{
Q_OBJECT
signals:
void error();
private:
performApplication();
public:
};
#include <QProcess>
class CallApplication : public QObject
{
Q_OBJECT
signals:
void error();
private:
performApplication();
public:
QProcess process;
};
To copy to clipboard, switch view to plain text mode
callApplication.cpp
void CallApplication::performApplication()
{
emit error();
}
void CallApplication::performApplication()
{
emit error();
}
To copy to clipboard, switch view to plain text mode
Bookmarks