View previous topic :: View next topic |
Author |
Message |
Mitu
Joined: 22 Sep 2009 Posts: 59 Location: Poland
|
Posted: Thu Apr 01, 2010 6:34 am Post subject: Signals - segmentation fault |
|
|
I want to connect a signal from QHttp to an object declared in another module. Unfortunately, I can't get rid of the segmentation fault.
Function:
Code: |
void getServerAddress(uint uid, QObject object, string slot)
{
buffer = new QBuffer();
QHttp http = new QHttp();
object.connect(http, "requestFinished(int,bool)", object, slot); //this line causes segfault
http.setHost("aHost.aDomain.com", 80);
http.get(format("/sth.asp"), buffer);
}
|
And invoking:
Code: |
class Main : QMainWindow
{
this()
{
setWindowTitle("Some window");
// sth else
getServerAddress(0, this, "serverDataReceived(int,bool)");
show();
}
void slot_serverDataReceived(int, bool)
{
// sth here
}
}
|
Would you help me? |
|
Back to top |
|
|
Mitu
Joined: 22 Sep 2009 Posts: 59 Location: Poland
|
Posted: Mon Apr 05, 2010 2:27 am Post subject: |
|
|
I've solved it. I forgot "mixin Q_OBJECT;". |
|
Back to top |
|
|
maxter
Joined: 17 May 2006 Posts: 34
|
Posted: Wed Apr 07, 2010 7:37 am Post subject: |
|
|
It definitely should not segfault but issue a sensible error message. Would you care to post a ticket with the test case? |
|
Back to top |
|
|
Mitu
Joined: 22 Sep 2009 Posts: 59 Location: Poland
|
Posted: Wed Apr 07, 2010 8:56 am Post subject: |
|
|
Done, ticket posted. |
|
Back to top |
|
|
maxter
Joined: 17 May 2006 Posts: 34
|
Posted: Fri Apr 09, 2010 5:53 am Post subject: |
|
|
Thanks! |
|
Back to top |
|
|
|